drawing mixture states of Kim, Shephard, and Chib (1998)

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
tclark
Posts: 99
Joined: Wed Nov 08, 2006 3:20 pm

drawing mixture states of Kim, Shephard, and Chib (1998)

Unread post by tclark »

Tom --

In comparing code I have for VARs with stochastic volatility to the code of other researchers that actually use different algorithms for drawing volatility, I have come to realize that my coding of the drawing of the mixture states used in the Kim, Shephard, and Chib (1998, RESTUD) algorithm is something of a bottleneck (this is the section of code in lines 590-618 and some dimensioning or setup that comes earlier in the .src file in the attached .zip) file. Are there ways you see to make the drawing of the mixture states more efficient, time-wise, than I have them? Any suggestions would be a great help. Thanks.

Todd
Attachments
publicupdated.zip
(58.95 KiB) Downloaded 817 times
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: drawing mixture states of Kim, Shephard, and Chib (1998)

Unread post by TomDoan »

This would be my way to implement that. Other than doing the sqrt(...) just once, I'm not sure anything would significantly change the timing.
Attachments
mixturegibbs.rpf
(2.91 KiB) Downloaded 936 times
tclark
Posts: 99
Joined: Wed Nov 08, 2006 3:20 pm

Re: drawing mixture states of Kim, Shephard, and Chib (1998)

Unread post by tclark »

Much, much appreciated, Tom. I will give your implementation a try. It is of course more elegant, even if it proves to be not a lot faster.
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
Post Reply