Fit Options

The optional [fit_options] block configures the estimation method and optimizer settings.

Syntax

[fit_options]
  key = value

General Options

KeyValuesDefaultDescription
methodfoce, focei, saemfoceEstimation method
maxiterinteger500Maximum outer loop iterations
covariancetrue, falsetrueCompute covariance matrix and standard errors
optimizerslsqp, lbfgs, nlopt_lbfgs, mma, bfgsslsqpOptimization algorithm
global_searchtrue, falsefalseRun gradient-free pre-search before local optimization
global_maxevalintegerautoMax evaluations for global search
bloq_methoddrop, m3dropHow to handle rows with CENS=1. m3 enables Beal's M3 likelihood (see BLOQ example).

Estimation Methods

FOCE (default)

method = foce

First-Order Conditional Estimation. Linearizes the model around the empirical Bayes estimates. Fast and reliable for most models.

FOCEI

method = focei

FOCE with Interaction. Includes the dependence of the residual error on random effects. More accurate than FOCE when the error model depends on individual predictions, but slightly slower.

SAEM

method = saem

Stochastic Approximation EM. Uses Metropolis-Hastings sampling instead of MAP optimization for random effects. More robust to local minima; recommended for complex models with many random effects.

SAEM-Specific Options

KeyDefaultDescription
n_exploration150Phase 1 iterations (step size = 1)
n_convergence250Phase 2 iterations (step size = 1/k)
n_mh_steps3Metropolis-Hastings steps per subject per iteration
adapt_interval50Iterations between MH step-size adaptation
seed12345RNG seed for reproducibility

SIR (Sampling Importance Resampling)

SIR provides non-parametric parameter uncertainty estimates as an optional post-estimation step. Requires covariance = true.

KeyDefaultDescription
sirfalseEnable SIR uncertainty estimation
sir_samples1000Number of proposal samples (M)
sir_resamples250Number of resampled vectors (m)
sir_seed12345RNG seed for reproducibility

See SIR documentation for details.

Optimizer Choices

OptimizerDescriptionRecommended For
slsqpSequential Least Squares Programming (NLopt)General use (default)
bfgsBuilt-in BFGS quasi-NewtonWhen NLopt is unavailable
lbfgsLimited-memory BFGSLarge parameter spaces
nlopt_lbfgsNLopt L-BFGSAlternative L-BFGS
mmaMethod of Moving Asymptotes (NLopt)Constrained problems

Setting global_search = true runs a gradient-free pre-search (NLopt CRS2-LM) before the local optimizer. This helps escape local minima on challenging datasets.

The number of global evaluations is auto-scaled based on the number of parameters and observations, or can be set explicitly with global_maxeval.

Examples

Standard FOCE with defaults:

[fit_options]
  method     = foce
  maxiter    = 300
  covariance = true

FOCEI with global search:

[fit_options]
  method        = focei
  maxiter       = 500
  covariance    = true
  global_search = true

SAEM with custom settings:

[fit_options]
  method        = saem
  n_exploration = 200
  n_convergence = 300
  n_mh_steps    = 5
  seed          = 42
  covariance    = true

FOCEI with SIR uncertainty:

[fit_options]
  method        = focei
  covariance    = true
  sir           = true
  sir_samples   = 1000
  sir_resamples = 250
  sir_seed      = 42