Skip to content

Fit returns an all-NaN state with a converged flag (flag 2) #532

Description

@matthewholman

Corrected. The original report claimed sequence prediction was ~100x slower than the fit. That measurement was invalid: the fit it was compared against had returned an all-NaN state, so the prediction code was being asked to integrate relative to an undefined epoch. Predicting on valid fits is fine -- 288 objects went through _predict without trouble. There is no performance bug here. Apologies for the noise.

The real problem is what produced that state.

Fitting 4,172 optical observations of (13377) over a 1989-2026 arc, seeded from its MPCORB elements, returns:

flag 2, csq 1.65e9, ndof 8338          (reduced chi-square ~197,000)
epochMJD_TDB   nan
x, y, z        nan
xdot,ydot,zdot nan
cov_0_0        nan

Flag 2 is FLAG_CSQ_TOO_LARGE, "converged; reduced chi-square above threshold", and it is a member of CONVERGED_FLAGS. So a fit whose entire state vector is NaN is reported to callers as converged. Anything that branches on CONVERGED_FLAGS -- or that reads the state without testing it -- consumes it silently. Feeding it to predict is what sent the integrator off, which is how I found it.

Two things worth separating: whether the fit should diverge here at all (a catalogue seed on a well-observed numbered object), and whether a NaN state should ever leave the fitter wearing a converged flag. The second seems worth a guard regardless of the first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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