0

I am having a problem in initializing the following model in OpenBUGS

model
{
#likelihood
for (t in 1:n) { yisigma2[t] <- 1/exp(theta[t]);
y[t] ~ dnorm(0,yisigma2[t]);
}
#Priors
mu ~ dnorm(0,0.1);
phistar ~ dbeta(20,1.5);
itau2 ~ dgamma(2.5,0.025);
beta <- exp(mu/2);
phi <- 2*phistar-1;
tau <- sqrt(1/itau2);
theta0~dnorm(mu, itau2)
thmean[1] <- mu + phi*(theta0-mu);
theta[1] ~ dnorm(thmean[1],itau2);
for (t in 2:n) { thmean[t] <- mu + phi*(theta[t-1]-mu);
theta[t] ~ dnorm(thmean[t],itau2);
}
}

This is my data

list(y=c(-0.0383 , 0.0019 ,......-0.0094),n=945)

And this is the list of my initials

list(phistar= 0.98, mu=0, itau2=50)

The checking of model, loading of data and compilation steps are ok. When loading initials, OpenBUGS says initial values are loaded but chain contains uninitialized variables. I then tried to initialize theta0 also but the problem persists. Could someone please help me regarding this? Thanks Khalid

1 Answers1

0

I am newbie at OpenBugs but shouldn't you be specifying a distribution for inits rather than a single point value? something like? inits <- function(){ list(alpha=rnorm(1), beta=rnorm(1), sigma = rlnorm(1))}

dnatheist
  • 77
  • 7
  • I am also new to OpenBUGS. But I think distribution for inits is required when multiple chains need to be run. I am running a single chain as used in this paper "BUGS for a Bayesian of Stochastic Volatility Models" by Meyer and Yu. Also, I have found the solution. This is because all of the latent variables in the model (within the Bayesian Framework) are also considered parameters and so each individual's latent variables need starting values too. So "gen inits" from OpenBUGS can also be used after loading inits. – Khalid Munawer Mar 31 '16 at 15:52