Skip to content

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

@brooksambrose

Description

@brooksambrose

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.

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