Repository navigation
Conversation
Add four sets of maximum likelihood benchmark problems on simulated data: likelihood_small and likelihood_large (correctly specified, 3-25 and 25-150 params) and likelihood_misspecified_small and likelihood_misspecified_large (tiny to severe misspecification). Each instance has a good and a bad start. All problems minimize the negative log-likelihood and provide closed form jacobians of the contributions; some have bounds. Data are simulated from uniform draws via inverse CDFs, so they are stable across NumPy versions. Reference solutions are stored in solutions.py and created by .tools/create_likelihood_solutions.py. run_benchmark now sums likelihood contributions instead of treating them as least-squares residuals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
optimagic's benchmark sets (More-Wild, Cartis-Roberts) are least-squares problems. There is no set to benchmark optimizers for maximum likelihood estimation (e.g. the planned rewrite of
bhhh) on realistic likelihoods, including misspecified models, bad start values and bounds.Changes
Four new sets in
get_benchmark_problems:likelihood_smalllikelihood_largelikelihood_misspecified_smalllikelihood_misspecified_large18 econometric models on simulated data (
optimagic.benchmarking.likelihood.models): logit, probit, Poisson, fixed effects Poisson, negative binomial, zero inflated Poisson, heteroskedastic linear regression, Tobit, gamma regression, stochastic frontier, ordered probit, multinomial logit, Weibull duration, multivariate normal, GARCH(1, 1), random effects probit, mixed logit (simulated likelihood), normal mixture and Heckman selection. Models are reused with different numbers of params.Each instance has a good start (what a practitioner would choose) and a bad start (far from the solution, finite criterion).
All problems minimize the negative log-likelihood and provide closed form jacobians of the contributions, passed as
jac=[gradient, jacobian]so that scalar and likelihood optimizers both get exact derivatives. Some problems have natural bounds; some solutions lie on a bound. With noise, the closed form derivatives are dropped.The misspecified sets range from tiny to severe misspecification: over- and underdispersed counts, t errors, misclassified outcomes, IIA violations, neglected frailty, multivariate t data, ignored heteroskedasticity and more.
infoholds the severity, the eigenvalue range of inv(H) @ OPG at the solution (one in the population for correctly specified models) and whether the reference computation found other local optima.Data are simulated from uniform draws via inverse CDFs, so they do not depend on NumPy's distribution algorithms; a test pins the random stream.
Reference solutions are stored in
solutions.pyand created by.tools/create_likelihood_solutions.py(L-BFGS-B from several starts, then projected Newton steps). Tests check that the stored values are reproduced and that the solutions satisfy the optimality conditions.run_benchmarksummed squared likelihood contributions as if they were least-squares residuals; it now sums them.A paragraph on the new sets in the benchmarking how-to.
Checks
🤖 Generated with Claude Code