by TG81 » Sun Oct 24, 2010 3:15 am
Thank you very much for the reply! Its been a great help.
We figured that %modellagsums is working in place of %varlagsums in RATS 7.2 and 7.3. I ran in to another problem. My model has long run restrictions (and no short run restrictions). When I am imposing that and calling in the procedure @ShortAndLong, I am getting results only for low values of nkeep. For nkeep>190(approx), RATS is giving the following error message
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
In the bootstrap simulations, for a certain value of nkeep, noninvertible matrix is generated and the program stops. The following are some portion of my program. I am not sure what is going wrong as the same set of codes work perfectly fine if I do not impose any short run or long run restrictions. Please help Tom. I have a journal deadline next week.
CODES:
dec rect[series] impulses(nvar,nvar) impuls(nvar,nvar) responses(nvar,nvar) responses2(nvar,nvar) vdecomp(nvar,nvar)
dec vect[series] udraws(nvar) resids(nvar) resample(nvar)
declare rect[series] vdbkeep(nvar,nvar) vdbkeep2(nvar,nvar) deco(nvar,nvar)
do i = 1,nvar
do j = 1,nvar
set responses(i,j) = 0
set responses2(i,j) = 0
set vdbkeep(i,j) = 0
set vdbkeep2(i,j) = 0
end do j
end do i
system(model=varmodel)
variables RDIFF OutputDIFF HoursDIFF RealBalDIFF MultiDIFF AMBSLDIFF
lags 1 to optlags
det constant
end(system)
*
*estimate the multivariate model
*
dec rect f(nvar,nvar)
dec rect sr(nvar,nvar)
input sr
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
dec rect lr(nvar,nvar)
input lr
. 0 0 0 0 0
. . 0 0 0 0
. . . 0 0 0
. . . . 0 0
. . . . . 0
. . . . . .
estimate(model=varmodel,cvout=vsigma,resids=resids,noprint)
source "C:\Users\Documents\WinRATS 7.3\ShortAndLong.src"
@ShortAndLong(sr=sr,lr=lr,masums=inv(%modellagsums(varmodel)),factor=f) %sigma
disp ###.### "Impact Responses" f
impulse(noprint,model=varmodel,factor=f,results=impuls,steps=horizon)
errors(print,model=varmodel,steps=horizon,factor=f,results=deco)
compute rstart=%regstart(),rend=%regend()
infobox(action=define,progress,lower=1,upper=nkeep) "Bootstrap Simulations"
do draws=1,nkeep
* Draw a bootstrapped sample
boot entries rstart rend
do i=1,nvar
set udraws(i) = resids(i)(entries(t))
end do i
forecast(path,model=varmodel,from=rstart,to=rend,results=resample)
# udraws
system(model=bootvar)
variables resample
lags 1 to optlags
det constant
end(system)
* Estimate the model with resampled data
estimate(noprint,model=bootvar,noftests,cvout=v)
dec rect fb(nvar,nvar)
source "C:\Users\Documents\WinRATS 7.3\ShortAndLong.src"
@ShortAndLong(sr=sr,lr=lr,masums=inv(%modellagsums(bootvar)),factor=fb) %sigma
disp ###.### "Impact Responsesb" fb
impulse(noprint,model=bootvar,factor=fb,results=impulses,steps=horizon)
errors(noprint,model=bootvar,factor=fb,results=vdecomp,steps=horizon)
do i = 1,nvar
do j = 1,nvar
set responses(i,j) = responses(i,j)+impulses(i,j)
set responses2(i,j) = responses2(i,j)+impulses(i,j)^2
set vdbkeep(i,j) = vdbkeep(i,j)+vdecomp(i,j)
set vdbkeep2(i,j) = vdbkeep2(i,j)+vdecomp(i,j)^2
end do j
end do i
infobox(current=draws)
end do draws
infobox(action=remove)
******