Commit 06f363da authored by Houtan Bastani's avatar Houtan Bastani
Browse files

ms-sbvar bugfix: support median option

parent 6ef0f0c9
...@@ -49,6 +49,10 @@ opt = { ... ...@@ -49,6 +49,10 @@ opt = { ...
{'thin', options_.ms.thinning_factor} {'thin', options_.ms.thinning_factor}
}; };
if options_.ms.median
opt = [opt(:)' {{'median'}}];
end
[err, forecast] = mex_ms_forecast([opt(:)', {{'free_parameters',oo_.ms.maxparams}, ... [err, forecast] = mex_ms_forecast([opt(:)', {{'free_parameters',oo_.ms.maxparams}, ...
{'shocks_per_parameter', options_.ms.shock_draws}}]); {'shocks_per_parameter', options_.ms.shock_draws}}]);
mexErrCheck('mex_ms_forecast ergodic ', err); mexErrCheck('mex_ms_forecast ergodic ', err);
......
...@@ -50,6 +50,10 @@ opt = { ... ...@@ -50,6 +50,10 @@ opt = { ...
{'thin', options_.ms.thinning_factor} {'thin', options_.ms.thinning_factor}
}; };
if options_.ms.median
opt = [opt(:)' {{'median'}}];
end
[err, irf] = mex_ms_irf([opt(:)', {{'free_parameters', oo_.ms.maxparams}, {'shocks_per_parameter', options_.ms.shock_draws}}]); [err, irf] = mex_ms_irf([opt(:)', {{'free_parameters', oo_.ms.maxparams}, {'shocks_per_parameter', options_.ms.shock_draws}}]);
mexErrCheck('mex_ms_irf ergodic ', err); mexErrCheck('mex_ms_irf ergodic ', err);
plot_ms_irf(M_,options_,irf,options_.varobs,'Ergodic Impulse Responses',varlist); plot_ms_irf(M_,options_,irf,options_.varobs,'Ergodic Impulse Responses',varlist);
......
...@@ -52,6 +52,10 @@ opt = { ...@@ -52,6 +52,10 @@ opt = {
{'mean'} ... {'mean'} ...
}; };
if options_.ms.median
opt = [opt(:)' {{'median'}}];
end
[err, vd] = mex_ms_variance_decomposition([opt(:)', {{'free_parameters',oo_.ms.maxparams}, ... [err, vd] = mex_ms_variance_decomposition([opt(:)', {{'free_parameters',oo_.ms.maxparams}, ...
{'shocks', options_.ms.shock_draws}}]); {'shocks', options_.ms.shock_draws}}]);
mexErrCheck('mex_ms_variance_decomposition ergodic ', err); mexErrCheck('mex_ms_variance_decomposition ergodic ', err);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment