Skip to content

Problem with pbeta (qbeta) and AD #349

@bobdouma

Description

@bobdouma

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions