VAR with time-varying parameters and stochastic volatility

Questions and discussions on Time Series Analysis

Re: VAR with time-varying parameters and stochastic volatili

Postby Andy_T » Sun Feb 17, 2013 7:31 am

Dear Todd,

in VARTVPKSC.src, STEP 4: Draw {select_draw_1,....,select_draw_T}, the states used in the KSC mixture distribution - could you please tell me why we have to divide by sqrt(var_mixdist(i)) in line 4 of the following loop?

do ii = 1,nvar
do vtime=stpt,endpt
ewise tempinside(i) = (ystar2mat(vtime)(ii) - (2.*deltadraw(vtime)(ii) + mean_mixdist(i)))/sqrt(var_mixdist(i))
ewise tempdensity(i) = %density(tempinside(i))/sqrt(var_mixdist(i))
comp selection = pr_mixdist.*tempdensity
comp select_draw(vtime)(ii) = %ranbranch(selection)
end do vtime
end do ii

I tried looking up how %density calculates the standard normal density but I could not find the answer in the manuals. If the standard normal density is defined as:

1/sqrt(2*pi*sigma^2)*exp(-.5*((x - mu)^2)/sigma^2)

and I feed %density with (x - mu)/sigma, i.e. tempinside(i), what does %density give me?

Thanks in advance!
Andy_T
 
Posts: 4
Joined: Fri Aug 17, 2012 5:48 am

Re: VAR with time-varying parameters and stochastic volatili

Postby tclark » Tue Feb 19, 2013 8:55 am

We need to compute the density value for a normal random variable. The textbook formula for that value is (sigma^2*2*pi)*exp(-1*(x-mu)^2/(2*sigma^2)), where mu and sigma denote the mean and st. dev. of x. The %density function is specific to a standard normal random variable, which means it imposes sigma = 1 and mu = 0. In the calculations in the code, the "tempinside" vector contains the term corresponding to (x-mu)/sigma. The value of %density((x-mu)/sigma) then has to be divided by sigma to deliver the correct value of the density of x.
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
tclark
 
Posts: 35
Joined: Wed Nov 08, 2006 4:20 pm

Re: VAR with time-varying parameters and stochastic volatili

Postby luching » Wed Mar 27, 2013 10:59 am

I am visiting this topic after a while. The codes by Todd or more generally the DLM routine in RATS use the Durbin-Koopman instead of Carter-Kohn to draw the states. I was just wondering if there are any specific advantages for doing so.
luching
 
Posts: 31
Joined: Mon Jun 07, 2010 4:05 pm

Re: VAR with time-varying parameters and stochastic volatili

Postby moderator » Wed Mar 27, 2013 12:43 pm

luching wrote:I am visiting this topic after a while. The codes by Todd or more generally the DLM routine in RATS use the Durbin-Koopman instead of Carter-Kohn to draw the states. I was just wondering if there are any specific advantages for doing so.


They are distinct algorithms for doing the same type of draw, so either is OK. The advantage of D-K is that it is quite a bit simpler once you have written code for Kalman filtering and smoothing, while Carter-Kohn is a completely separate set of calculations.
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

Re: VAR with time-varying parameters and stochastic volatili

Postby luching » Wed Apr 10, 2013 1:27 pm

With an intercept term in the VAR system, the time varying VAR model should be able to handle trends in the data because the time varying intercept term takes care of the trend. For instance, US inflation and nominal rate have an obvious downward trend. But from a stationarity standpoint, it looks like the data must be de-trended.

Any advice on this?
luching
 
Posts: 31
Joined: Mon Jun 07, 2010 4:05 pm

Re: VAR with time-varying parameters and stochastic volatili

Postby tclark » Wed Apr 10, 2013 2:28 pm

In the literature (e.g., Cogley and Sargent 2005, Primiceri 2005), the standard approach is to allow the time variation in model coefficients pick up movements in means over time. In plenty of papers, mean shifts are a key reason for introducing time varying parameters.
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
tclark
 
Posts: 35
Joined: Wed Nov 08, 2006 4:20 pm

Re: VAR with time-varying parameters and stochastic volatili

Postby tclark » Thu May 02, 2013 12:57 pm

Regarding the estimation procedure I originally posted, Del Negro and Primiceri (link below) have recent posted a correction to the ordering of Gibbs sampler steps detailed in the appendix to Primiceri (2005, RESTUD) and used in the original version of the code I posted a few years ago. This correction should reduce the tendency of the original code to produce very variable estimates of stochastic volatility. However, Del Negro and Primiceri report that the correction doesn't much affect the results reported in Primiceri (2005).

http://faculty.wcas.northwestern.edu/%7 ... aFinal.pdf
Attachments
VARTVPKSC.correctedMay2013.src
(31.44 KiB) Downloaded 14 times
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
tclark
 
Posts: 35
Joined: Wed Nov 08, 2006 4:20 pm

Previous

Return to Other Time Series Analysis

Who is online

Users browsing this forum: No registered users and 0 guests