StanSample.jl can't find cmdstan?

So I think I have figured out the short term solution, though I am unsure how it will affect working directories and Julia environments.

I run

> conda activate stan-env
> julia
julia> using StanSample, DataFrames
julia>  model = "
data { 
 int<lower=0> N; 
 int<lower=0,upper=1> y[N];
} 
parameters {
 real<lower=0,upper=1> theta;
} 
model {
 theta ~ beta(1,1);
   y ~ bernoulli(theta);
}
";
julia> sm = SampleModel("bernoulli", model);
julia> data = Dict("N" => 10, "y" => [0, 1, 0, 1, 0, 0, 0, 0, 0, 1]);
julia> rc = stan_sample(sm; data, num_threads=1);
julia> if success(rc)
 df = read_samples(sm, :dataframe);
 df |> display
end

I don’t run into any errors this way.

1 Like