Added new test file for (S)EP. For an autoregressive process SEP and EP should give the same results...

time-shift
Stéphane Adjemian (Charybdis) 2011-12-19 18:13:34 +01:00
parent 744f3fd41b
commit 74e95eae61
2 changed files with 60 additions and 0 deletions

51
tests/ep/ar.mod Normal file
View File

@ -0,0 +1,51 @@
var Efficiency, efficiency;
varexo EfficiencyInnovation;
parameters rho, effstar, sigma2;
/*
** Calibration
*/
rho = 0.950;
effstar = 1.000;
sigma2 = 0.0001;
external_function(name=mean_preserving_spread);
model(block,bytecode);
// Eq. n°1:
efficiency = rho*efficiency(-1) + EfficiencyInnovation;
// Eq. n°2:
Efficiency = effstar*exp(efficiency-mean_preserving_spread(rho));
end;
shocks;
var EfficiencyInnovation = sigma2;
end;
steady;
options_.ep.verbosity = 0;
options_.ep.stochastic = 0;
options_.console_mode = 0;
ts = extended_path([],1000);
options_.ep.verbosity = 0;
options_.ep.stochastic = 1;
options_.console_mode = 0;
sts = extended_path([],1000);
if max(max(abs(ts-sts)))>1e-12
disp('Stochastic Extended Path:: Something is wrong here (potential bug in extended_path.m)!!!')
end

View File

@ -0,0 +1,9 @@
function [ys, info] = ar_steadystate(ys, exogenous)
% Steady state routine for ar.mod (First order autoregressive process)
global M_
info = 0;
ys(1)=M_.params(2);
ys(2)=0;