Operating System: Sierra 10.12.6
Interface Version: pystan
Compiler/Toolkit: 2.17.0.0
Everything installed from anaconda.
I’m trying to get any example with integrate_ode_rk45 to work, and have come up with the minimal example below. It seems to run - I get the terminal message:
Iteration: 20 / 20 [100%] (Sampling)
Elapsed Time: 34.4267 seconds (Warm-up)
0.621933 seconds (Sampling)
35.0487 seconds (Total)
but the sampling command never returns, and I get multiprocessing errors when I do the KeyboardInterrupt.
any ideas?
import pystan
model_code="""
functions {
real[] sho(real t, real[] y, real[] theta, real[] x_r, int[] x_i) {
real dydt[2];
dydt[1] = y[2];
dydt[2] = -y[1] - theta[1] * y[2];
return dydt;
}
}
transformed data {
int<lower=1> T = 10;
real t0 = 0;
real ts[T] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10.};
real y[T,2] = { {0.397095, -0.853654},
{-0.300526, -0.696679},
{-0.948297, 0.0545529},
{-0.57433, 0.634292},
{-0.00316177, 0.772725},
{0.675424, 0.15645},
{0.703672, -0.424857},
{-0.0918871, -0.487648},
{-0.469737, -0.298427},
{-0.429309, 0.16981} };
real x[0];
int x_int[0];
}
parameters {
real y0[2];
vector<lower=0>[2] sigma;
real theta[1];
}
model {
real y_hat[T,2];
sigma ~ cauchy(0,2.5);
theta ~ normal(0,1);
y0 ~ normal(0,1);
y_hat = integrate_ode_rk45(sho, y0, t0, ts, theta, x, x_int);
for (t in 1:T)
y[t] ~ normal(y_hat[t], sigma);
}
"""
# In[3]:
sm = pystan.StanModel(model_code=model_code)
# In[5]:
fit=sm.sampling(iter=20)