header updated
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1569 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
59e3f79c62
commit
08423e9717
|
@ -1,4 +1,34 @@
|
||||||
function [LIK, lik] = DiffuseLikelihood3(T,R,Q,Pinf,Pstar,Y,trend,start)%//Z,T,R,Q,Pinf,Pstar,Y)
|
function [LIK, lik] = DiffuseLikelihood3(T,R,Q,Pinf,Pstar,Y,trend,start)%//Z,T,R,Q,Pinf,Pstar,Y)
|
||||||
|
|
||||||
|
% function [LIK, lik] = DiffuseLikelihood3(T,R,Q,Pinf,Pstar,Y,trend,start)
|
||||||
|
% Computes the diffuse likelihood without measurement error, in the case of
|
||||||
|
% a singular var-cov matrix.
|
||||||
|
% Univariate treatment of multivariate time series.
|
||||||
|
%
|
||||||
|
% INPUTS
|
||||||
|
% T: mm*mm matrix
|
||||||
|
% R: mm*rr matrix
|
||||||
|
% Q: rr*rr matrix
|
||||||
|
% Pinf: mm*mm diagonal matrix with with q ones and m-q zeros
|
||||||
|
% Pstar: mm*mm variance-covariance matrix with stationary variables
|
||||||
|
% Y: pp*1 vector
|
||||||
|
% trend
|
||||||
|
% start: likelihood evaluation at 'start'
|
||||||
|
%
|
||||||
|
% OUTPUTS
|
||||||
|
% LIK: likelihood
|
||||||
|
% lik: density vector in each period
|
||||||
|
%
|
||||||
|
% SPECIAL REQUIREMENTS
|
||||||
|
% See "Filtering and Smoothing of State Vector for Diffuse State Space
|
||||||
|
% Models", S.J. Koopman and J. Durbin (2003, in Journal of Time Series
|
||||||
|
% Analysis, vol. 24(1), pp. 85-98).
|
||||||
|
%
|
||||||
|
% part of DYNARE, copyright Dynare Team (2004-2008)
|
||||||
|
% Gnu Public License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% M. Ratto added lik in output [October 2005]
|
% M. Ratto added lik in output [October 2005]
|
||||||
% changes by M. Ratto [April 2005]
|
% changes by M. Ratto [April 2005]
|
||||||
% introduced new options options_.diffuse_d for termination of DKF
|
% introduced new options options_.diffuse_d for termination of DKF
|
||||||
|
@ -6,80 +36,10 @@ function [LIK, lik] = DiffuseLikelihood3(T,R,Q,Pinf,Pstar,Y,trend,start)%//Z,T,R
|
||||||
% new termination for DKF
|
% new termination for DKF
|
||||||
% likelihood terms for Fstar must be cumulated in DKF also when Pinf is non
|
% likelihood terms for Fstar must be cumulated in DKF also when Pinf is non
|
||||||
% zero.
|
% zero.
|
||||||
%
|
|
||||||
% [4/5/2005] correctyed bug in the modified verson of Ratto for rank of Pinf
|
% [4/5/2005] correctyed bug in the modified verson of Ratto for rank of Pinf
|
||||||
% introduced a specific crit1 for the DKF termination
|
% introduced a specific crit1 for the DKF termination
|
||||||
%
|
|
||||||
% stepane.adjemian@cepremap.cnrs.fr [07-19-2004]
|
|
||||||
%
|
|
||||||
% See "Filtering and Smoothing of State Vector for Diffuse State Space
|
|
||||||
% Models", S.J. Koopman and J. Durbin (2003, in Journal of Time Series
|
|
||||||
% Analysis, vol. 24(1), pp. 85-98).
|
|
||||||
%
|
|
||||||
% Case where F_{\infty,t} is singular ==> Univariate treatment of multivariate
|
|
||||||
% time series.
|
|
||||||
%
|
|
||||||
% THE PROBLEM:
|
|
||||||
%
|
|
||||||
% y_t = Z_t * \alpha_t + \varepsilon_t
|
|
||||||
% \alpha_{t+1} = T_t * \alpha_t + R_t * \eta_t
|
|
||||||
%
|
|
||||||
% with:
|
|
||||||
%
|
|
||||||
% \alpha_1 = a + A*\delta + R_0*\eta_0
|
|
||||||
%
|
|
||||||
% m*q matrix A and m*(m-q) matrix R_0 are selection matrices (their
|
|
||||||
% columns constitue all the columns of the m*m identity matrix) so that
|
|
||||||
%
|
|
||||||
% A'*R_0 = 0 and A'*\alpha_1 = \delta
|
|
||||||
%
|
|
||||||
% We assume that the vector \delta is distributed as a N(0,\kappa*I_q)
|
|
||||||
% for a given \kappa > 0. So that the expectation of \alpha_1 is a and
|
|
||||||
% its variance is P, with
|
|
||||||
%
|
|
||||||
% P = \kappa*P_{\infty} + P_{\star}
|
|
||||||
%
|
|
||||||
% P_{\infty} = A*A'
|
|
||||||
% P_{\star} = R_0*Q_0*R_0'
|
|
||||||
%
|
|
||||||
% P_{\infty} is a m*m diagonal matrix with q ones and m-q zeros.
|
|
||||||
%
|
|
||||||
%
|
|
||||||
% and where:
|
|
||||||
%
|
|
||||||
% y_t is a pp*1 vector
|
|
||||||
% \alpha_t is a mm*1 vector
|
|
||||||
% \varepsilon_t is a pp*1 multivariate random variable (iid N(0,H_t))
|
|
||||||
% \eta_t is a rr*1 multivariate random variable (iid N(0,Q_t))
|
|
||||||
% a_1 is a mm*1 vector
|
|
||||||
%
|
|
||||||
% Z_t is a pp*mm matrix
|
|
||||||
% T_t is a mm*mm matrix
|
|
||||||
% H_t is a pp*pp matrix
|
|
||||||
% R_t is a mm*rr matrix
|
|
||||||
% Q_t is a rr*rr matrix
|
|
||||||
% P_1 is a mm*mm matrix
|
|
||||||
%
|
|
||||||
%
|
|
||||||
% FILTERING EQUATIONS:
|
|
||||||
%
|
|
||||||
% v_t = y_t - Z_t* a_t
|
|
||||||
% F_t = Z_t * P_t * Z_t' + H_t
|
|
||||||
% K_t = T_t * P_t * Z_t' * F_t^{-1}
|
|
||||||
% L_t = T_t - K_t * Z_t
|
|
||||||
% a_{t+1} = T_t * a_t + K_t * v_t
|
|
||||||
% P_{t+1} = T_t * P_t * L_t' + R_t*Q_t*R_t'
|
|
||||||
%
|
|
||||||
%
|
|
||||||
% DIFFUSE FILTERING EQUATIONS:
|
|
||||||
%
|
|
||||||
% a_{t+1} = T_t*a_t + K_{\ast,t}v_t
|
|
||||||
% P_{\infty,t+1} = T_t*P_{\infty,t}*T_t'
|
|
||||||
% P_{\ast,t+1} = T_t*P_{\ast,t}*L_{\ast,t}' + R_t*Q_t*R_t'
|
|
||||||
% K_{\ast,t} = T_t*P_{\ast,t}*Z_t'*F_{\ast,t}^{-1}
|
|
||||||
% v_t = y_t - Z_t*a_t
|
|
||||||
% L_{\ast,t} = T_t - K_{\ast,t}*Z_t
|
|
||||||
% F_{\ast,t} = Z_t*P_{\ast,t}*Z_t' + H_t
|
|
||||||
global bayestopt_ options_
|
global bayestopt_ options_
|
||||||
|
|
||||||
mf = bayestopt_.mf;
|
mf = bayestopt_.mf;
|
||||||
|
|
Loading…
Reference in New Issue