diff --git a/matlab/AIM/SPAimerr.m b/matlab/AIM/SPAimerr.m index 2000e47266fff0af2104df1d466596f13b0a0996..7b086b10b738ccf57931dc0ef0e71fbb4001383a 100644 --- a/matlab/AIM/SPAimerr.m +++ b/matlab/AIM/SPAimerr.m @@ -2,9 +2,32 @@ function e = SPAimerr(c); % e = aimerr(c); % % Interpret the return codes generated by the aim routines. - +% % The return code c = 2 is used by aim_schur.m but not by aim_eig.m. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + if(c==1) e='Aim: unique solution.'; elseif(c==2) e='Aim: roots not correctly computed by real_schur.'; elseif(c==3) e='Aim: too many big roots.'; diff --git a/matlab/AIM/SPAmalg.m b/matlab/AIM/SPAmalg.m index e4899f6ce492857f4f376db0464bf363d02d94fb..4e6b4952389f172a6f4b7b44b642458f26c2f89d 100644 --- a/matlab/AIM/SPAmalg.m +++ b/matlab/AIM/SPAmalg.m @@ -28,8 +28,31 @@ % nnumeric Number of numeric shiftrights. % lgroots Number of roots greater in modulus than uprbnd. % aimcode Return code: see function aimerr. -% Modified to deal with infinite or nan A Dec 12 2007 -% ========================================================= + +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team, in order to deal +% with infinite or nan values. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [b,rts,ia,nexact,nnumeric,lgroots,aimcode] = ... SPAmalg(h,neq,nlag,nlead,condn,uprbnd) b=[];rts=[];ia=[];nexact=[];nnumeric=[];lgroots=[];aimcode=[]; diff --git a/matlab/AIM/SPBuild_a.m b/matlab/AIM/SPBuild_a.m index 4e7e5c77a3bed116d732c768418c8ccf1bd66b64..06747507c4d8149b0bb0fe395c6d6344a996f0d3 100644 --- a/matlab/AIM/SPBuild_a.m +++ b/matlab/AIM/SPBuild_a.m @@ -3,6 +3,29 @@ % Build the companion matrix, deleting inessential lags. % Solve for x_{t+nlead} in terms of x_{t+nlag},...,x_{t+nlead-1}. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [a,ia,js] = SPBuild_a(h,qcols,neq) left = 1:qcols; diff --git a/matlab/AIM/SPCopy_w.m b/matlab/AIM/SPCopy_w.m index 9ec2b135b0a5a5d90bfba501f21d1dba105d8108..4c752adf85a80dcc45bc34feb69be81f51803234 100644 --- a/matlab/AIM/SPCopy_w.m +++ b/matlab/AIM/SPCopy_w.m @@ -3,6 +3,29 @@ % Copy the eigenvectors corresponding to the largest roots into the % remaining empty rows and columns js of q +% Author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function q = SPCopy_w(q,w,js,iq,qrows) if(iq < qrows) diff --git a/matlab/AIM/SPEigensystem.m b/matlab/AIM/SPEigensystem.m index 872715d3eab99c482214d0fa94598ae176a5c5f0..58d330bc9196b6d7486e7aa918db843af22d0b6f 100644 --- a/matlab/AIM/SPEigensystem.m +++ b/matlab/AIM/SPEigensystem.m @@ -5,6 +5,29 @@ % eigenvectors conformably. Map the eigenvectors into the real % domain. Count the roots bigger than uprbnd. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [w,rts,lgroots,flag_trouble] = SPEigensystem(a,uprbnd,rowsLeft) opts.disp=0; try diff --git a/matlab/AIM/SPExact_shift.m b/matlab/AIM/SPExact_shift.m index 6dce5a5c61110160aaf6cb3792e91d88f72c10c9..8d8d5a1c4fb86651cf2dac365999779537b2ec42 100644 --- a/matlab/AIM/SPExact_shift.m +++ b/matlab/AIM/SPExact_shift.m @@ -2,6 +2,29 @@ % % Compute the exact shiftrights and store them in q. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [h,q,iq,nexact] = SPExact_shift(h,q,iq,qrows,qcols,neq) %hs=SPSparse(h); diff --git a/matlab/AIM/SPNumeric_shift.m b/matlab/AIM/SPNumeric_shift.m index e40406ec63d15797e7faa9749661be9e6a266fef..c826491febe373397a39297c314fcc4e9c6cdd08 100644 --- a/matlab/AIM/SPNumeric_shift.m +++ b/matlab/AIM/SPNumeric_shift.m @@ -3,6 +3,29 @@ % % Compute the numeric shiftrights and store them in q. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [h,q,iq,nnumeric] = SPNumeric_shift(h,q,iq,qrows,qcols,neq,condn) nnumeric = 0; diff --git a/matlab/AIM/SPObstruct.m b/matlab/AIM/SPObstruct.m index f808f8d7e2a72686a9449a27af95d55dafe52943..11ec0f2d658f814382916f8c819cc271edd24a87 100644 --- a/matlab/AIM/SPObstruct.m +++ b/matlab/AIM/SPObstruct.m @@ -14,6 +14,29 @@ % % scof observable structure coefficients +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function scof = SPObstruct(cof,cofb,neq,nlag,nlead) diff --git a/matlab/AIM/SPReduced_form.m b/matlab/AIM/SPReduced_form.m index a8a6dfba38f061f5367eae838f47527257d76437..81bbfff5baa059323ead84cc21f000a992ea4617 100644 --- a/matlab/AIM/SPReduced_form.m +++ b/matlab/AIM/SPReduced_form.m @@ -2,6 +2,29 @@ % % Compute reduced-form coefficient matrix, b. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + function [nonsing,b] = SPReduced_form(q,qrows,qcols,bcols,neq,condn); b=[]; %qs=SPSparse(q); diff --git a/matlab/AIM/SPShiftright.m b/matlab/AIM/SPShiftright.m index 5841a183ee6960b6001cb50b69f534e288fb005d..f4ed92765c824223c07d19a3ddbae619becbe70c 100644 --- a/matlab/AIM/SPShiftright.m +++ b/matlab/AIM/SPShiftright.m @@ -5,6 +5,29 @@ function [y] = SPShiftright(x,n) % Shift the rows of x to the right by n columns, leaving zeros in the % first n columns. +% Original author: Gary Anderson +% Original file downloaded from: +% http://www.federalreserve.gov/Pubs/oss/oss4/code.html +% Adapted for Dynare by Dynare Team. +% +% This code is in the public domain and may be used freely. +% However the authors would appreciate acknowledgement of the source by +% citation of any of the following papers: +% +% Anderson, G. and Moore, G. +% "A Linear Algebraic Procedure for Solving Linear Perfect Foresight +% Models." +% Economics Letters, 17, 1985. +% +% Anderson, G. +% "Solving Linear Rational Expectations Models: A Horse Race" +% Computational Economics, 2008, vol. 31, issue 2, pages 95-113 +% +% Anderson, G. +% "A Reliable and Computationally Efficient Algorithm for Imposing the +% Saddle Point Property in Dynamic Models" +% Journal of Economic Dynamics and Control, Forthcoming + [rows,cols] = size(x); left = 1:cols-n;