Page 1 of 2
time varying autoregressive process with stochastic volatili
Posted: Mon Apr 20, 2015 8:12 am
by Deepika
hi
i am trying to find codes for running Time varying auto regressive process with stochastic volatility on the lines of Nakajima, J. (2011). "Time-varying parameter VAR model with stochastic volatility: An overview of methodology and empirical applications" Monetary and Economic Studies, 29, 107-142. please help me to find codes for the programme. i am using RATS 8.0.
regards
Deepika
Re: time varying autoregressive process with stochastic vola
Posted: Mon Apr 20, 2015 10:11 am
by TomDoan
Re: time varying autoregressive process with stochastic vola
Posted: Mon Apr 20, 2015 11:27 am
by Deepika
Hi Tom
thank you for a prompt reply. i am looking to run a simple AR(1) process with time varying parameters and stochastic volatility. will the codes not be different in this case.
thanks
deepika
Re: time varying autoregressive process with stochastic vola
Posted: Mon Apr 20, 2015 12:12 pm
by TomDoan
I believe it's the same, just with one variable.
Re: time varying autoregressive process with stochastic vola
Posted: Wed Jul 08, 2015 1:05 pm
by Deepika
Hi Tom
while running the codes for TVPVARKSC i am getting an error. The loop being run is
************ now normalize the responses for this period to make the average shock sizes the same across time (= full sample OLS size)
** compute scaling factors from median shock sizes, Cholesky
do i = 1,nvar
set statser 1 ndraws = responses(count,t)((i-1)*nvar+i,1)
stats(fractiles,noprint) statser 1 ndraws
comp scalefact(i) = shocksize(i)/%median
end do i
** now do the rescaling
do draws = 1,ndraws
do k = 1,nstep
do i = 1,nvar
do j = 1,nvar
comp responses(count,draws)((i-1)*nvar+j,k) = responses(count,draws)((i-1)*nvar+j,k)*scalefact(i)
end do j
end do i
end do k
end do draws
end do count
and the error which i get is:
## EQ4. Equation %MODELEQN(VARMOD Has At Least One Undefined or NA Coefficient
The Error Occurred At Location 615, Line 27 of loop/block
41296728 Position 12686
can you please help
regards
deepika
Re: time varying autoregressive process with stochastic vola
Posted: Wed Jul 08, 2015 1:25 pm
by TomDoan
What you posted has no reference at all to %MODELEQN or VARMOD, so the problem is elsewhere. Don't post a part of the source file---post the call to the procedure that you're making.
Re: time varying autoregressive process with stochastic vola
Posted: Wed Jul 08, 2015 8:21 pm
by Deepika
Hi
Sorry my error. Attaching the correct data and program file for your reference.
Regards
Deepika
Re: time varying autoregressive process with stochastic vola
Posted: Thu Jul 09, 2015 10:44 am
by TomDoan
This is specific to the original example and isn't correct for your case (the first two are before your data even starts). These list the entries for which you want to compute IRF's.
comp [vec[int]] impdates = ||1975:1,1981:3,1996:1||
Re: time varying autoregressive process with stochastic vola
Posted: Thu Aug 27, 2015 12:33 pm
by Deepika
Hi Tom
even if i use a 3 variable model but with a different data set i get the following error:
## DLM2. No Observations Produce Valid Output. Check Data and Initial Values
The Error Occurred At Location 6682, Line 434 of VARTVPKSC
C:\UsersData\Deepika-2015-Jul\RatsPrograms\VARTVPKSC.correctedJan2014.src Line 517
attached are the files for reference
thanks
Deepika
Re: time varying autoregressive process with stochastic vola
Posted: Thu Aug 27, 2015 3:25 pm
by TomDoan
What you posted doesn't work at all because you don't read all three variables. When I fix that it works fine. However, it uses a LOT of memory, and so might not work on RATS Standard.
Re: time varying autoregressive process with stochastic vola
Posted: Thu Aug 27, 2015 11:43 pm
by Deepika
so does it imply i cannot run the three variable model on the standard version of RATS 9
Deepika
Re: time varying autoregressive process with stochastic vola
Posted: Fri Aug 28, 2015 8:15 am
by TomDoan
You may have to cut down on the number of draws.
Re: time varying autoregressive process with stochastic vola
Posted: Mon Aug 31, 2015 12:15 pm
by Deepika
Hi Tom
Thanks for that suggestion. but by how much should the number of draws be reduced so that the effciency of estimates is not affected??
Also do you think that updating to RATS Pro9 would help?? If yes then would that also make a larger model to be able to run possible, say a 4 or 5 varaible model.
Regards
Deepika
Re: time varying autoregressive process with stochastic vola
Posted: Mon Aug 31, 2015 3:10 pm
by TomDoan
Deepika wrote:Hi Tom
Thanks for that suggestion. but by how much should the number of draws be reduced so that the effciency of estimates is not affected??
4000 should be fine and would take roughly half the space.
Deepika wrote:
Also do you think that updating to RATS Pro9 would help?? If yes then would that also make a larger model to be able to run possible, say a 4 or 5 varaible model.
Yes and yes. It's faster and has effectively unlimited capacity.
Re: time varying autoregressive process with stochastic vola
Posted: Fri May 04, 2018 7:18 am
by Deepika
Respected Sir
i used Nakajima, J. (2011). "Time-varying parameter VAR model with stochastic volatility: An overview of methodology and empirical applications" Monetary and Economic Studies, 29, 107-142 to study inflation persistence in India. using the codes in RATS i am unable to produce graphs which shows time-varying IRF of inflation to unit shocks in inflation, output and interest rate, at one period, two period and three period ahead. they have used MATLAB codes. how can this be done in RATS. i am using RATS pro 9.
Regards
Deepika