40 lines
1.4 KiB
Matlab
40 lines
1.4 KiB
Matlab
function [gend, data] = read_data
|
|
% Part of the Sensitivity Analysis Toolbox for DYNARE
|
|
%
|
|
% Written by Marco Ratto, 2006
|
|
% Joint Research Centre, The European Commission,
|
|
% (http://eemc.jrc.ec.europa.eu/),
|
|
% marco.ratto@jrc.it
|
|
%
|
|
% Disclaimer: This software is not subject to copyright protection and is in the public domain.
|
|
% It is an experimental system. The Joint Research Centre of European Commission
|
|
% assumes no responsibility whatsoever for its use by other parties
|
|
% and makes no guarantees, expressed or implied, about its quality, reliability, or any other
|
|
% characteristic. We would appreciate acknowledgement if the software is used.
|
|
% Reference:
|
|
% M. Ratto, Global Sensitivity Analysis for Macroeconomic models, MIMEO, 2006.
|
|
%
|
|
|
|
global options_ bayestopt_
|
|
|
|
rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);
|
|
|
|
options_ = set_default_option(options_,'nobs',size(rawdata,1)-options_.first_obs+1);
|
|
gend = options_.nobs;
|
|
|
|
rawdata = rawdata(options_.first_obs:options_.first_obs+gend-1,:);
|
|
if options_.loglinear == 1 & ~options_.logdata
|
|
rawdata = log(rawdata);
|
|
end
|
|
if options_.prefilter == 1
|
|
bayestopt_.mean_varobs = mean(rawdata,1);
|
|
data = transpose(rawdata-ones(gend,1)*bayestopt_.mean_varobs);
|
|
else
|
|
data = transpose(rawdata);
|
|
end
|
|
|
|
if ~isreal(rawdata)
|
|
error(['There are complex values in the data. Probably a wrong' ...
|
|
' transformation'])
|
|
end
|