Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
bb0e3d80
Commit
bb0e3d80
authored
Oct 04, 2011
by
Houtan Bastani
Browse files
MSSBVAR: add copyrights/licensing
parent
cc15e8f7
Changes
27
Hide whitespace changes
Inline
Sidebyside
matlab/mssbvar/cstz/bfgsi.m
View file @
bb0e3d80
...
...
@@ 7,6 +7,23 @@ function H = bfgsi(H0,dg,dx)
% reproduced and modified.
dispIndx
=
0
;
% 1: turn on all the diplays on the screen; 0: turn off (Added by T. Zha)
% Copyright (C) 19962011 Tao Zha and 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
...
...
matlab/mssbvar/cstz/csminit.m
View file @
bb0e3d80
...
...
@@ 23,6 +23,23 @@ function [fhat,xhat,fcount,retcode] = csminit(fcn,x0,f0,g0,badg,H0,varargin)
% tailstr=[ ',P' num2str(i) tailstr];
%end
% Copyright (C) 19932011 Tao Zha and 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/>.
dispIndx
=
0
;
% 1: turn on all the diplays on the screen; 0: turn off (Added by T. Zha)
...
...
matlab/mssbvar/cstz/csminwel.m
View file @
bb0e3d80
...
...
@@ 20,6 +20,23 @@ function [fh,xh,gh,H,itct,fcount,retcodeh] = csminwel(fcn,x0,H0,grad,crit,nit,va
% function. This option is used for the loop operation. T. Zha, 2 May 2000
% NOTE: You may want to change stps to 1.0e02 or 1.0e03 to get a better convergence. August, 2006
% Copyright (C) 19932011 Tao Zha and 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/>.
Verbose
=
0
;
% 1: turn on all the diplays on the screen; 0: turn off (Added by T. Zha)
dispIndx
=
0
;
% 1: turn on all the diplays on the screen; 0: turn off (Added by T. Zha)
...
...
matlab/mssbvar/cstz/fn_a0freefun.m
View file @
bb0e3d80
...
...
@@ 21,6 +21,23 @@ function of = fn_a0freefun(b,Ui,nvar,n0,fss,H0inv)
%
% Tao Zha, February 2000
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
b
=
b
(:);
n0
=
n0
(:);
A0
=
zeros
(
nvar
);
...
...
matlab/mssbvar/cstz/fn_a0freegrad.m
View file @
bb0e3d80
...
...
@@ 20,6 +20,23 @@ function [g,badg] = fn_a0freegrad(b,Ui,nvar,n0,fss,H0inv)
%
% Tao Zha, February 2000. Revised, August 2000
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
b
=
b
(:);
n0
=
n0
(:);
A0
=
zeros
(
nvar
);
...
...
matlab/mssbvar/cstz/fn_calyrqm.m
View file @
bb0e3d80
...
...
@@ 13,6 +13,23 @@ function [Myrqm,nMyrqm] = fn_calyrqm(q_m,Byrqm,Eyrqm)
%
% Tao Zha, April 2000
% Copyright (C) 20002011 Tao Zha
%
% 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
~
isempty
(
find
(
Byrqm

round
(
Byrqm
)))

(
q_m

round
(
q_m
))

~
isempty
(
find
(
Byrqm

round
(
Byrqm
)))
error
(
'argin qm, Byrqm, or Eyrqm must of integer'
)
elseif
Byrqm
(
1
)
>
Eyrqm
(
1
)
...
...
matlab/mssbvar/cstz/fn_dataext.m
View file @
bb0e3d80
...
...
@@ 12,6 +12,23 @@ function [xdsube,Brow,Erow] = fn_dataext(Byrqm,Eyrqm,xdatae)
%
% Tao Zha, April 2000
% Copyright (C) 20002011 Tao Zha
%
% 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
(
Byrqm
(
2
)
==
0
)
&&
(
Eyrqm
(
2
)
~=
0
)
error
(
'If annual data, make sure both Byrqm(2) and Eyrqm(2) are zero'
)
end
...
...
matlab/mssbvar/cstz/fn_datana.m
View file @
bb0e3d80
...
...
@@ 27,6 +27,23 @@ function [yactyrge,yactyre,yactqmyge,yactqmge,yactqme] = fn_datana(xdatae,q_m,vl
%
% Tao Zha, April 2000.
% Copyright (C) 20002011 Tao Zha
%
% 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
(
xdatae
,
1
)
<
2
*
q_m
error
(
'We need at least two years of xdatae to get annual rates. Check xdatae!!'
)
end
...
...
matlab/mssbvar/cstz/fn_dataxy.m
View file @
bb0e3d80
...
...
@@ 40,6 +40,23 @@ function [xtx,xty,yty,fss,phi,y,ncoef,xr,Bh,e] = fn_dataxy(nvar,lags,z,mu,indxDu
%
% Tao Zha, February 2000.
% Copyright (C) 20002011 Tao Zha
%
% 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
nargin
==
5
nexo
=
1
;
% default for constant term
elseif
nexo
<
1
...
...
matlab/mssbvar/cstz/fn_ergodp.m
View file @
bb0e3d80
...
...
@@ 8,6 +8,23 @@ function gpi = fn_ergodp(P)
%
% Tao Zha August 2000
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
[
gpim
,
gpid
]
=
eig
(
P
);
% m: matrix; d: diagonal
[
gpidv
,
gpidvinx
]
=
sort
(
diag
(
gpid
));
gpidv
=
fliplr
(
gpidv
);
...
...
matlab/mssbvar/cstz/fn_fcstidcnd.m
View file @
bb0e3d80
...
...
@@ 64,6 +64,22 @@ function [yhat,Estr,rcon,Rcon,u,v,d] = fn_fcstidcnd(valuecon,stepcon,varcon,nste
% programs may not be compatible.
% 3/15/2004 There are some BUG problems when calling fn_fcstcnd.m().
% Copyright (C) 19982011 Tao Zha
%
% 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/>.
DLSIdShock
=
~
isempty
(
eq_ms
);
% if not empty, the MS shock is identified as in DLS
...
...
matlab/mssbvar/cstz/fn_forecast.m
View file @
bb0e3d80
...
...
@@ 16,6 +16,23 @@ function yhat = fn_forecast(Bh,phi,nn,nexo,Xfexo)
%
% See fn_forecastsim.m with shocks; fn_forecaststre.m.
% Copyright (C) 2011 Tao Zha
%
% 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
nargin
==
3
nexo
=
1
;
% default for constant term
elseif
nexo
<
1
...
...
matlab/mssbvar/cstz/fn_foregraph.m
View file @
bb0e3d80
...
...
@@ 17,6 +17,22 @@ function fn_foregraph(yfore,yacte,keyindx,rnum,cnum,q_m,ylab,forelabel,conlab)
%
% Tao Zha, March 2000
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
vyrs
=
yfore
(:,
1
);
hornum
=
cell
(
length
(
vyrs
),
1
);
% horizontal year (number)
...
...
matlab/mssbvar/cstz/fn_fprintmatrix.m
View file @
bb0e3d80
...
...
@@ 11,6 +11,24 @@ function fn_fprintmatrix(fid, M, nrows, ncols, indxFloat)
% 3 if only 3 significant digits
% 0 if integer.
%
% Copyright (C) 2011 Tao Zha
%
% 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
nrows
~=
size
(
M
,
1
)
nrows
size
(
M
,
1
)
...
...
matlab/mssbvar/cstz/fn_gfmean.m
View file @
bb0e3d80
...
...
@@ 22,6 +22,23 @@ function [Fmat,gvec] = fn_gfmean(b,P,Vi,nvar,ncoef,n0,np)
%
% Tao Zha, February 2000. Revised, August 2000.
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
b
=
b
(:);
n0
=
n0
(:);
np
=
np
(:);
n0cum
=
[
0
;
cumsum
(
n0
)];
...
...
matlab/mssbvar/cstz/fn_gibbsrvar.m
View file @
bb0e3d80
...
...
@@ 22,6 +22,23 @@ function [A0gbs, Wcell] = fn_gibbsrvar(A0gbs,UT,nvar,fss,n0,Indxcol)
% Written by Tao Zha, August 2000. Revised, September 2004.
% Copyright (c) by Waggoner and Zha
% Copyright (C) 20002011 Tao Zha and Daniel Waggoner
%
% 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
(
nargin
==
5
),
Indxcol
=
[
1
:
nvar
];
end
% Local loop for Gibbs given last A0gbs 
...
...
matlab/mssbvar/cstz/fn_gibbsrvar_setup.m
View file @
bb0e3d80
...
...
@@ 38,6 +38,22 @@ function [Tinv,UT,VHphalf,PU,VPU] = fn_gibbsrvar_setup(H0inv, Ui, Hpinv, Pmat, V
% Written by Tao Zha, September 2004.
% Copyright (c) 2004 by Waggoner and Zha
% Copyright (C) 20042011 Tao Zha and Daniel Waggoner
%
% 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/>.
% For A0.
Tinv
=
cell
(
nvar
,
1
);
% in each cell, inv(T_i) for T_iT_i'=S_i where S_i is defined on p.355 of the WZ JEDC paper.
...
...
matlab/mssbvar/cstz/fn_imcgraph.m
View file @
bb0e3d80
...
...
@@ 17,6 +17,23 @@ function scaleout = fn_imcgraph(imf,nvar,imstp,xlab,ylab,indxGimfml,xTick)
%
% See imrgraph, fn_imcerrgraph, fn_imc2errgraph, imrerrgraph, fn_gyrfore in RVARcode
% Copyright (C) 19992011 Tao Zha
%
% 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
nargin
<
7
,
xTick
=
[];
end
t
=
1
:
imstp
;
...
...
matlab/mssbvar/cstz/fn_impulse.m
View file @
bb0e3d80
...
...
@@ 18,6 +18,23 @@ function imf = fn_impulse(Bh,swish,nn)
% Written by Tao Zha.
% Copyright (c) 1994 by Tao Zha
% Copyright (C) 19942011 Tao Zha
%
% 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/>.
nvar
=
nn
(
1
);
lags
=
nn
(
2
);
imstep
=
nn
(
3
);
% number of steps for impulse responses
...
...
matlab/mssbvar/cstz/fn_rlrpostr.m
View file @
bb0e3d80
...
...
@@ 34,6 +34,23 @@ function [P,H0inv,Hpinv] = fn_rlrpostr(xtx,xty,yty,Ptld,H0invtld,Hpinvtld,Ui,Vi)
%
% Tao Zha, February 2000
% Copyright (C) 20002011 Tao Zha
%
% 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/>.
nvar
=
size
(
yty
,
1
);
P
=
cell
(
nvar
,
1
);
% tld: tilda
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment