Revert "- added a test an a penalty in estimation (DsgeLikelihood.m) if, in a stationary model (lik_init==1), a particular parameter set generates unit roots."
There is a better way of dealing with occasional non-stationary models in estimation
This reverts commit 8c0fb55206
.
time-shift
parent
8c0fb55206
commit
6bb8d41909
|
@ -170,15 +170,7 @@ if options_.lik_init == 1 % Kalman filter
|
||||||
if kalman_algo ~= 2
|
if kalman_algo ~= 2
|
||||||
kalman_algo = 1;
|
kalman_algo = 1;
|
||||||
end
|
end
|
||||||
[Pstar,junk,unit_roots] = lyapunov_symm(T,R*Q*R',options_.qz_criterium,...
|
Pstar = lyapunov_symm(T,R*Q*R',options_.qz_criterium,options_.lyapunov_complex_threshold);
|
||||||
options_.lyapunov_complex_threshold);
|
|
||||||
if ~isempty(unit_roots)
|
|
||||||
% if unit roots the penalty equals the sum of distance to 2-qz_criterium
|
|
||||||
fval = bayestopt_.penalty + sum(unit_roots-2+ ...
|
|
||||||
options_.qz_criterium);
|
|
||||||
cost_flag = 0;
|
|
||||||
return
|
|
||||||
end
|
|
||||||
Pinf = [];
|
Pinf = [];
|
||||||
elseif options_.lik_init == 2 % Old Diffuse Kalman filter
|
elseif options_.lik_init == 2 % Old Diffuse Kalman filter
|
||||||
if kalman_algo ~= 2
|
if kalman_algo ~= 2
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function [x,u,unit_roots] = lyapunov_symm(a,b,qz_criterium,lyapunov_complex_threshold,method)
|
function [x,u] = lyapunov_symm(a,b,qz_criterium,lyapunov_complex_threshold,method)
|
||||||
% Solves the Lyapunov equation x-a*x*a' = b, for b and x symmetric matrices.
|
% Solves the Lyapunov equation x-a*x*a' = b, for b and x symmetric matrices.
|
||||||
% If a has some unit roots, the function computes only the solution of the stable subsystem.
|
% If a has some unit roots, the function computes only the solution of the stable subsystem.
|
||||||
%
|
%
|
||||||
|
@ -15,7 +15,6 @@ function [x,u,unit_roots] = lyapunov_symm(a,b,qz_criterium,lyapunov_complex_thre
|
||||||
% OUTPUTS
|
% OUTPUTS
|
||||||
% x: [double] m*m solution matrix of the lyapunov equation, where m is the dimension of the stable subsystem.
|
% x: [double] m*m solution matrix of the lyapunov equation, where m is the dimension of the stable subsystem.
|
||||||
% u: [double] Schur vectors associated with unit roots
|
% u: [double] Schur vectors associated with unit roots
|
||||||
% unit_roots [double] vector containing roots too close to 1
|
|
||||||
%
|
%
|
||||||
% ALGORITHM
|
% ALGORITHM
|
||||||
% Uses reordered Schur decomposition
|
% Uses reordered Schur decomposition
|
||||||
|
@ -58,13 +57,10 @@ if size(a,1) == 1
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
unit_roots = [];
|
|
||||||
if method<2
|
if method<2
|
||||||
[U,T] = schur(a);
|
[U,T] = schur(a);
|
||||||
roots = abs(ordeig(T));
|
e1 = abs(ordeig(T)) > 2-qz_criterium;
|
||||||
e1 = roots > 2-qz_criterium;
|
k = sum(e1); % Number of unit roots.
|
||||||
k = sum(e1); % Number of unit roots.
|
|
||||||
unit_roots = roots(1:k);
|
|
||||||
n = length(e1)-k; % Number of stationary variables.
|
n = length(e1)-k; % Number of stationary variables.
|
||||||
if k > 0
|
if k > 0
|
||||||
% Selects stable roots
|
% Selects stable roots
|
||||||
|
|
Loading…
Reference in New Issue