Open MarcoGallegos34 opened 4 months ago
Hi -- it looks like you are passing an invalid constrained sample
Hi, thanks for your prompt reply. If I understand correctly, setting N = 2, would a code like this work? There's no need to indicate that I'm using this explorer in the explorer argument in the function pt(), correct?
function Pigeons.sample_iid!(
log_potential::StanLogPotential{M, S, D, StanUnidentifiableExample}, replica, shared) where {M, S, D}
## sample in constrained space ##
# sampling from unit simplex for N = 2
x_new = -log.(rand(replica.rng,2))
norm_const = sum(x_new)
x_final = x_new ./ norm_const
# sampling for mu and sd_cluster parameters #
constrained = rand(replica.rng,4)
full_constrained = vcat(constrained,x_final)
# transform to unconstrained space
replica.state.unconstrained_parameters .= BridgeStan.param_unconstrain(log_potential.model, full_constrained)
end
Thanks
Hello,
I'm trying to use the Pigeons software with a Stan model as input. However, while following the steps in the Stan model as input to pigeons section of the Pigeons.jl documentation, I encountered the following issue:
My guess is that the sampling procedure may not be appropriate given the parameter constraints of my model. I'm not sure about this and don't know where to look for different sampling functions. I'm new to Julia, so I don't know many of the packages. Is there any package or documentation you could recommend for me to look at?
Data is generated in the following way using R:
Stan code (gaussian mixture model):