ported bug corrections from v3 to v4
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@504 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
7cbffd4bb9
commit
ecd2fb95dd
|
@ -28,6 +28,7 @@ QQ = R*Q*transpose(R);
|
|||
QRt = Q*transpose(R);
|
||||
alphahat = zeros(mm,smpl);
|
||||
etahat = zeros(rr,smpl);
|
||||
epsilonhat = zeros(size(Y));
|
||||
r = zeros(mm,smpl);
|
||||
|
||||
Z = zeros(pp,mm);
|
||||
|
|
|
@ -31,6 +31,7 @@ QQ = R*Q*transpose(R);
|
|||
QRt = Q*transpose(R);
|
||||
alphahat = zeros(mm,smpl);
|
||||
etahat = zeros(rr,smpl);
|
||||
epsilonhat = zeros(size(Y));
|
||||
r = zeros(mm,smpl);
|
||||
|
||||
Z = zeros(pp,mm);
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
function d1 = bksupk(ny,fid,jcf,icc1)
|
||||
|
||||
global M_ options_ c ncc
|
||||
global M_ options_
|
||||
|
||||
icf = [1:jcf-1] ;
|
||||
ir = [(options_.periods-1)*ny+1:ny*options_.periods] ;
|
||||
irf = icc1+(options_.periods-1)*ny ;
|
||||
d1 = zeros(options_.periods*ny,1) ;
|
||||
|
||||
ofs = (((options_.periods-1)*ny+1)-1)*ncc*8 ;
|
||||
ofs = (((options_.periods-1)*ny+1)-1)*jcf*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
c = fread(fid,[jcf,ny],'float64') ;
|
||||
|
||||
d1(ir) = c(:,jcf) ;
|
||||
ir = ir-ny ;
|
||||
|
@ -20,10 +19,9 @@ i = 2 ;
|
|||
while i <= M_.maximum_lead | i <= options_.periods
|
||||
irf1 = selif(irf,irf<=options_.periods*ny) ;
|
||||
|
||||
ofs = (((options_.periods-i)*ny+1)-1)*ncc*8 ;
|
||||
ofs = (((options_.periods-i)*ny+1)-1)*jcf*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
c = fread(fid,[jcf,ny],'float64') ;
|
||||
|
||||
d1(ir) = c(:,jcf) - c(:,1:size(irf1,1))*d1(irf1) ;
|
||||
ir = ir - ny ;
|
||||
|
@ -33,10 +31,9 @@ end
|
|||
|
||||
while i <= options_.periods
|
||||
|
||||
ofs = (((options_.periods-i)*ny+1)-1)*ncc*8 ;
|
||||
ofs = (((options_.periods-i)*ny+1)-1)*jcf*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
c = fread(fid,[jcf,ny],'float64') ;
|
||||
|
||||
d1(ir) = c(:,jcf)-c(:,icf)*d1(irf) ;
|
||||
ir = ir-ny ;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
function simk
|
||||
|
||||
global M_ options_ oo_
|
||||
global c it_ iyr0 ct_ ncc broyden_
|
||||
global it_ iyr0 ct_ broyden_
|
||||
|
||||
func_name = [M_.fname '_static'];
|
||||
nk = M_.maximum_lag + M_.maximum_lead + 1 ;
|
||||
|
@ -134,7 +134,6 @@ for iter = 1:options_.maxit
|
|||
ofs = ((it_-M_.maximum_lag-M_.maximum_lag+j-2)*ny)*ncc*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
|
||||
if isempty(jwci)
|
||||
w = -w0*c(j1i,1:ncc1) ;
|
||||
|
@ -191,7 +190,7 @@ for iter = 1:options_.maxit
|
|||
clear w w0 ;
|
||||
|
||||
junk = fseek(fid,0,1) ;
|
||||
fwrite(fid,c','float64') ;
|
||||
fwrite(fid,c,'float64') ;
|
||||
clear c ;
|
||||
|
||||
it_ = it_ + 1;
|
||||
|
@ -219,7 +218,6 @@ for iter = 1:options_.maxit
|
|||
ofs = ((icr0+(j-1)*ny+1)-1)*ncc*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
|
||||
temp = zeros(ny,ltemp(j)) ;
|
||||
if ljwc(j) > 0
|
||||
|
@ -246,7 +244,7 @@ for iter = 1:options_.maxit
|
|||
d1 = [] ;
|
||||
clear w w0 ;
|
||||
junk = fseek(fid,0,1) ;
|
||||
fwrite(fid,c','float64') ;
|
||||
fwrite(fid,c,'float64') ;
|
||||
clear c ;
|
||||
it_ = it_ + 1 ;
|
||||
ic = ic + ny ;
|
||||
|
@ -258,7 +256,6 @@ for iter = 1:options_.maxit
|
|||
ofs = (((it_-M_.maximum_lag-2)*ny+1)-1)*ncc*8 ;
|
||||
junk = fseek(fid,ofs,-1) ;
|
||||
c = fread(fid,[ncc,ny],'float64') ;
|
||||
c = c' ;
|
||||
|
||||
for i = 1:M_.maximum_lead
|
||||
w = tril(triu(ones(ny,ny+ncc1))) ;
|
||||
|
@ -266,7 +263,7 @@ for iter = 1:options_.maxit
|
|||
c = [w(:,ny+1:size(w,2))' c(:,ncc)]/w(:,1:ny) ;
|
||||
|
||||
junk = fseek(fid,0,1) ;
|
||||
fwrite(fid,c','float64') ;
|
||||
fwrite(fid,c,'float64') ;
|
||||
|
||||
it_ = it_+1 ;
|
||||
ic = ic + ny ;
|
||||
|
|
Loading…
Reference in New Issue