You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
nobs = 50
original_mu = c(-15,15)
original_weights = c(1/2,1/2)
original_sd = rep(.2,2)
set.seed(9304)
x = c()
for(i in 1:nobs){
index = sample(1:length(original_mu),1,prob=original_weights)
x[i] = rnorm(1,original_mu[index],original_sd[index])
}
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
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):
The text was updated successfully, but these errors were encountered: