Commit 28da4a09 authored by ratto's avatar ratto
Browse files

Updated sensitivity package !!!

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1235 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 663fdccd
function c = dat_fil_(data_file);
%
% 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.
%
eval(data_file);
clear data_file;
a=who;
for j=1:length(a)
eval(['c.',a{j},'=',a{j},';']);
end
\ No newline at end of file
function dynare_MC(var_list_,OutDir)
%
% Adapted by M. Ratto from dynare_estimation.m and posteriorsmoother.m
% (dynare_estimation.m and posteriorsmoother.m are part of DYNARE,
% copyright M. Juillard)
%
% 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 M_ options_ oo_ estim_params_
global bayestopt_
% temporary fix until M_.H is initialized by the parser
M_.H = [];
options_.varlist = var_list_;
options_.lgyidx2varobs = zeros(size(M_.endo_names,1),1);
for i = 1:size(M_.endo_names,1)
tmp = strmatch(deblank(M_.endo_names(i,:)),options_.varobs,'exact');
if ~isempty(tmp)
options_.lgyidx2varobs(i,1) = tmp;
end
end
options_ = set_default_option(options_,'first_obs',1);
options_ = set_default_option(options_,'prefilter',0);
options_ = set_default_option(options_,'presample',0);
options_ = set_default_option(options_,'lik_algo',1);
options_ = set_default_option(options_,'lik_init',1);
options_ = set_default_option(options_,'nograph',0);
options_ = set_default_option(options_,'mh_conf_sig',0.90);
options_ = set_default_option(options_,'mh_replic',20000);
options_ = set_default_option(options_,'mh_drop',0.5);
options_ = set_default_option(options_,'mh_jscale',0.2);
options_ = set_default_option(options_,'mh_init_scale',2*options_.mh_jscale);
options_ = set_default_option(options_,'mode_file','');
options_ = set_default_option(options_,'mode_compute',4);
options_ = set_default_option(options_,'mode_check',0);
options_ = set_default_option(options_,'prior_trunc',1e-10);
options_ = set_default_option(options_,'mh_mode',1);
options_ = set_default_option(options_,'mh_nblck',2);
options_ = set_default_option(options_,'load_mh_file',0);
options_ = set_default_option(options_,'nodiagnostic',0);
options_ = set_default_option(options_,'loglinear',0);
options_ = set_default_option(options_,'unit_root_vars',[]);
options_ = set_default_option(options_,'XTick',[]);
options_ = set_default_option(options_,'XTickLabel',[]);
options_ = set_default_option(options_,'bayesian_irf',0);
options_ = set_default_option(options_,'bayesian_th_moments',0);
options_ = set_default_option(options_,'TeX',0);
options_ = set_default_option(options_,'irf',40);
options_ = set_default_option(options_,'relative_irf',0);
options_ = set_default_option(options_,'order',1);
options_ = set_default_option(options_,'ar',5);
options_ = set_default_option(options_,'dr_algo',0);
options_ = set_default_option(options_,'linear',0);
options_ = set_default_option(options_,'drop',0);
options_ = set_default_option(options_,'replic',1);
options_ = set_default_option(options_,'hp_filter',0);
options_ = set_default_option(options_,'forecast',0);
options_ = set_default_option(options_,'smoother',0);
options_ = set_default_option(options_,'moments_varendo',0);
options_ = set_default_option(options_,'filtered_vars',0);
options_ = set_default_option(options_,'kalman_algo',1);
options_ = set_default_option(options_,'kalman_tol',10^(-12));
options_ = set_default_option(options_,'posterior_mode_estimation',1);
options_ = set_default_option(options_,'MaxNumberOfBytes',1e6);
options_ = set_default_option(options_,'xls_sheet','');
options_ = set_default_option(options_,'xls_range','');
options_ = set_default_option(options_,'filter_step_ahead',0);
options_ = set_default_option(options_,'diffuse_d',[]);
options_ = set_default_option(options_,'Opt6Iter',3);
options_ = set_default_option(options_,'Opt6Numb',100000);
options_ = set_default_option(options_,'steadystate_flag',0);
options_ = set_default_option(options_,'logdata',0);
options_ = set_default_option(options_,'use_mh_covariance_matrix',0);
if exist([M_.fname '_steadystate.m'])
options_.steadystate_flag = 1;
end
if options_.filtered_vars ~= 0 & options_.filter_step_ahead == 0
options_.filter_step_ahead = 1;
end
if options_.bayesian_irf & options_.irf == 0
options_.irf = 40;
end
if options_.filter_step_ahead ~= 0
options_.nk = max(options_.filter_step_ahead);
else
options_.nk = 0;
end
%% Add something to the parser ++>
M_.dname = M_.fname; % The user should be able to choose another name
% for the directory...
pnames = [' ';'beta ';'gamm ';'norm ';'invg ';'unif ';'invg2'];
n_varobs = size(options_.varobs,1);
[xparam1,estim_params_,bayestopt_,lb,ub] = set_prior(estim_params_);
bounds = prior_bounds(bayestopt_);
bounds(:,1)=max(bounds(:,1),lb);
bounds(:,2)=min(bounds(:,2),ub);
if any(xparam1 < bounds(:,1)) | any(xparam1 > bounds(:,2))
find(xparam1 < bounds(:,1))
find(xparam1 > bounds(:,2))
error('Initial parameter values are outside parameter bounds')
end
lb = bounds(:,1);
ub = bounds(:,2);
bayestopt_.lb = lb;
bayestopt_.ub = ub;
if ~isfield(options_,'trend_coeffs')
bayestopt_.with_trend = 0;
else
bayestopt_.with_trend = 1;
bayestopt_.trend_coeff = {};
trend_coeffs = options_.trend_coeffs;
nt = length(trend_coeffs);
for i=1:n_varobs
if i > length(trend_coeffs)
bayestopt_.trend_coeff{i} = '0';
else
bayestopt_.trend_coeff{i} = trend_coeffs{i};
end
end
end
bayestopt_.penalty = 1e8; % penalty
nvx = estim_params_.nvx;
nvn = estim_params_.nvn;
ncx = estim_params_.ncx;
ncn = estim_params_.ncn;
np = estim_params_.np ;
nx = nvx+nvn+ncx+ncn+np;
dr = set_state_space([]);
%% Initialization with unit-root variables
if ~isempty(options_.unit_root_vars)
n_ur = size(options_.unit_root_vars,1);
i_ur = zeros(n_ur,1);
for i=1:n_ur
i1 = strmatch(deblank(options_.unit_root_vars(i,:)),M_.endo_names(dr.order_var,:),'exact');
if isempty(i1)
error('Undeclared variable in unit_root_vars statement')
end
i_ur(i) = i1;
end
if M_.maximum_lag > 1
l1 = flipud([cumsum(M_.lead_lag_incidence(1:M_.maximum_lag-1,dr.order_var),1);ones(1,M_.endo_nbr)]);
n1 = nnz(l1);
bayestopt_.Pinf = zeros(n1,n1);
l2 = find(l1');
l3 = zeros(M_.endo_nbr,M_.maximum_lag);
l3(i_ur,:) = l1(:,i_ur)';
l3 = l3(:);
i_ur1 = find(l3(l2));
i_stable = ones(M_.endo_nbr,1);
i_stable(i_ur) = zeros(n_ur,1);
i_stable = find(i_stable);
bayestopt_.Pinf(i_ur1,i_ur1) = diag(ones(1,length(i_ur1)));
bayestopt_.i_var_stable = i_stable;
l3 = zeros(M_.endo_nbr,M_.maximum_lag);
l3(i_stable,:) = l1(:,i_stable)';
l3 = l3(:);
bayestopt_.i_T_var_stable = find(l3(l2));
else
n1 = M_.endo_nbr;
bayestopt_.Pinf = zeros(n1,n1);
bayestopt_.Pinf(i_ur,i_ur) = diag(ones(1,length(i_ur)));
l1 = ones(M_.endo_nbr,1);
l1(i_ur,:) = zeros(length(i_ur),1);
bayestopt_.i_T_var_stable = find(l1);
end
options_.lik_init = 3;
end % if ~isempty(options_.unit_root_vars)
npar = nvx+nvn+ncx+ncn+np;
if isempty(options_.datafile)
error('ESTIMATION: datafile option is missing')
......@@ -183,36 +48,9 @@ if isempty(options_.varobs)
error('ESTIMATION: VAROBS is missing')
end
%% If jscale isn't specified for an estimated parameter, use
%% global option options_.jscale, set to 0.2, by default
k = find(isnan(bayestopt_.jscale));
bayestopt_.jscale(k) = options_.mh_jscale;
%% Read and demean data
rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);
k = [];
k1 = [];
for i=1:n_varobs
k = [k strmatch(deblank(options_.varobs(i,:)),M_.endo_names(dr.order_var,:),'exact')];
k1 = [k1 strmatch(deblank(options_.varobs(i,:)),M_.endo_names, 'exact')];
end
% union of observed and state variables
k2 = union(k',[dr.nstatic+1:dr.nstatic+dr.npred]');
% including variables in t-2 and earlier, if any
k2 = [k2;[M_.endo_nbr+(1:dr.nspred-dr.npred)]'];
% set restrict_state to postion of observed + state variables
% in expanded state vector
bayestopt_.restrict_state = k2;
% set mf1 to positions of observed variables in restricted state vector
% for likelihood computation
[junk,bayestopt_.mf1] = ismember(k,k2);
% set mf2 to positions of observed variables in expanded state vector
% for filtering and smoothing
bayestopt_.mf2 = k;
bayestopt_.mfys = k1;
options_ = set_default_option(options_,'nobs',size(rawdata,1)-options_.first_obs+1);
gend = options_.nobs;
......@@ -232,12 +70,6 @@ if ~isreal(rawdata)
' transformation'])
end
nvx = estim_params_.nvx;
nvn = estim_params_.nvn;
ncx = estim_params_.ncx;
ncn = estim_params_.ncn;
np = estim_params_.np ;
npar = nvx+nvn+ncx+ncn+np;
offset = npar-np;
fname_=M_.fname;
......@@ -257,39 +89,40 @@ load(options_.mode_file)
x=[lpmat0(istable,:) lpmat(istable,:)];
clear lpmat lpmat0 istable %iunstable egg yys T
B = size(x,1);
if M_.maximum_lag > 1
l1 = flipud([cumsum(M_.lead_lag_incidence(1:M_.maximum_lag-1,dr.order_var),1);ones(1,M_.endo_nbr)]);
n1 = nnz(l1);
else
n1 = M_.endo_nbr;
end
[atT,innov,measurement_error,filtered_state_vector,ys,trend_coeff, aK] = DsgeSmoother(x(1,:)',gend,data);
n1=size(atT,1);
nfil=B/40;
stock_smooth = zeros(gend,n1,40);
stock_filter = zeros(gend+1,n1,40);
stock_ys = zeros(M_.endo_nbr,40);
stock_smooth = zeros(M_.endo_nbr,gend,40);
stock_filter = zeros(M_.endo_nbr,gend+1,40);
stock_ys = zeros(40, M_.endo_nbr);
logpo2=zeros(B,1);
%%
h = waitbar(0,'MC smoother ...');
delete([OutDir,'\',namfile,'_*.mat'])
ib=0;
ifil=0;
opt_gsa=options_.opt_gsa;
for b=1:B
ib=ib+1;
deep = x(b,:);
deep = x(b,:)';
set_all_parameters(deep);
dr = resol(oo_.steady_state,0);
%deep(1:offset) = xparam1(1:offset);
logpo2(b,1) = DsgeLikelihood(deep',gend,data);
logpo2(b,1) = DsgeLikelihood(deep,gend,data);
if opt_gsa.lik_only==0,
[atT,innov,measurement_error,filtered_state_vector,ys,trend_coeff] = DsgeSmoother(deep,gend,data);
stock_smooth(:,:,ib)=atT';
stock_filter(:,:,ib)=filtered_state_vector';
stock_ys(:,ib)=ys;
[atT,innov,measurement_error,filtered_state_vector,ys,trend_coeff, aK] = DsgeSmoother(deep,gend,data);
stock_smooth(:,:,ib)=atT(1:M_.endo_nbr,:);
stock_filter(:,:,ib)=filtered_state_vector(1:M_.endo_nbr,:);
%stock_filter(:,:,ib)=aK(options_.filter_step_ahead,1:M_.endo_nbr,:);
stock_ys(ib,:)=ys';
if ib==40,
ib=0;
ifil=ifil+1;
save([OutDir,'\',namfile,'_',num2str(ifil)],'stock_smooth','stock_filter','stock_ys')
stock_smooth = zeros(gend,n1,40);
stock_filter = zeros(gend+1,n1,40);
stock_ys = zeros(M_.endo_nbr,40);
stock_smooth = zeros(M_.endo_nbr,gend,40);
stock_filter = zeros(M_.endo_nbr,gend+1,40);
stock_ys = zeros(40, M_.endo_nbr);
end
end
waitbar(b/B,h,['MC smoother ...',num2str(b),'/',num2str(B)]);
......@@ -300,7 +133,7 @@ if ib>0,
ifil=ifil+1;
stock_smooth = stock_smooth(:,:,1:ib);
stock_filter = stock_filter(:,:,1:ib);
stock_ys = stock_ys(:,1:ib);
stock_ys = stock_ys(1:ib,:);
save([OutDir,'\',namfile,'_',num2str(ifil)],'stock_smooth','stock_filter','stock_ys')
end
end
......
function x0=dynare_sensitivity()
% copyright Marco Ratto 2006
% 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 M_ options_ oo_ bayestopt_
......@@ -10,29 +24,100 @@ x0=[];
options_ = set_default_option(options_,'opt_gsa',1);
options_gsa_ = options_.opt_gsa;
options_gsa_ = set_default_option(options_gsa_,'identification',0);
if options_gsa_.identification,
options_gsa_.redform=0;
options_gsa_ = set_default_option(options_gsa_,'morris',1);
end
% map stability
options_gsa_ = set_default_option(options_gsa_,'stab',1);
options_gsa_ = set_default_option(options_gsa_,'redform',0);
options_gsa_ = set_default_option(options_gsa_,'pprior',1);
options_gsa_ = set_default_option(options_gsa_,'prior_range',1);
options_gsa_ = set_default_option(options_gsa_,'ppost',0);
options_gsa_ = set_default_option(options_gsa_,'ilptau',1);
options_gsa_ = set_default_option(options_gsa_,'morris',0);
options_gsa_ = set_default_option(options_gsa_,'glue',0);
options_gsa_ = set_default_option(options_gsa_,'morris_nliv',6);
options_gsa_ = set_default_option(options_gsa_,'morris_ntra',20);
options_gsa_ = set_default_option(options_gsa_,'Nsam',2048);
options_gsa_ = set_default_option(options_gsa_,'load_redform',0);
options_gsa_ = set_default_option(options_gsa_,'load_rmse',0);
options_gsa_ = set_default_option(options_gsa_,'load_stab',0);
options_gsa_ = set_default_option(options_gsa_,'alpha2_stab',0.3);
options_gsa_ = set_default_option(options_gsa_,'ksstat',0.1);
%options_gsa_ = set_default_option(options_gsa_,'load_mh',0);
OutputDirectoryName = CheckPath('GSA');
if options_gsa_.redform,
options_gsa_.pprior=1;
options_gsa_.ppost=0;
end
if options_gsa_.morris,
if ~(exist('Sampling_Function_2','file')==6 | exist('Sampling_Function_2','file')==2),
disp('Download pre-parsed mapping routines at:')
disp('http://eemc.jrc.ec.europa.eu/softwareDYNARE-Dowload.htm')
disp(' ' )
error('Mapping routines missing!')
end
options_gsa_.pprior=1;
options_gsa_.ppost=0;
%options_gsa_.stab=1;
options_gsa_.glue=0;
options_gsa_.rmse=0;
options_gsa_.load_rmse=0;
options_gsa_.alpha2_stab=1;
options_.ksstat=1;
if options_gsa_.morris==2,
options_gsa_ = set_default_option(options_gsa_,'Nsam',256);
OutputDirectoryName = CheckPath('GSA/IDENTIF');
else
OutputDirectoryName = CheckPath('GSA/SCREEN');
end
else
OutputDirectoryName = CheckPath('GSA');
end
options_.opt_gsa = options_gsa_;
if (options_gsa_.load_stab | options_gsa_.load_rmse | options_gsa_.load_redform) ...
& options_gsa_.pprior,
filetoload=[OutputDirectoryName '\' fname_ '_prior.mat'];
if isempty(ls(filetoload)),
disp([filetoload,' not found!'])
disp(['You asked to load a non existent analysis'])
%options_gsa_.load_stab=0;
return,
else
if isempty(strmatch('bkpprior',who('-file', filetoload),'exact')),
disp('Warning! Missing prior info for saved sample') % trap for files previous
disp('The saved files are generated with previous version of GSA package') % trap for files previous
else
load(filetoload,'bkpprior'),
if any(bayestopt_.pshape~=bkpprior.pshape) | ...
any(bayestopt_.p1~=bkpprior.p1) | ...
any(bayestopt_.p2~=bkpprior.p2) | ...
any(bayestopt_.p3(~isnan(bayestopt_.p3))~=bkpprior.p3(~isnan(bkpprior.p3))) | ...
any(bayestopt_.p4(~isnan(bayestopt_.p4))~=bkpprior.p4(~isnan(bkpprior.p4))),
disp('WARNING!')
disp('The saved sample has different priors w.r.t. to current ones!!')
disp('')
disp('Press ENTER to continue')
pause;
end
end
end
end
if options_gsa_.stab & ~options_gsa_.ppost,
x0 = stab_map_(options_gsa_.Nsam, options_gsa_.load_stab, options_gsa_.ksstat, options_gsa_.alpha2_stab, ...
options_gsa_.redform, options_gsa_.pprior, options_gsa_.ilptau, OutputDirectoryName);
x0 = stab_map_(OutputDirectoryName);
end
% reduced form
% redform_map(namendo, namlagendo, namexo, icomp, pprior, ilog, threshold)
options_gsa_ = set_default_option(options_gsa_,'load_redform',0);
options_gsa_ = set_default_option(options_gsa_,'logtrans_redform',0);
options_gsa_ = set_default_option(options_gsa_,'threshold_redform',[]);
options_gsa_ = set_default_option(options_gsa_,'ksstat_redform',0.1);
......@@ -41,20 +126,22 @@ options_gsa_ = set_default_option(options_gsa_,'namendo',[]);
options_gsa_ = set_default_option(options_gsa_,'namlagendo',[]);
options_gsa_ = set_default_option(options_gsa_,'namexo',[]);
if options_gsa_.redform & ~isempty(options_gsa_.namendo) & ~options_gsa_.ppost,
redform_map(options_gsa_.namendo, options_gsa_.namlagendo, options_gsa_.namexo, ...
options_gsa_.load_redform, options_gsa_.pprior, options_gsa_.logtrans_redform, ...
options_gsa_.threshold_redform, options_gsa_.ksstat_redform, ...
options_gsa_.alpha2_redform, OutputDirectoryName);
options_.opt_gsa = options_gsa_;
if options_gsa_.redform & ~isempty(options_gsa_.namendo) ...
& ~options_gsa_.ppost,
if options_gsa_.morris,
redform_screen(OutputDirectoryName);
else
redform_map(OutputDirectoryName);
end
end
% RMSE mapping
% function [rmse_MC, ixx] = filt_mc_(vvarvecm, loadSA, pfilt, alpha, alpha2)
options_gsa_ = set_default_option(options_gsa_,'rmse',0);
options_gsa_ = set_default_option(options_gsa_,'lik_only',0);
options_gsa_ = set_default_option(options_gsa_,'var_rmse',options_.varobs);
options_gsa_ = set_default_option(options_gsa_,'load_rmse',0);
options_gsa_ = set_default_option(options_gsa_,'pfilt_rmse',0.1);
options_gsa_ = set_default_option(options_gsa_,'istart_rmse',1);
options_gsa_ = set_default_option(options_gsa_,'istart_rmse',options_.presample+1);
options_gsa_ = set_default_option(options_gsa_,'alpha_rmse',0.002);
options_gsa_ = set_default_option(options_gsa_,'alpha2_rmse',1);
options_.opt_gsa = options_gsa_;
......@@ -68,16 +155,27 @@ if options_gsa_.rmse,
if isempty(a),
dynare_MC([],OutputDirectoryName);
options_gsa_.load_rmse=0;
% else
% if options_gsa_.load_rmse==0,
% disp('You already saved a MC filter/smoother analysis ')
% disp('Do you want to overwrite ?')
% pause;
% if options_gsa_.pprior
% delete([OutputDirectoryName,'\',fname_,'_prior_*.mat'])
% else
% delete([OutputDirectoryName,'\',fname_,'_mc_*.mat'])
% end
% dynare_MC([],OutputDirectoryName);
% options_gsa_.load_rmse=0;
% end
end
end
clear a;
filt_mc_(options_gsa_.var_rmse, options_gsa_.load_rmse, options_gsa_.pfilt_rmse, ...
options_gsa_.alpha_rmse, options_gsa_.alpha2_rmse, OutputDirectoryName, ...
options_gsa_.istart_rmse);
filt_mc_(OutputDirectoryName);
end
options_gsa_ = set_default_option(options_gsa_,'glue',0);
if options_gsa_.glue,
dr_ = oo_.dr;
if options_gsa_.ppost
......@@ -90,6 +188,11 @@ if options_gsa_.glue,
load([OutputDirectoryName,'\',fname_,'_mc']);
end
end
if ~exist('x'),
disp(['No RMSE analysis is available for current options'])
disp(['No GLUE file prepared'])
return,
end
nruns=size(x,1);
gend = options_.nobs;
rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);
......@@ -114,12 +217,14 @@ if options_gsa_.glue,
jxj = strmatch(vj,lgy_(dr_.order_var,:),'exact');
js = strmatch(vj,lgy_,'exact');
if ~options_gsa_.ppost
y0=zeros(gend+1,nruns);
nb = size(stock_filter,3);
y0 = squeeze(stock_filter(:,jxj,:)) + ...
kron(stock_ys(js,:),ones(size(stock_filter,1),1));
Out(j).data = y0';
Out(j).time = [1:size(y0,1)];
% y0=zeros(gend+1,nruns);
% nb = size(stock_filter,3);
% y0 = squeeze(stock_filter(:,jxj,:)) + ...
% kron(stock_ys(js,:),ones(size(stock_filter,1),1));
% Out(j).data = y0';
% Out(j).time = [1:size(y0,1)];
Out(j).data = jxj;
Out(j).time = [pwd,'\',OutputDirectoryName];
else
Out(j).data = jxj;
Out(j).time = [pwd,'\',DirectoryName];
......@@ -132,12 +237,13 @@ if options_gsa_.glue,
Lik(j).data = rmse_MC(:,j)';
if ~options_gsa_.ppost
y0 = squeeze(stock_smooth(:,jxj,:)) + ...
kron(stock_ys(js,:),ones(size(stock_smooth,1),1));
Out1(j).name = vj;
Out1(j).ini = 'yes';
Out1(j).time = [1:size(y0,1)];
Out1(j).data = y0';
% y0 = squeeze(stock_smooth(:,jxj,:)) + ...
% kron(stock_ys(js,:),ones(size(stock_smooth,1),1));
% Out1(j).name = vj;
% Out1(j).ini = 'yes';
% Out1(j).time = [1:size(y0,1)];
% Out1(j).data = y0';
Out1=Out;
else
Out1=Out;
end
......@@ -150,10 +256,12 @@ if options_gsa_.glue,
jsmoo=jsmoo+1;
vj=deblank(M_.endo_names(dr_.order_var(j),:));
if ~options_gsa_.ppost
y0 = squeeze(stock_smooth(:,j,:)) + ...
kron(stock_ys(j,:),ones(size(stock_smooth,1),1));
Out1(jsmoo).time = [1:size(y0,1)];
Out1(jsmoo).data = y0';
% y0 = squeeze(stock_smooth(:,j,:)) + ...
% kron(stock_ys(j,:),ones(size(stock_smooth,1),1));
% Out1(jsmoo).time = [1:size(y0,1)];
% Out1(jsmoo).data = y0';
Out1(jsmoo).data = j;
Out1(jsmoo).time = [pwd,'\',OutputDirectoryName];
else
Out1(jsmoo).data = j;
Out1(jsmoo).time = [pwd,'\',DirectoryName];
......@@ -179,22 +287,30 @@ if options_gsa_.glue,