Package: compositional.mle 2.0.1

Alexander Towell

compositional.mle: Compositional Maximum Likelihood Estimation

Provides composable optimization strategies for maximum likelihood estimation (MLE). Solvers are first-class functions that combine via sequential chaining, parallel racing, and random restarts. Implements gradient ascent, Newton-Raphson, quasi-Newton (BFGS), and derivative-free methods with support for constrained optimization and tracing. Returns 'mle' objects compatible with 'algebraic.mle' for downstream analysis. Methods based on Nocedal J, Wright SJ (2006) "Numerical Optimization" <doi:10.1007/978-0-387-40065-5>.

Authors:Alexander Towell [aut, cre]

compositional.mle_2.0.1.tar.gz
compositional.mle_2.0.1.zip(r-4.7-any)compositional.mle_2.0.1.zip(r-4.6-any)
compositional.mle_2.0.1.tar.gz(r-4.7-any)compositional.mle_2.0.1.tar.gz(r-4.6-any)
compositional.mle_2.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
compositional.mle/json (API)

# Install 'compositional.mle' in R:
install.packages('compositional.mle', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/queelius/compositional.mle/issues

Pkgdown/docs site:https://queelius.github.io

On CRAN:

Conda:

4.35 score 1 packages 9 scripts 342 downloads 38 exports 7 dependencies

Last updated from:451bbe5fbd. Checks:6 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develOK125
source / vignettesOK190
linux-releaseOK126
windows-develOK102
windows-releaseOK93
wasm-releaseOK97

Exports:%>>%%|%bfgschainclear_cachecomposecompose_transformscoordinate_ascentfisher_scoringget_fisherget_scoregradient_ascentgrid_searchis_convergedis_mle_constraintis_mle_problemis_solver_resultis_tracinglbfgsbmle_constraintmle_problemmle_tracenelder_meadnewton_raphsonnormal_samplernum_iterationsoptimization_pathpenalty_elastic_netpenalty_l1penalty_l2racerandom_searchsim_annealuniform_samplerunless_convergedwith_penaltywith_restartswith_subsampling

Dependencies:algebraic.distalgebraic.mlebootMASSmvtnormnumDerivR6

Designing Optimization Strategies
Introduction | The Problem: Why Composition? | Single Solver: Often Fails | Strategy 1: Coarse-to-Fine | Strategy 2: Multiple Restarts | Strategy 3: Racing Solvers | Strategy 4: Global + Local | Diagnosing Convergence | Extracting Trace Data | Benchmarking Strategies | Best Practices | 1. Start Simple, Add Complexity | 2. Use Domain Knowledge for Initialization | 3. Match Solver to Problem | 4. Monitor Convergence | Summary

Last update: 2026-03-19
Started: 2026-02-09

Getting Started with compositional.mle
Introduction | Installation | Quick Start: Normal Distribution MLE | The Problem-Solver Separation | Composing Solvers | Sequential Chaining (%>>%) | Three-Stage Refinement | Parallel Racing (%|%) | Random Restarts | Conditional Refinement | Available Solvers | Constraints | Function Transformers | Stochastic Gradient (Mini-batching) | Regularization | Tracing Optimization | API Summary

Last update: 2026-03-19
Started: 2026-02-09

The MLE Ecosystem
Introduction | Composing Solvers | The mle Result Object | Combining Independent MLEs | Hypothesis Testing with hypothesize | Creating tests from MLE results | Combining independent tests | The testing interface | Automatic Differentiation | The likelihood.model Bridge | The Ecosystem at a Glance

Last update: 2026-03-19
Started: 2026-02-09

Theory and Intuition Behind Numerical MLE
What is Maximum Likelihood Estimation? | The Likelihood Function | Why Log-Likelihood? | A Concrete Example | The Score Function | Intuition | Gradient Ascent | Why It Works | The Challenge: Choosing the Step Size | Line Search: Automatic Step Size Selection | The Fisher Information Matrix | Why It Matters | Observed vs Expected Fisher Information | Newton-Raphson | Comparison | Composing Solvers | When to Use Which Method | Constrained Optimization | Projection Method | Regularization and Penalized Likelihood | Penalized Log-Likelihood | Common Penalties | Summary | Further Reading

Last update: 2026-03-19
Started: 2026-02-09

Case Studies: MLE for Common Distributions
Introduction | Case Study 1: Exponential Distribution | Case Study 2: Gamma Distribution | Composing Solvers: Grid Search + Gradient Ascent | Case Study 3: Beta Distribution | Case Study 4: Weibull Distribution | Case Study 5: Mixture of Normals | Summary

Last update: 2026-02-09
Started: 2026-02-09

Readme and manuals

Help Manual

Help pageTopics
Sequential Solver Composition%>>%
BFGS Solverbfgs
Chain Solvers with Early Stoppingchain
Clear derivative cacheclear_cache
Compose Multiple Function Transformationscompose_transforms
Coordinate Ascent Solvercoordinate_ascent
Fisher Scoring Solverfisher_scoring
Get Fisher information function from problemget_fisher
Get score function from problemget_score
Gradient Ascent Solvergradient_ascent
Grid Search Solvergrid_search
Check if solver convergedis_converged
Check if object is an mle_constraintis_mle_constraint
Check if object is an mle_problemis_mle_problem
Check if object is a solver resultis_solver_result
Check if tracing is enabledis_tracing
L-BFGS-B Solver (Box Constrained)lbfgsb
Create domain constraint specificationmle_constraint
Create an MLE Problem Specificationmle_problem mle_problem.default mle_problem.likelihood_model print.mle_problem
Create a Trace Configurationmle_trace print.mle_trace
Nelder-Mead Solver (Derivative-Free)nelder_mead
Newton-Raphson Solvernewton_raphson
Normal Sampler Factorynormal_sampler
Get number of iterationsnum_iterations
Extract Optimization Path as Data Frameoptimization_path
Elastic net penalty (combination of L1 and L2)penalty_elastic_net
L1 penalty function (LASSO)penalty_l1
L2 penalty function (Ridge)penalty_l2
Plot Trace Data Directlyplot.mle_trace_data
Plot Optimization Convergenceplot.solver_result
Print MLE Trace Dataprint.mle_trace_data
Race Multiple Solversrace
Parallel Solver Racing (Operator)%|% race_operator
Random Search Solverrandom_search
Simulated Annealing Solversim_anneal
Uniform Sampler Factoryuniform_sampler
Conditional Refinementunless_converged
Update an mle_problemupdate.mle_problem
Add penalty term to log-likelihoodwith_penalty
Multiple Random Restartswith_restarts
Create stochastic log-likelihood with subsamplingwith_subsampling