Skip to content

FAQ/SUMM Design: What is the policy for estimation failures running many cases? #3520

Open

Description

@josef-pkt

When we run many estimation problems in a loop, then it is possible that an estimation case does not work. In the loop we often don't want to stop if an exception or estimation failure occurs.

What is the general policy or what are the recommendations for this case?

the location where something can go wrong

  • problems with the data like missing values or singular exog, or possibly also dtype issues
  • optimization: convergence failure
  • missing hessian, hessian not positive (semi-) definite
  • other missing results (not clear if there are any)

Currently we don't have a general policy and stable API for many cases. Decisions are mostly case specific.
We refactored exceptions and warnings to be more specific, but unit test coverage for those is relatively low, and not guarantee yet that the exception or warning classes that are raised at specific failures are part of the stable API. Some should be.

How do we detect a failure:

  • exceptions
  • flags, attributes (with or without warning): e.g. coverged boolean, rank of exog or cov_params
  • result not available (with or without warning): e.g. properties that are None or np.nan

How do we work around a failure:

  • up to user: e.g. problems with data, insufficient data cleaning, better start_params
  • inside statsmodels
    • work around missing results, e.g. protect summary, BUG: Handle non-invertible hessian from GLM scipy optimizers #3299 summary breaks if hessian is None
    • try harder to avoid exceptions, e.g. should we switch to OPG if hessian is not invertible, or should we regularize (pinv) as in linear regression models, more improvements to optimization like endogenous switching of algorithm
    • catch exceptions: a loop where we already to this is in the lag-search in ARIMA type models.

Can we identify the source of the failure:

  • Are the messages from warnings or exceptions informative enough?
  • diagnostics after failures ?
  • general diagnostics for "validity", e.g. stricter convergence check including zero gradient, multicollinearity diagnostics, special case in tsa for stationarity assumption (e.g. exceptions or convergence failures in ARMA)

see sanity checks, possible transformations of data, general diagnostic checks.

Activity

  1. josef-pkt commented on Feb 28, 2017

    @josef-pkt
    MemberAuthor

    We would need more SMEPs, largely written ex-post to summarize some overall design decisions.
    Currently, it has all been spread over issues, and the SMEPs in the wiki are ignored and outdated.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions