Skip to content
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

case of bad error trapping for redefined variable in model #1526

Open
paciorek opened this issue Feb 2, 2025 · 0 comments
Open

case of bad error trapping for redefined variable in model #1526

paciorek opened this issue Feb 2, 2025 · 0 comments

Comments

@paciorek
Copy link
Contributor

paciorek commented Feb 2, 2025

We should be doing a better job error trapping here.

 code <- nimbleCode({
    for(i in 1:5) {
        y[i] ~ dnorm(b0+x[i]*b1, sd = sigma[i])
                                        # log(sigma[i]) <- a0 + a1*x[i]
        sigma[i] <- exp(a0+a1*x[i])
    }
    sigma~dhalfflat()
    b1~dnorm(0,1)
    b0~dnorm(0,1)
    a1~dnorm(0,1)
    a0~dnorm(0,1)
})

model=nimbleModel(code,data=list(y=rep(0,5)))
Defining model
Error in 1:dims[1] : argument of length 0
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

1 participant