Skip to content
Snippets Groups Projects
Commit e4c803d0 authored by MichelJuillard's avatar MichelJuillard
Browse files

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)
parent 61cd43b3
Branches
Tags
No related merge requests found
...@@ -69,8 +69,13 @@ end ...@@ -69,8 +69,13 @@ end
% Set options_.lik_init equal to 3 if diffuse filter is used or % Set options_.lik_init equal to 3 if diffuse filter is used or
% kalman_algo refers to a diffuse filter algorithm. % kalman_algo refers to a diffuse filter algorithm.
if (options_.diffuse_filter==1) || (options_.kalman_algo > 2) if (options_.diffuse_filter==1) || (options_.kalman_algo > 2)
if options_.lik_init == 2
error(['options diffuse_filter, lik_init and/or kalman_algo have ' ...
'contradictory settings'])
else
options_.lik_init = 3; options_.lik_init = 3;
end end
end
% If options_.lik_init == 1 % If options_.lik_init == 1
% set by default options_.qz_criterium to 1-1e-6 % set by default options_.qz_criterium to 1-1e-6
......
...@@ -58,6 +58,7 @@ t = start; % Initialization of the time index. ...@@ -58,6 +58,7 @@ t = start; % Initialization of the time index.
dlik = zeros(smpl,1); % Initialization of the vector gathering the densities. dlik = zeros(smpl,1); % Initialization of the vector gathering the densities.
dLIK = Inf; % Default value of the log likelihood. dLIK = Inf; % Default value of the log likelihood.
oldK = Inf; oldK = Inf;
s = 0;
while rank(Pinf,kalman_tol) && (t<=last) while rank(Pinf,kalman_tol) && (t<=last)
s = t-start+1; s = t-start+1;
......
...@@ -23,5 +23,4 @@ stderr y,INV_GAMMA_PDF,0.01,inf; ...@@ -23,5 +23,4 @@ stderr y,INV_GAMMA_PDF,0.01,inf;
end; end;
varobs x y; varobs x y;
unit_root_vars x y;
estimation(datafile=data1,nobs=1000,mh_replic=2000,lik_init=2,mh_jscale=1.2); estimation(datafile=data1,nobs=1000,mh_replic=2000,lik_init=2,mh_jscale=1.2);
\ No newline at end of file
...@@ -29,5 +29,4 @@ end; ...@@ -29,5 +29,4 @@ end;
varobs dx dy; varobs dx dy;
unit_root_vars x y; estimation(datafile=data2,nobs=100,mh_replic=0,diffuse_filter);
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
...@@ -29,5 +29,4 @@ end; ...@@ -29,5 +29,4 @@ end;
varobs x y; varobs x y;
unit_root_vars x y; estimation(datafile=data2,nobs=100,mh_replic=0,diffuse_filter);
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
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_;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment