v4 matlab:

* fixed various copyright headers
* added URL pointer to C. Sims' original files
* removed obsolete dgamma.m


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2018 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2008-09-02 15:18:05 +00:00
parent b4c04a27cc
commit 0c23ac2b06
20 changed files with 102 additions and 30 deletions

View File

@ -4,6 +4,9 @@ function H = bfgsi(H0,dg,dx)
% 6/8/93 version that updates inverse hessian instead of hessian
% itself.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/bfgsi.m
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.

View File

@ -61,6 +61,9 @@ function w = matrictint(S, df, XXi)
%
% (where k is the dimension of XXi and ny is the dimension of S and
% Sigma)
% Original file downloaded from:
% http://sims.princeton.edu/yftp/VARtools/matlab/matrictint.m
k=size(XXi,1);
ny=size(S,1);

View File

@ -181,7 +181,9 @@ function [ydum,xdum,breaks]=varprior(nv,nx,lags,mnprior,vprior)
% prior mean generates larger prior variances for own than for cross-effects even in
% this formulation, but here there is no way to shrink toward a set of unconstrained
% univariate AR's.
% Author: C. Sims
% Original file downloaded from:
% http://sims.princeton.edu/yftp/VARtools/matlab/varprior.m
if ~isempty(mnprior)
xdum = zeros(lags+1,nx,lags,nv);
@ -247,7 +249,10 @@ function var=rfvar3(ydata,lags,xdata,breaks,lambda,mu)
% repeating the initial xdata(lags+1,:) row or copying xdata(lags+1:2*lags,:) into
% xdata(1:lags,:) are reasonable subsititutes. These values are used in forming the
% persistence priors.
% Code written by Christopher Sims. This version 6/15/03.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/VARtools/matlab/rfvar3.m
[T,nvar] = size(ydata);
nox = isempty(xdata);
if ~nox

View File

@ -1,6 +1,4 @@
function result = check
% function result = check
% checks determinacy conditions by computing the eigenvalues
%
@ -13,7 +11,7 @@ function result = check
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2001-2007 Dynare Team
% Copyright (C) 2001-2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -16,7 +16,11 @@ 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.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/csminit.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -19,7 +19,11 @@ function [fh,xh,gh,H,itct,fcount,retcodeh] = csminwel(fcn,x0,H0,grad,crit,nit,me
% 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.)
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/csminwel.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2006-2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -18,7 +18,11 @@ function [x,rc] = csolve(FUN,x,gradfun,crit,itmax,varargin)
% in step length (very likely a numerical problem, or a discontinuity). 4 means itmax
% termination.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/csolve.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2007 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -1,15 +0,0 @@
function f = dgamma(x,a,b)
%DGAMMA The gamma density function
%
% f = dgamma(x,a)
% Anders Holtsberg, 18-11-93
% Copyright (c) Anders Holtsberg
if any(any(a<=0))
error('Parameter a is wrong')
end
f = (x./b) .^ (a-1) .* exp(-x./b) ./ (b.*gamma(a));
I0 = find(x<0);
f(I0) = zeros(size(I0));

View File

@ -1,4 +1,23 @@
function [dr,info,M_,options_,oo_] = dr11_sparse(dr,task,M_,options_,oo_, jacobia_, hessian)
%function [dr,info,M_,options_,oo_] = dr11_sparse(dr,task,M_,options_,oo_, jacobia_, hessian)
% Copyright (C) 2008 Dynare Team
%
% 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/>.
info = 0;
klen = M_.maximum_endo_lag + M_.maximum_endo_lead + 1;
kstate = dr.kstate;

View File

@ -17,9 +17,24 @@ function independent_metropolis_hastings(TargetFun,ProposalFun,xparam1,vv,mh_bou
%
% SPECIAL REQUIREMENTS
% None.
%
% part of DYNARE, copyright Dynare Team (2006-2008)
% Gnu Public License.
% Copyright (C) 2006-2008 Dynare Team
%
% 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 M_ options_ bayestopt_
%%%%
%%%% Initialization of the independent metropolis-hastings chains.

View File

@ -1,4 +1,23 @@
function model_info;
%function model_info;
% Copyright (C) 2008 Dynare Team
%
% 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 M_;
fprintf(' Informations about %s\n',M_.fname);
fprintf(strcat(' ===================',char(ones(1,length(M_.fname))*'='),'\n\n'));

View File

@ -1,7 +1,11 @@
function [g, badg] = numgrad(fcn,x,varargin)
% function [g badg] = numgrad(fcn,xvarargin)
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/numgrad.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -7,6 +7,9 @@ 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/
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/numgrad.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%

View File

@ -9,6 +9,9 @@ function [g, badg, f0, f1, f2, f3, f4] = numgrad5(fcn,x,varargin)
%
% TODO Try Four points formula when cost_flag3=0 or cost_flag4=0.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/optimize/mfiles/numgrad.m
% Copyright (C) 1993-2007 Christopher Sims
% Copyright (C) 2008 Dynare Team
%

View File

@ -6,6 +6,9 @@ function [A,B,Q,Z] = qzdiv(stake,A,B,Q,Z)
% corner, while preserving U.T. and orthonormal properties and Q'AZ' and
% Q'BZ'.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/gensys/mfiles/qzdiv.m
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.

View File

@ -10,6 +10,9 @@ function [A,B,Q,Z] = qzswitch(i,A,B,Q,Z)
% 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.
% Original file downloaded from:
% http://sims.princeton.edu/yftp/gensys/mfiles/qzswitch.m
% Copyright (C) 1993-2007 Christopher Sims
%
% This file is part of Dynare.

View File

@ -1,5 +1,4 @@
function [dr,info]=resol(ys,check_flag)
% function [dr,info]=resol(ys,check_flag)
% Computes first and second order approximations
%
@ -22,7 +21,7 @@ function [dr,info]=resol(ys,check_flag)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2001-2007 Dynare Team
% Copyright (C) 2001-2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -14,9 +14,8 @@ function sim1
%
% SPECIAL REQUIREMENTS
% None.
%
% Copyright (C) 1996-2007 Dynare Team
% Copyright (C) 1996-2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -11,7 +11,7 @@ function steady()
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2001-2007 Dynare Team
% Copyright (C) 2001-2008 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -1,5 +1,4 @@
function [A,B] = transition_matrix(dr, varargin)
% function [A,B] = transition_matrix(dr, varargin)
% Makes transition matrices out of ghx and ghu
%
@ -14,7 +13,7 @@ function [A,B] = transition_matrix(dr, varargin)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2007 Dynare Team
% Copyright (C) 2003-2008 Dynare Team
%
% This file is part of Dynare.
%