fixed issues with estimation of non-stationary models. Option lik_init=2
is contradictory with diffuse_filter or unit_root_variables declaration. Models with non-stationary variables, but only stationary observed variables need diffuse_filter option and make a useless call to kalman_filter_d (this seems better than trying to distinguish these rare cases)time-shift
parent
61cd43b3be
commit
e4c803d0db
|
@ -69,7 +69,12 @@ end
|
|||
% Set options_.lik_init equal to 3 if diffuse filter is used or
|
||||
% kalman_algo refers to a diffuse filter algorithm.
|
||||
if (options_.diffuse_filter==1) || (options_.kalman_algo > 2)
|
||||
options_.lik_init = 3;
|
||||
if options_.lik_init == 2
|
||||
error(['options diffuse_filter, lik_init and/or kalman_algo have ' ...
|
||||
'contradictory settings'])
|
||||
else
|
||||
options_.lik_init = 3;
|
||||
end
|
||||
end
|
||||
|
||||
% If options_.lik_init == 1
|
||||
|
|
|
@ -58,6 +58,7 @@ t = start; % Initialization of the time index.
|
|||
dlik = zeros(smpl,1); % Initialization of the vector gathering the densities.
|
||||
dLIK = Inf; % Default value of the log likelihood.
|
||||
oldK = Inf;
|
||||
s = 0;
|
||||
|
||||
while rank(Pinf,kalman_tol) && (t<=last)
|
||||
s = t-start+1;
|
||||
|
|
|
@ -23,5 +23,4 @@ stderr y,INV_GAMMA_PDF,0.01,inf;
|
|||
end;
|
||||
|
||||
varobs x y;
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=2000,lik_init=2,mh_jscale=1.2);
|
|
@ -29,5 +29,4 @@ end;
|
|||
|
||||
varobs dx dy;
|
||||
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,diffuse_filter);
|
||||
|
|
|
@ -29,5 +29,4 @@ end;
|
|||
|
||||
varobs x y;
|
||||
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,diffuse_filter);
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
var dx dy;
|
||||
varexo e_x e_y;
|
||||
|
||||
parameters rho_x rho_y;
|
||||
|
||||
rho_x = 0.5;
|
||||
rho_y = -0.3;
|
||||
|
||||
model;
|
||||
dx = rho_x*dx(-1)+e_x;
|
||||
dy = rho_y*dy(-1)+e_y;
|
||||
end;
|
||||
|
||||
estimated_params;
|
||||
rho_x,NORMAL_PDF,0.5,0.1;
|
||||
rho_y,NORMAL_PDF,-0.3,0.1;
|
||||
stderr e_x,INV_GAMMA_PDF,0.01,inf;
|
||||
stderr e_y,INV_GAMMA_PDF,0.01,inf;
|
||||
end;
|
||||
|
||||
varobs dx dy;
|
||||
check;
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=0,load_mh_file);
|
||||
stab_map_;
|
Loading…
Reference in New Issue