From dbd9e36db9cc337721729a0c6dc95c978b7d327e Mon Sep 17 00:00:00 2001
From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Fri, 5 Sep 2008 05:54:38 +0000
Subject: [PATCH] v4.0: merged r2036 from trunk

git-svn-id: https://www.dynare.org/svn/dynare/branches/4.0@2037 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 matlab/AIM/SPAimerr.m        | 25 ++++++++++++++++++++++++-
 matlab/AIM/SPAmalg.m         | 27 +++++++++++++++++++++++++--
 matlab/AIM/SPBuild_a.m       | 23 +++++++++++++++++++++++
 matlab/AIM/SPCopy_w.m        | 23 +++++++++++++++++++++++
 matlab/AIM/SPEigensystem.m   | 23 +++++++++++++++++++++++
 matlab/AIM/SPExact_shift.m   | 23 +++++++++++++++++++++++
 matlab/AIM/SPNumeric_shift.m | 23 +++++++++++++++++++++++
 matlab/AIM/SPObstruct.m      | 23 +++++++++++++++++++++++
 matlab/AIM/SPReduced_form.m  | 23 +++++++++++++++++++++++
 matlab/AIM/SPShiftright.m    | 23 +++++++++++++++++++++++
 10 files changed, 233 insertions(+), 3 deletions(-)

diff --git a/matlab/AIM/SPAimerr.m b/matlab/AIM/SPAimerr.m
index 2000e47266..7b086b10b7 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 e4899f6ce4..4e6b495238 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 4e7e5c77a3..06747507c4 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 9ec2b135b0..4c752adf85 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 872715d3ea..58d330bc91 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 6dce5a5c61..8d8d5a1c4f 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 e40406ec63..c826491feb 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 f808f8d7e2..11ec0f2d65 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 a8a6dfba38..81bbfff5ba 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 5841a183ee..f4ed92765c 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;
-- 
GitLab