Hi all, In my model I want to parse initial values for stan(), so this is what I have written as my stan code:
stan(model_code, data, warmup = 250,iter = 500, chains =4, init = list( list(mu=4.5),list(sigma2=0.05)))
But,I got an error,
Error in config_argss(chains = chains, iter = iter, warmup = warmup, thin = thin, :
initial value list mismatchs number of chains
error in specifying arguments; sampling not done.
My parameter block looks like that
parameters{
real<lower=4.0,upper=4.5> mu;
real<lower=0.01,upper=0.05> sigma2;
}
and model block starts like this,
model{
//prior distributions
mu ~ uniform(4.0,4.5);
sigma2 ~ uniform(0.01,0.05);
…
}
After having above error I changed “chains=2” and then it gives me another error,
SAMPLING FOR MODEL ‘e7eb143cebe5ca8e6c580f123d99c99e’ NOW (CHAIN 1).
Chain 1: Rejecting initial value:
Chain 1: Log probability evaluates to log(0), i.e. negative infinity.
Chain 1: Stan can’t start sampling from this initial value.
Can anyone help me here please?
Thanks