I think there is a bug (or a strange error message) when specifying num_chains=x
with x>1
and additionally init=inits.json
What works
Bernoulli example:
./bernoulli sample num_chains=1 data file=bernoulli.data.json init=theta_inits.json
with theta_inits.json
:
{
"theta": [0.5]
}
This also works:
./bernoulli sample num_chains=4 data file=bernoulli.data.json init=10
What DOESN’T work
./bernoulli sample num_chains=4 data file=bernoulli.data.json init=theta_inits.json
I get the error message:
file ending of .json is not supported by cmdstan
Which is a bit strange since in the docs it says .json
is basically the only extension that is supported (besides Rdump, but I don’t really know how that works).
I tried for theta_inits.json
{
"theta": [0.5]
}
and
{
{
"theta": [0.5]
},
{
"theta": [0.5]
},
{
"theta": [0.5]
},
{
"theta": [0.5]
}
}
Is this a bug or do I just not know how to make multi-chain inits work with a json file?
Here is the full error output:
method = sample (Default)
sample
num_samples = 1000 (Default)
num_warmup = 1000 (Default)
save_warmup = 0 (Default)
thin = 1 (Default)
adapt
engaged = 1 (Default)
gamma = 0.050000000000000003 (Default)
delta = 0.80000000000000004 (Default)
kappa = 0.75 (Default)
t0 = 10 (Default)
init_buffer = 75 (Default)
term_buffer = 50 (Default)
window = 25 (Default)
algorithm = hmc (Default)
hmc
engine = nuts (Default)
nuts
max_depth = 10 (Default)
metric = diag_e (Default)
metric_file = (Default)
stepsize = 1 (Default)
stepsize_jitter = 0 (Default)
num_chains = 4
id = 1 (Default)
data
file = bernoulli.data.json
init = theta_inits_1.json
random
seed = 727596610 (Default)
output
file = output.csv (Default)
diagnostic_file = (Default)
refresh = 100 (Default)
sig_figs = -1 (Default)
profile_file = profile.csv (Default)
num_threads = 1 (Default)
file ending of .json is not supported by cmdstan