Email discussion lists for the UK Education and Research communities

## BUGS@JISCMAIL.AC.UK

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font
 LISTSERV Archives BUGS Home BUGS 2006

#### Options

Subject:

CAPM dynamic linear model in BUGS

From:

Date:

Tue, 22 Aug 2006 15:57:22 +0200

Content-Type:

text/plain

Parts/Attachments:

 text/plain (63 lines)
 ```Dear BUGS users. We are trying to estimate the following CAPM model using BUGS: The observational equation is Rp(t) = beta(t)*Rm(t) + sigma_p Rp and Rm are observed while beta is unobserved. And the state equation is beta(t) = alpha - delta*[beta(t-1)-alpha] + sigma_b In this model the alpha is the long-term mean and delta is the persistence away from this long-term mean of beta. Our numbers are very stable but biased. Can anyone see any errors in our model or even have some suggestions that may improve it? You will find our model below. model; { # N equals number of portfolios, while T equals number of periods. for (n in 1 : N) {       beta[n,1]<-1       alpha[n] ~ dnorm(meanalpha[n],vara[n])       delta[n] ~ dnorm(meandelta[n],vard[n])I(-1,1)       meanalpha[n] ~ dnorm(1,10)       meandelta[n] ~ dnorm( 0.5,10)       varb[n] ~ dgamma(0.001,0.001)       sigmab[n] <- 1 / sqrt(varb[n])       varr[n] ~ dgamma(0.001,0.001)       sigmar[n] <- 1 / sqrt(varr[n])       vara[n] ~ dgamma(0.001,0.001)       vard[n] ~ dgamma(0.001,0.001) # observation model.    for( i in 1 : T ) {       rp[n,i] ~ dnorm(marketfactor[n,i],varr[n])       marketfactor[n,i] <- beta[n,i] * rm[i] } # state model.    for (i in 2 : T) { beta[n,i] ~ dnorm(meanbeta[n,i],varb[n])       meanbeta[n,i] <- alpha[n] + delta[n] * (beta[n,i-1] - alpha[n]) } } } Yours truly Per Thorkildsen Erik Smith-Meyer Post-grad students at Norwegian School of Management _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter ------------------------------------------------------------------- This list is for discussion of modelling issues and the BUGS software. For help with crashes and error messages, first mail [log in to unmask] To mail the BUGS list, mail to [log in to unmask] Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments to the list. To leave the BUGS list, send LEAVE BUGS to [log in to unmask] If this fails, mail [log in to unmask], NOT the whole list ```