From 4e789452b22a0871f48aac82e3efdfa24125cc76 Mon Sep 17 00:00:00 2001 From: ferhat Date: Tue, 14 Jan 2014 17:32:01 +0100 Subject: [PATCH] Allows to use alternative algorithms to solve lyapunov equation --- matlab/DsgeSmoother.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/matlab/DsgeSmoother.m b/matlab/DsgeSmoother.m index 4b58ca34e..51dab6569 100644 --- a/matlab/DsgeSmoother.m +++ b/matlab/DsgeSmoother.m @@ -116,7 +116,15 @@ if options_.lik_init == 1 % Kalman filter if kalman_algo ~= 2 kalman_algo = 1; end - Pstar = lyapunov_symm(T,R*Q*transpose(R),options_.qz_criterium,options_.lyapunov_complex_threshold); + if options_.lyapunov_fp == 1 + Pstar = lyapunov_symm(T,Q,options_.lyapunov_fixed_point_tol,options_.lyapunov_complex_threshold, 3, R); + elseif options_.lyapunov_db == 1 + Pstar = disclyap_fast(T,R*Q*R',options_.lyapunov_doubling_tol); + elseif options_.lyapunov_srs == 1 + Pstar = lyapunov_symm(T,Q,options_.lyapunov_fixed_point_tol,options_.lyapunov_complex_threshold, 4, R); + else + Pstar = lyapunov_symm(T,R*Q*R',options_.qz_criterium,options_.lyapunov_complex_threshold); + end; Pinf = []; elseif options_.lik_init == 2 % Old Diffuse Kalman filter if kalman_algo ~= 2