Dynamic CAPM with the Gibbs Sampler

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
Manty
Posts: 1
Joined: Fri Mar 13, 2015 5:53 am

Dynamic CAPM with the Gibbs Sampler

Unread post by Manty »

Dear TomDoan,
I'am trying to estimate a Dynamic CAPM (dynamic beta) with the Gibbs Sampler.
model.jpg
model.jpg (9.95 KiB) Viewed 5997 times
My code, so far, is just a variation around "Lutkepohl, New Introduction, example 18.5 from pp 637-639". I was wondering if you can take a quick look at it, and maybe run it as well, to tell me what you think. Since i 'am still new to Bayesian Methods i might misunderstood something. This is the best estimation i can get by "playing" with the initial values. Indeed i really don't want something too much volatile.
I think a good way to improve the model would be to have a full variance-covariance matrix of the shocks, so i assume i need something like:

dec frml[sym] sigmab
frml sigmab = 0.5*(%XXSYS)

and remove the %diag in the dlm function. However variances would follow inv.Wishart and i don't know how to change that in the code.
I've attached my code and the data.

Thank you very much
Manty
Attachments
Data.RAT
(227.5 KiB) Downloaded 1033 times
Code.RPF
(2.4 KiB) Downloaded 1057 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Dynamic CAPM with the Gibbs Sampler

Unread post by TomDoan »

That doesn't seem unreasonable.

compute sumsq0=.000005
compute df0 =8

translates into a variance of .000005/8. Over the course of a year (260 observations), that would be a standard deviation for a random walk of sqrt(sumsq0/df0*260)=.01275. For most of your coefficients, that doesn't sound unreasonable. And remember that that's a small enough degrees of freedom that it's really only a "suggestion"---if you look, the coefficient on AA_BA, which is the only one whose coefficients completely out of scale to the others ends up with absolute movements quite a bit larger than that.

I wouldn't recommend trying to put a full covariance matrix on the joint movements. That's much more complicated and it's not clear that it really helps.
Post Reply