I'm a first time Stan user so I might be doing something obviously stupid, but I can't seem to find the problem. I fit a large model in Rstan, the code ran for approximately 8 hours. The errors appear pretty harmless to me but when I look at the returned object I receive the error 'Stan model 'e3e0e19d22c8ea8ec8d41b888c7c59ca' does not contain samples.'
I found the following statement in the Rstan manual which might be relevant.
But I really don't know what that means. Is the object that I have saved useless, or can information actually be extracted?
Any advice would be greatly appreciated.
The model statement and associated errors are below, and the full R script is attached.
[1] "The following numerical problems occured the indicated number of times after warmup on chain 2"
count
Exception thrown at line 38: multi_normal_log: Covariance matrix is not symmetric. Covariance matrix 11
Exception thrown at line 38: multi_normal_log: LDLT_Factor of covariance parameter is not positive d 3
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small, do not ask about this message on stan-users."
Chain 3, Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 4, Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 1, Iteration: 1600 / 2000 [ 80%] (Sampling)
Chain 4, Iteration: 2000 / 2000 [100%] (Sampling)
Elapsed Time: 18845.2 seconds (Warm-up)
7888.17 seconds (Sampling)
26733.4 seconds (Total)
[1] "The following numerical problems occured the indicated number of times after warmup on chain 4"
count
Exception thrown at line 38: multi_normal_log: Covariance matrix is not symmetric. Covariance matrix 14
Exception thrown at line 38: multi_normal_log: LDLT_Factor of covariance parameter is not positive d 4
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small, do not ask about this message on stan-users."
Chain 3, Iteration: 2000 / 2000 [100%] (Sampling)
Elapsed Time: 17757.9 seconds (Warm-up)
9347.9 seconds (Sampling)
27105.8 seconds (Total)
Chain 1, Iteration: 1800 / 2000 [ 90%] (Sampling)[1] "The following numerical problems occured the indicated number of times after warmup on chain 3"
count
Exception thrown at line 38: multi_normal_log: Covariance matrix is not symmetric. Covariance matrix 10
Exception thrown at line 38: multi_normal_log: LDLT_Factor of covariance parameter is not positive d 3
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small, do not ask about this message on stan-users."
Chain 1, Iteration: 2000 / 2000 [100%] (Sampling)
Elapsed Time: 19549.6 seconds (Warm-up)
9836.25 seconds (Sampling)
29385.8 seconds (Total)
[1] "The following numerical problems occured the indicated number of times after warmup on chain 1"
count
Exception thrown at line 38: multi_normal_log: LDLT_Factor of covariance parameter is not positive d 7
Exception thrown at line 38: multi_normal_log: Covariance matrix is not symmetric. Covariance matrix 6
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small, do not ask about this message on stan-users."
data {
int<lower=0> npep ;
int<lower=0> N ;
int<lower=0> nprotch ;
real y[N] ;
matrix[npep,2] int_IS ;
int<lower=1,upper=npep> opep[N] ;
int<lower=1,upper=nprotch> oprotch[N] ;
}
parameters{
real beta_pep[npep] ; // pep effect
vector[2] beta[nprotch] ; // channel/prot averages
corr_matrix[2] G;
real<lower=0> tau ; // peptide effect var
real<lower=0> sigma ; // experimental error
vector<lower=0>[2] bsds ; // random int and slope SD
real mu_pep ;
vector[2] mu_beta ;
}
model {
beta_pep ~ normal(0,10) ;
mu_pep ~ normal(0, 5) ;
mu_beta ~ normal(0,5) ;
bsds ~ cauchy(0, 2.5) ;
beta ~ multi_normal(mu_beta, quad_form_diag(G, bsds)) ;
for (i in 1:N)
y[i] ~ normal(beta_pep[opep[i]] + int_IS[opep[i]] * beta[oprotch[i]], sigma) ;
}
generated quantities {
vector[nprotch] ppred;
for (i in 1:nprotch)
ppred[i] = sum(beta[oprotch[i]]) ;
}