From 2053243f7874cdac855d2c6fac66d32803a2250a Mon Sep 17 00:00:00 2001 From: george Date: Fri, 24 Apr 2009 01:20:21 +0000 Subject: [PATCH] Update of, not yet complete algorithm for unpacking g_2 into ghxx/xu/uu; added logic for 2nd order derivative symmetry and some other improvements but still not finished yet git-svn-id: https://www.dynare.org/svn/dynare/trunk@2623 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/kordpert/dr1_k_order.m | 44 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/matlab/kordpert/dr1_k_order.m b/matlab/kordpert/dr1_k_order.m index 70233d21a..1adf9c426 100644 --- a/matlab/kordpert/dr1_k_order.m +++ b/matlab/kordpert/dr1_k_order.m @@ -138,24 +138,40 @@ function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_) else % 2nd order [ysteady, ghx_u, g_2]=k_order_perturbation(dr,task,M_,options_, oo_ , ['.' mexext]); - %Here is pseud code for recovering ghxx ghxu ghxx ghs2 + %Here is code for recovering ghxx ghxu ghxx ghs2 s0 = 0; s1 = 0;%0 g_2cols=size(g_2,2); g_2rows=size(g_2,1); nExog=M_.exo_nbr; nspred=dr.nspred; - %ghxx=zeros(g_2rows); - for i=1:g_2cols + ghxx=zeros(g_2rows, nspred^2); + ghxu=zeros(g_2rows, nspred*nExog); + ghuu=zeros(g_2rows, nExog^2); + ghs2=zeros(g_2rows, 1); +% for i=1:g_2cols + i=0; + while i