Skip to content

getCyclopsProfileLogLikelihood crashes when all slope values are NA #76

@azimov

Description

@azimov

PR incoming that is a potential solution but it appears to fail unit tests so this likely requires a deeper understanding of the function that I have.

This error occurs in getCyclopsProfileLogLikelihood when a model is IllConditioned:

Message:  missing value where TRUE/FALSE needed

(Apologies for lack of details, getting a full stack trace out of a Strategus run takes time).

Upon live debugging it appears to be this line:

if (resetsPerformed < maxResets && !all(slopes[2:length(slopes)] < slopes[1:(length(slopes)-1)])) {

Live debugging shows that the Model is illconditioned and all values of slopes are NA(presumably because of the gradient calculations on the lines above).

I will try to get a reproducible example but my quick tests of the PR branch appear to show that this is because of all being called on a vector of NAs. A better solution may be more pre-validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions