Commit 86a08369 authored by MichelJuillard's avatar MichelJuillard
Browse files

osr: added optimal value of parameters to oo_.osr.optim_params; moved

osr_example to ./tests/optimal_policy
parent 2fcb379b
function osr(var_list,params,i_var,W)
function osr_res = osr(var_list,params,i_var,W)
% Copyright (C) 2001-2012 Dynare Team
%
......@@ -37,6 +37,6 @@ end
skipline()
disp('OPTIMAL SIMPLE RULE')
skipline()
osr1(i_params,i_var,W);
osr_res = osr1(i_params,i_var,W);
stoch_simul(var_list);
\ No newline at end of file
function osr1(i_params,i_var,weights)
function osr_res = osr1(i_params,i_var,weights)
% Compute the Optimal Simple Rules
% INPUTS
% i_params vector index of optimizing parameters in M_.params
......@@ -68,7 +68,10 @@ end
%%do actual optimization
[f,p]=csminwel1('osr_obj',t0,H0,[],crit,nit,options_.gradient_method,options_.gradient_epsilon,i_params,...
inv_order_var(i_var),weights(i_var,i_var));
oo_.osr.objective_function = f;
osr_res.objective_function = f;
for i=1:length(i_params)
osr_res.optim_params.(deblank(M_.param_names(i_params(i),:))) = p(i);
end
% options = optimset('fminunc');
% options = optimset('display','iter');
......
......@@ -834,7 +834,7 @@ OsrStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output);
symbol_list.writeOutput("var_list_", output);
output << "osr(var_list_,osr_params_,obj_var_,optim_weights_);\n";
output << "oo_.osr = osr(var_list_,osr_params_,obj_var_,optim_weights_);\n";
}
OptimWeightsStatement::OptimWeightsStatement(const var_weights_t &var_weights_arg,
......
......@@ -18,7 +18,7 @@ MODFILES = \
example1_abs_sign.mod \
example1_macroif.mod \
t_sgu_ex1.mod \
osr_example.mod \
optimal_policy/osr_example.mod \
optimal_policy/ramsey.mod \
optimal_policy/nk_ramsey.mod \
optimal_policy/nk_ramsey_expectation.mod \
......
Markdown is supported
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