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

Problem with pbeta (qbeta) and AD #349

Open
bobdouma opened this issue Jun 3, 2021 · 0 comments
Open

Problem with pbeta (qbeta) and AD #349

bobdouma opened this issue Jun 3, 2021 · 0 comments

Comments

@bobdouma
Copy link

bobdouma commented Jun 3, 2021

Dear all,

I have encountered a problem with the use of pbeta along with random effects. I refer to the TMB google groups (topic "problem with pbeta() and random effects") for the identification process of the error. The problem arises with the use of pbeta that I want to use in the context of copula modelling.

the simplest example that can reproduce the error is a univariate model with with beta distributed error and a random effect on the intercept. I added pbeta by a little trick: call pbeta(y,s1,s2), subsequently qbeta(), and afterwards dbeta(). Whether it breaks depends on the data used. Proportions that are close to one or zero lead to an NA evaluation in the gradient. See attach for two subsets of the data (dataset1: values between 0.25 and 0.75 and dataset2 with values above 0.75 and below 0.25).
In fact if you only fit a model to two datapoints whose value are above 0.75 it breaks, and it works when it is below.

Cheers, Bob

pbeta_issue_simple.txt
pbeta_issue_simple_cpp.txt

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