


q = SPCopy_w(q,w,js,iq,qrows) Copy the eigenvectors corresponding to the largest roots into the remaining empty rows and columns js of q


0001 % q = SPCopy_w(q,w,js,iq,qrows) 0002 % 0003 % Copy the eigenvectors corresponding to the largest roots into the 0004 % remaining empty rows and columns js of q 0005 0006 % Author: Gary Anderson 0007 % Original file downloaded from: 0008 % http://www.federalreserve.gov/Pubs/oss/oss4/code.html 0009 % Adapted for Dynare by Dynare Team. 0010 % 0011 % This code is in the public domain and may be used freely. 0012 % However the authors would appreciate acknowledgement of the source by 0013 % citation of any of the following papers: 0014 % 0015 % Anderson, G. and Moore, G. 0016 % "A Linear Algebraic Procedure for Solving Linear Perfect Foresight 0017 % Models." 0018 % Economics Letters, 17, 1985. 0019 % 0020 % Anderson, G. 0021 % "Solving Linear Rational Expectations Models: A Horse Race" 0022 % Computational Economics, 2008, vol. 31, issue 2, pages 95-113 0023 % 0024 % Anderson, G. 0025 % "A Reliable and Computationally Efficient Algorithm for Imposing the 0026 % Saddle Point Property in Dynamic Models" 0027 % Journal of Economic Dynamics and Control, 2010, vol. 34, issue 3, 0028 % pages 472-489 0029 0030 function q = SPCopy_w(q,w,js,iq,qrows) 0031 0032 if(iq < qrows) 0033 lastrows = iq+1:qrows; 0034 wrows = 1:length(lastrows); 0035 q(lastrows,js) = w(:,wrows)'; 0036 end