This is a simple model:
art_model = "
data {
int<lower = 0, upper = 100> Y;
}
parameters {
real<lower = 0, upper = 1> pi;
}
model {
Y ~ binomial(100, pi);
pi ~ beta(4, 6);
}
"""
sample_art_model = SampleModel("artSim", art_model, tmpdir)
(I have already defined tmpdir)
Now, I want to sample 5000 warmups and 5000 samples out of this, but I cant.
data = (Y=14,)
art_sim = stan_sample(sample_art_model; data=data,num_warmups = 5000,
num_samples=5000, num_chains=4, seed = 84735, sig_figs=18)
if success(art_sim)
art_sim_summary = read_summary(sample_art_model, true)
art_sim_df = read_samples(sample_art_model, :dataframes)
art_sim_summary |> display
end
The vector w/ the samples, art_sim_df, does contain 4 dataframes, and each of them contains 5000 elements BUT 4000 of them are 0:
julia > [count(==(0.), art_sim_df[i].pi) for i in 1:4]
4-element Vector{Int64}:
4000
4000
4000
4000
I’ve also tried setting the num_sample param directly in the struct,
sample_art_model.num_samples = 5000
but to no avail.
It seems that the default value for num_samples (which is 1000) always prevails.
Any ideas what I am doing wrong?
Dim