diff --git a/matlab/bfgsi.m b/matlab/bfgsi.m
index 1f6546477..0f3c1b426 100644
--- a/matlab/bfgsi.m
+++ b/matlab/bfgsi.m
@@ -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.
diff --git a/matlab/bvar_density.m b/matlab/bvar_density.m
index a3699c225..e74bb57bb 100644
--- a/matlab/bvar_density.m
+++ b/matlab/bvar_density.m
@@ -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);
diff --git a/matlab/bvar_toolbox.m b/matlab/bvar_toolbox.m
index cd4c11527..6a0a4ddd4 100644
--- a/matlab/bvar_toolbox.m
+++ b/matlab/bvar_toolbox.m
@@ -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
diff --git a/matlab/check.m b/matlab/check.m
index e1abd5351..2d1a5be1f 100644
--- a/matlab/check.m
+++ b/matlab/check.m
@@ -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.
%
diff --git a/matlab/csminit.m b/matlab/csminit.m
index d603a62ca..f018e9fcf 100644
--- a/matlab/csminit.m
+++ b/matlab/csminit.m
@@ -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.
%
diff --git a/matlab/csminwel.m b/matlab/csminwel.m
index 516c5e7dc..809d7314e 100644
--- a/matlab/csminwel.m
+++ b/matlab/csminwel.m
@@ -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.
%
diff --git a/matlab/csolve.m b/matlab/csolve.m
index 6a7dbf334..40be2d8db 100644
--- a/matlab/csolve.m
+++ b/matlab/csolve.m
@@ -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.
%
diff --git a/matlab/dgamma.m b/matlab/dgamma.m
deleted file mode 100644
index c94be4e8d..000000000
--- a/matlab/dgamma.m
+++ /dev/null
@@ -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));
diff --git a/matlab/dr11_sparse.m b/matlab/dr11_sparse.m
index 424b88fb4..7fddf48e7 100644
--- a/matlab/dr11_sparse.m
+++ b/matlab/dr11_sparse.m
@@ -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 .
+
info = 0;
klen = M_.maximum_endo_lag + M_.maximum_endo_lead + 1;
kstate = dr.kstate;
diff --git a/matlab/independent_metropolis_hastings.m b/matlab/independent_metropolis_hastings.m
index ff32f17fc..7f74a813a 100644
--- a/matlab/independent_metropolis_hastings.m
+++ b/matlab/independent_metropolis_hastings.m
@@ -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 .
+
global M_ options_ bayestopt_
%%%%
%%%% Initialization of the independent metropolis-hastings chains.
diff --git a/matlab/model_info.m b/matlab/model_info.m
index 897e5b31b..f1f92c55b 100644
--- a/matlab/model_info.m
+++ b/matlab/model_info.m
@@ -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 .
+
global M_;
fprintf(' Informations about %s\n',M_.fname);
fprintf(strcat(' ===================',char(ones(1,length(M_.fname))*'='),'\n\n'));
diff --git a/matlab/numgrad.m b/matlab/numgrad.m
index 317577e3d..b3c4f494a 100644
--- a/matlab/numgrad.m
+++ b/matlab/numgrad.m
@@ -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.
%
diff --git a/matlab/numgrad3.m b/matlab/numgrad3.m
index f79ab7f07..19f0ce941 100644
--- a/matlab/numgrad3.m
+++ b/matlab/numgrad3.m
@@ -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
%
diff --git a/matlab/numgrad5.m b/matlab/numgrad5.m
index c93e0a0fd..0afe3f5bf 100644
--- a/matlab/numgrad5.m
+++ b/matlab/numgrad5.m
@@ -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
%
diff --git a/matlab/qz/qzdiv.m b/matlab/qz/qzdiv.m
index 5f1a0fd95..eebe52a46 100644
--- a/matlab/qz/qzdiv.m
+++ b/matlab/qz/qzdiv.m
@@ -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.
diff --git a/matlab/qz/qzswitch.m b/matlab/qz/qzswitch.m
index 72bf41574..f16d604cf 100644
--- a/matlab/qz/qzswitch.m
+++ b/matlab/qz/qzswitch.m
@@ -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.
diff --git a/matlab/resol.m b/matlab/resol.m
index 937d6e0d2..135baf8fd 100644
--- a/matlab/resol.m
+++ b/matlab/resol.m
@@ -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.
%
diff --git a/matlab/sim1.m b/matlab/sim1.m
index 6462e42b6..24fe7dcae 100644
--- a/matlab/sim1.m
+++ b/matlab/sim1.m
@@ -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.
%
diff --git a/matlab/steady.m b/matlab/steady.m
index 4272e0fc5..ed475145b 100644
--- a/matlab/steady.m
+++ b/matlab/steady.m
@@ -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.
%
diff --git a/matlab/transition_matrix.m b/matlab/transition_matrix.m
index 3894ae9e8..b3f8b7e97 100644
--- a/matlab/transition_matrix.m
+++ b/matlab/transition_matrix.m
@@ -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.
%