Skip to content

User-friendly errror messages for prob macro #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
awellis opened this issue Jun 15, 2020 · 1 comment
Closed

User-friendly errror messages for prob macro #135

awellis opened this issue Jun 15, 2020 · 1 comment

Comments

@awellis
Copy link

awellis commented Jun 15, 2020

I tried to obtain the point-wise likelihood for a model containing a predictor variable:

@model AnovaModel(y, group) = begin
    n_groups = length(unique(group))

    σ ~ truncated(Cauchy(0, 3), 0, Inf)
    α ~ filldist(Normal(0, 10), n_groups)
    μ = α[group]
    @. y ~ Normal(μ, σ)
end

chain = sample(AnovaModel(y, group), NUTS(), 2000, save_state = true)

but I forgot to include the predictor on the right-hand side:

logprob"y = y | chain = chain"

instead of

logprob"y = y | group = group, chain = chain"

The following error message is not very helpful: ERROR: AssertionError: all(valid_arg, getargnames(modelgen)).
Maybe the user could be encouraged to add the missing predictors, or could they be conditioned on by default?

@yebai
Copy link
Member

yebai commented Dec 16, 2021

Closed in favour of #356

@yebai yebai closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants