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

error in OneStepGeneric method of TMB::oneStepPredict #366

Open
timjmiller opened this issue Aug 17, 2022 · 0 comments
Open

error in OneStepGeneric method of TMB::oneStepPredict #366

timjmiller opened this issue Aug 17, 2022 · 0 comments

Comments

@timjmiller
Copy link

Description:

This is not likely to happen, but if a value of an unused parameter is NaN, then factor(NaN*NA) here does not produce the right input for the map argument of MakeADFun.

I copied and edited validation.R and tmbprofile.R to deduce where the the map list element for the unused parameter was changed.

Reproducible Steps:

  1. Make input initial parameter list with a value = log(-1) for an unused parameter.
  2. Fit model
  3. run TMB::oneStepPredict(method="oneStepGeneric").

Current Output:

Error in if (xnext + that < parm.range[1]) { :
missing value where TRUE/FALSE needed

(repeated for each observation)

Expected Output:

Normal execution of TMB:oneStepPredict: return data.frame with calculated residuals.

Possible Solution:

change referenced line to
map <- lapply(args$parameters[fix], function(x)factor(rep(NA,length(x))))

TMB Version:

1.9.1, commit = e499559

R Version:

R version 4.1.3 (2022-03-10)

Operating System:

Windows 10

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