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

exp(eta[obs]) exceeds .Machine$double.xmax #14

Open
brooksambrose opened this issue Apr 3, 2024 · 1 comment
Open

exp(eta[obs]) exceeds .Machine$double.xmax #14

brooksambrose opened this issue Apr 3, 2024 · 1 comment

Comments

@brooksambrose
Copy link

brooksambrose commented Apr 3, 2024

I am experiencing an error in a call to ergmm using a nodecov term.

Error in optim(par = start.vals, fn = optim.fs[["f"]], gr = optim.fs[["grad.f"]], : L-BFGS-B needs finite values of 'fn'

Where I tracked it down to latentnet:::ergmm.lpY and specifically this line

lpY<-if(up.to.const) lpYc.fs[[model[["familyID"]]]](Ym[obs],eta[obs],dispersion=theta[["dispersion"]],model[["fam.par"]]) else lpY.fs[[model[["familyID"]]]](Ym[obs],eta[obs],dispersion=theta[["dispersion"]],model[["fam.par"]])

That list returns a function that is a formula Y * eta - exp(eta) and at least one value in my eta exceeds .Machine$double.xmax when exponentiated. I'm not familiar enough with the method to know what eta is exactly, but on my machine the largest integer that can be exponentiated is exp(709) before it returns Inf. In my data the largest value for eta was 6842.

The call would complete if I rescaled the original data to be in a range about 100 times smaller than the original.

@krivit
Copy link
Member

krivit commented Apr 3, 2024

Thanks for the report! Can you please provide a reproducible example?

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

2 participants