Commit dbe05bd9 authored by sebastien's avatar sebastien
Browse files

v4 matlab: added copyright notice to C. Sims' files


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1976 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 9f5beff8
......@@ -3,8 +3,24 @@ function H = bfgsi(H0,dg,dx)
% dg is previous change in gradient; dx is previous change in x;
% 6/8/93 version that updates inverse hessian instead of hessian
% itself.
% Copyright by Christopher Sims 1996. This material may be freely
% reproduced and modified.
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if size(dg,2)>1
dg=dg';
end
......
......@@ -11,7 +11,7 @@ function bvar_density(maxnlags)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2007 Chris Sims
% Copyright (C) 2003-2007 Christopher Sims
% Copyright (C) 2007 Dynare Team
%
% This file is part of Dynare.
......
......@@ -41,7 +41,7 @@ function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags)
% - datafile, first_obs, varobs, xls_sheet, xls_range, nobs, presample
% - bvar_prior_{tau,decay,lambda,mu,omega,flat,train}
% Copyright (C) 2003-2007 Chris Sims
% Copyright (C) 2003-2007 Christopher Sims
% Copyright (C) 2007-2008 Dynare Team
%
% This file is part of Dynare.
......
......@@ -15,7 +15,24 @@ function [fhat,xhat,fcount,retcode] = csminit(fcn,x0,f0,g0,badg,H0,varargin)
%
% Fixed 7/19/93 to flip eigenvalues of H to get better performance when
% it's not psd.
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%tailstr = ')';
%for i=nargin-6:-1:1
% tailstr=[ ',P' num2str(i) tailstr];
......
......@@ -18,6 +18,24 @@ function [fh,xh,gh,H,itct,fcount,retcodeh] = csminwel(fcn,x0,H0,grad,crit,nit,me
% hessian update, respectively. (When the routine hits certain kinds of difficulty, it
% write g2.mat and g3.mat as well. If all were written at about the same time, any of them
% may be a decent starting point. One can also start from the one with best function value.)
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global bayestopt_
fh = [];
xh = [];
......
......@@ -17,6 +17,24 @@ function [x,rc] = csolve(FUN,x,gradfun,crit,itmax,varargin)
% rc: 0 means normal solution, 1 and 3 mean no solution despite extremely fine adjustments
% in step length (very likely a numerical problem, or a discontinuity). 4 means itmax
% termination.
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%---------- delta --------------------
% differencing interval for numerical gradient
delta = 1e-6;
......
function [g, badg] = numgrad(fcn,x,varargin)
% function [g badg] = numgrad(fcn,xvarargin)
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
delta = 1e-6;
%delta=1e-2;
n=length(x);
......
......@@ -7,6 +7,7 @@ function [g, badg, f0, f1, f2] = numgrad3(fcn,x,varargin)
% See section 25.3.4 in Abramovitz and Stegun (1972, Tenth Printing, December) Handbook of Mathematical Functions.
% http://www.math.sfu.ca/~cbm/aands/
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%
% This file is part of Dynare.
......
......@@ -8,8 +8,8 @@ function [g, badg, f0, f1, f2, f3, f4] = numgrad5(fcn,x,varargin)
% http://www.math.sfu.ca/~cbm/aands/
%
% TODO Try Four points formula when cost_flag3=0 or cost_flag4=0.
%
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%
% This file is part of Dynare.
......
% from Chris Sims web site
% http://eco-072399b.princeton.edu/yftp/gensys/mfiles/QZDIV.M
%
function [A,B,Q,Z] = qzdiv(stake,A,B,Q,Z)
%function [A,B,Q,Z] = qzdiv(stake,A,B,Q,Z)
%
......@@ -9,7 +5,24 @@ function [A,B,Q,Z] = qzdiv(stake,A,B,Q,Z)
% so that all cases of abs(B(i,i)/A(i,i))>stake are in lower right
% corner, while preserving U.T. and orthonormal properties and Q'AZ' and
% Q'BZ'.
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
[n jnk] = size(A);
root = abs([diag(A) diag(B)]);
root(:,1) = root(:,1)-(root(:,1)<1.e-13).*(root(:,1)+root(:,2));
......
% from Chris Sims web site
% http://eco-072399b.princeton.edu/yftp/gensys/mfiles/QZSWITCH.M
%
function [A,B,Q,Z] = qzswitch(i,A,B,Q,Z)
%function [A,B,Q,Z] = qzswitch(i,A,B,Q,Z)
%
......@@ -13,7 +9,25 @@ function [A,B,Q,Z] = qzswitch(i,A,B,Q,Z)
% to drive all zeros on the diagonal of A to the lower right, but in this case
% the qz transformation is not unique and it is not possible simply to switch
% the positions of the diagonal elements of both A and B.
realsmall=sqrt(eps)*10;
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
realsmall=sqrt(eps)*10;
%realsmall=1e-3;
a = A(i,i); d = B(i,i); b = A(i,i+1); e = B(i,i+1);
c = A(i+1,i+1); f = B(i+1,i+1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment