Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
fix Exponential priors (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli authored Jan 23, 2023
1 parent ffa581d commit fcc9d21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions _literate/11_multilevel_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ setprogress!(false) # hide
#priors
α ~ Normal(mean(y), 2.5 * std(y)) # population-level intercept
β ~ filldist(Normal(0, 2), predictors) # population-level coefficients
σ ~ Exponential(1 / std(y)) # residual SD
σ ~ Exponential(std(y)) # residual SD
#prior for variance of random intercepts
#usually requires thoughtful specification
τ ~ truncated(Cauchy(0, 2); lower=0) # group-level SDs intercepts
Expand Down Expand Up @@ -141,7 +141,7 @@ end;
@model function varying_slope(X, idx, y; n_gr=length(unique(idx)), predictors=size(X, 2))
#priors
α ~ Normal(mean(y), 2.5 * std(y)) # population-level intercept
σ ~ Exponential(1 / std(y)) # residual SD
σ ~ Exponential(std(y)) # residual SD
#prior for variance of random slopes
#usually requires thoughtful specification
τ ~ filldist(truncated(Cauchy(0, 2); lower=0), n_gr) # group-level slopes SDs
Expand Down Expand Up @@ -183,7 +183,7 @@ end;
)
#priors
α ~ Normal(mean(y), 2.5 * std(y)) # population-level intercept
σ ~ Exponential(1 / std(y)) # residual SD
σ ~ Exponential(std(y)) # residual SD
#prior for variance of random intercepts and slopes
#usually requires thoughtful specification
τₐ ~ truncated(Cauchy(0, 2); lower=0) # group-level SDs intercepts
Expand Down
4 changes: 2 additions & 2 deletions _literate/12_Turing_tricks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ chain_ncp_funnel = sample(ncp_funnel(), NUTS(), MCMCThreads(), 1_000, 4)
#priors
α ~ Normal(mean(y), 2.5 * std(y)) # population-level intercept
β ~ filldist(Normal(0, 2), predictors) # population-level coefficients
σ ~ Exponential(1 / std(y)) # residual SD
σ ~ Exponential(std(y)) # residual SD
#prior for variance of random intercepts
#usually requires thoughtful specification
τ ~ truncated(Cauchy(0, 2); lower=0) # group-level SDs intercepts
Expand All @@ -212,7 +212,7 @@ end;
#priors
α ~ Normal(mean(y), 2.5 * std(y)) # population-level intercept
β ~ filldist(Normal(0, 2), predictors) # population-level coefficients
σ ~ Exponential(1 / std(y)) # residual SD
σ ~ Exponential(std(y)) # residual SD

#prior for variance of random intercepts
#usually requires thoughtful specification
Expand Down

0 comments on commit fcc9d21

Please sign in to comment.