Hi,
Has anyone written code to implement the procedure described in
Lancaster and Aiyar (2000)? I have the following so far, but am not
sure if it's right.
model {
rho~dunif(0,1.5)
#rho has a uniform prior.
d~dunif(-100,100)
tau<-exp(d)
for (t in 1:T){
bb[t]<-(1/T)*((T-1)/t)*pow(rho,t)
}
b<-2*mean(bb[1:T])
#this defines b as a function of rho
for (i in 1:n){
g[i]~dunif(-100,100)
f[i]<-x[i,1]*(1-rho)+g[i]*exp(-b)
}
#this defines f as a function of g
for (i in 1:n){
x[i,1]~dunif(-100,100)
#x[i,1] should be the initial value of the dependent variable.
mu[i,1]<-f[i]+rho*x[i,1]
y[i,1]~dnorm(mu[i,1],tau)
for (t in 2:T){
y[i,t]~dnorm(mu[i,t],tau)
x[i,t]<-y[i,t-1]
mu[i,t]<-f[i]+rho*x[i,t]
}
}
}
Thank you,
Amalia Jerison
SUNY Albany
-------------------------------------------------------------------
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
|