Parameters
Maturity: stable — see Feature Maturity for what this means.
The [parameters] block defines all model parameters: fixed effects (theta), between-subject variability (omega), and residual error (sigma).
Theta (Fixed Effects)
theta NAME(initial_value, lower_bound, upper_bound)
- NAME: Parameter name (used in
[individual_parameters]expressions) - initial_value: Starting value for estimation
- lower_bound: Lower bound constraint. Thetas with
lower_bound >= 0are log-transformed internally (so the optimiser seeslog(theta)); thetas withlower_bound < 0are estimated on the natural scale. This lets covariate exponents liketheta THETA_AGE_CL(-0.01, -1, 1)pass through unchanged while still allowing CL/V/KA to be positivity- constrained via the log transform. Edge case:lower_bound = 0.0still picks the log transform with an internal1e-10floor, so a parameter that genuinely needs to reach 0 should declare a small negativelower_bound(e.g.-1e-6) to switch to identity packing. - upper_bound: Upper bound constraint
Example:
theta TVCL(0.134, 0.001, 10.0)
theta TVV(8.1, 0.1, 500.0)
theta TVKA(1.0, 0.01, 50.0)
Omega (Between-Subject Variability)
Diagonal omega
omega NAME ~ value # value interpreted as variance (default)
omega NAME ~ value (sd) # value interpreted as standard deviation
omega NAME ~ value (variance) # explicit no-op equivalent to no annotation
- NAME: Random effect name (used in
[individual_parameters]asETA_XXX) - value: Initial value. Default scale is variance (the diagonal element of the omega matrix). Append
(sd)to specify a standard deviation instead — the parser squares it before storing. The optimizer always works on the variance scale internally.
Example (variance scale, default):
omega ETA_CL ~ 0.07
omega ETA_V ~ 0.02
omega ETA_KA ~ 0.40
Equivalent declaration using SD coding ((sd) annotation):
omega ETA_CL ~ 0.265 (sd) # ≡ ~ 0.0702
omega ETA_V ~ 0.141 (sd) # ≡ ~ 0.0200
omega ETA_KA ~ 0.632 (sd) # ≡ ~ 0.400
Each variance represents the between-subject variability for that parameter. The coefficient of variation (CV%) is approximately sqrt(variance) * 100 for log-normally distributed parameters. For example, omega ETA_CL ~ 0.09 corresponds to ~30% CV.
The (sd) form is convenient when you’re setting initial values from expected CV%, e.g. “I expect ~25% CV on CL” → omega ETA_CL ~ 0.25 (sd). The fit result records which form you used so that downstream printers can annotate the estimate with [initial specified as SD].
Block omega (block_omega (...) = [...]) is variance-only — (sd) is not accepted there because the lower-triangle list mixes variances and covariances and a single tag would be ambiguous.
No omega at all — fixed-effects-only (naive-pooled) fits
The omega block is optional. A model may declare no random effects, giving a fixed-effects-only (naive-pooled) fit in which every subject shares one set of parameters and sigma alone carries the spread:
[parameters]
theta TVCL(4.0, 0.1, 100.0)
theta TVV(40.0, 1.0, 500.0)
sigma PROP_ERR ~ 0.02 (sd)
[individual_parameters]
CL = TVCL
V = TVV
With n_eta = 0 there is no inner empirical-Bayes problem and no log|Ω| term, so FOCE/FOCEI collapse to the plain maximum-likelihood objective. PRED and IPRED coincide, and so do CWRES and IWRES. No OMEGA section is printed and no ETA columns are written to the sdtab. See examples/one_cpt_iv_pooled.ferx.
Useful for naive-pooled analyses, single-subject fits, reduced models where a variance component has collapsed to the boundary and should be removed rather than fixed near zero, and for isolating a diagnostic by removing the inner problem entirely.
sigma is still required. “No random effects” and “no residual error” are separate capabilities: a continuous endpoint has no likelihood without a sigma, so omitting the [error_model] or its sigma remains an error. (A pure [event_model] / [binary_model] endpoint legitimately has neither — that is a different case, not this one.)
Which estimators apply. foce, focei, laplace and gn_hybrid all reduce correctly and agree to the last printed digit — all four land on OFV −269.6370 on the anchor below. saem, imp, impmap and bayes are all rejected by ferx check before the fit starts (E_SAEM_NO_RANDOM_EFFECTS / E_METHOD_NO_RANDOM_EFFECTS, #1002 / #1007). Each of the four integrates over the random effects, and with none declared there is nothing to integrate.
gn is not recommended at n_eta = 0. Pure Gauss-Newton reduces correctly in principle, but its BHHH Hessian badly over-estimates curvature far from the optimum and there is no inner loop to keep it close. On this page’s own example it stops at OFV 8670 with Converged: NO and 6900% RSEs — a result that is wrong rather than merely imprecise. Use gn_hybrid, whose FOCEI polish recovers it, or focei. Since #1006 ferx check warns about the combination (W_GN_NO_RANDOM_EFFECTS), and a pure-GN run that ends unconverged at n_eta = 0 adds a warning saying the result may be wrong rather than imprecise. See Gauss-Newton — fixed-effects-only models.
Starting values matter more. Without random effects there is no inner loop to absorb a poor sigma start, so a start that a mixed-effects model shrugs off can stall a fixed-effects one. On examples/one_cpt_iv_pooled.ferx’s own 0.02 (sd) start gn does not converge within maxiter; from 0.13 (sd) it reaches the optimum. If a fixed-effects fit stalls, check sigma first.
For the NONMEM equivalent — and why simply omitting $OMEGA is not it — see the FAQ.
Declaration order
The order of omega and block_omega lines in the [parameters] block determines the ETA indexing throughout the model: in the omega matrix and all output. For example:
block_omega (ETA_CL, ETA_V) = [0.09, 0.02, 0.04]
omega ETA_KA ~ 0.40
produces ETA order [ETA_CL, ETA_V, ETA_KA] (indices 1, 2, 3), while:
omega ETA_KA ~ 0.40
block_omega (ETA_CL, ETA_V) = [0.09, 0.02, 0.04]
produces [ETA_KA, ETA_CL, ETA_V] (indices 1, 2, 3). The [individual_parameters] block should list assignments in the same order for clarity, though the parameter mapping is by name, not position.
Kappa (Inter-Occasion Variability)
Inter-Occasion Variability (IOV) is declared with kappa (independent per-parameter) or block_kappa (correlated across parameters). Kappa parameters must be paired with iov_column in [fit_options] and an occasion column in the dataset.
Diagonal kappa — Option A
kappa NAME ~ value # value interpreted as variance (default)
kappa NAME ~ value (sd) # value interpreted as standard deviation
kappa NAME ~ value FIX
kappa NAME ~ value weight = W # kappa ~ N(0, value / W) — sample-size-weighted IOV
Each kappa line adds one diagonal element to the IOV omega matrix. Occasions are independent. The (sd) annotation is accepted with the same semantics as for omega. block_kappa is variance-only.
The optional weight = <expr> modifier declares a sample-size-weighted kappa, κ ~ N(0, value / W) — the between-treatment-arm variability of a longitudinal MBMA, which scales with the number of subjects in the arm. See Sample-size-weighted IOV.
Example:
kappa KAPPA_CL ~ 0.05
kappa KAPPA_V ~ 0.03
kappa KAPPA_CL ~ 0.02 FIX
Using kappas in individual parameters
Reference kappa names exactly like BSV etas in [individual_parameters]:
[individual_parameters]
CL = TVCL * exp(ETA_CL + KAPPA_CL)
V = TVV * exp(ETA_V + KAPPA_V)
KA = TVKA * exp(ETA_KA) # no IOV on absorption
Kappas can be combined freely — a parameter can carry BSV only, IOV only, or both.
Mixed diagonal and block kappa
You can mix kappa (uncorrelated) and block_kappa (correlated) declarations in the same model:
block_kappa (KAPPA_CL, KAPPA_V) = [0.05, 0.01, 0.03]
kappa KAPPA_KA ~ 0.10
A name may not appear in both kappa and block_kappa — this is a parse error.
Declaration order
Kappa declaration order determines the IOV omega matrix layout and the kappa column order in output. Kappas follow all BSV etas in the internal indexing: if a model has 3 BSV etas and 2 kappas, the kappas sit at indices 4 and 5.
Parameter-level correlation in output
When a block_omega (or block_kappa) is estimated, ferx reports a parameter-level correlation for each off-diagonal pair in the console and YAML output. This differs from the eta-level (normal-scale) correlation ω_ij / √(ω_ii · ω_jj):
Both etas lognormal (THETA * exp(ETA)) |
(exp(ω_ij) − 1) / √((exp(ω_ii) − 1)(exp(ω_jj) − 1)) |
|---|---|
Both etas additive (THETA + ETA) |
ω_ij / √(ω_ii · ω_jj) (same as eta-level) |
| Mixed or complex expressions | Falls back to eta-level; a warning is added to FitResult.warnings |
The formula for lognormal pairs is the standard bivariate lognormal identity and reflects the correlation between the actual PK/PD parameters (e.g. CL and V) rather than their underlying normal variates.
The result is exposed as FitResult.omega_param_corr (BSV) and FitResult.omega_iov_param_corr (IOV), and is used wherever ferx prints a corr or correlation value for a block omega pair.
Sigma (Residual Error)
sigma NAME ~ value # value interpreted as variance (default)
sigma NAME ~ value (sd) # value interpreted as standard deviation
sigma NAME ~ value (variance) # explicit no-op equivalent to no annotation
- NAME: Residual error parameter name (referenced in
[error_model]) - value: Initial value. Default scale is variance, matching omega. Append
(sd)to specify a standard deviation; the parser converts it to the internal representation. This unifies the user-facing scale across omega and sigma — see issue #56.
Example (variance scale, default):
sigma PROP_ERR ~ 0.0004 # variance 0.0004 → SD = 0.02 → 2% CV
sigma ADD_ERR ~ 1.0 # variance 1.0 → SD = 1.0
Equivalent declarations using SD coding:
sigma PROP_ERR ~ 0.02 (sd)
sigma ADD_ERR ~ 1.0 (sd)
The interpretation of sigma’s role in the residual-error model depends on the error model:
| Error Model | Sigma component |
|---|---|
| Additive | Variance (or SD with (sd)) of additive error |
| Proportional | Variance (or SD with (sd)) of the proportional coefficient |
| Combined | First sigma = proportional coefficient, second = additive component |
For a single-endpoint [error_model] (“first” and “second” above) these roles are read from the [parameters] declaration order, and the names written in the [error_model] arguments must match that order — a mismatch is rejected with E_SIGMA_ORDER_MISMATCH. Per-CMT and covariate-selected error models bind by name instead. See Sigma order.
Migration note (pre-issue-#56 models):
sigma NAME ~ valuewas previously interpreted as a standard deviation. The new default is variance, so a pre-#56 valuevbecomes eitherv² (variance)orv (sd). Theexamples/directory uses the(sd)form to preserve the prior initial values verbatim.
Complete Examples
Diagonal omega (no correlations):
[parameters]
theta TVCL(0.134, 0.001, 10.0)
theta TVV(8.1, 0.1, 500.0)
theta TVKA(1.0, 0.01, 50.0)
omega ETA_CL ~ 0.07
omega ETA_V ~ 0.02
omega ETA_KA ~ 0.40
sigma PROP_ERR ~ 0.01
Block omega (correlated CL and V):
[parameters]
theta TVCL(0.134, 0.001, 10.0)
theta TVV(8.1, 0.1, 500.0)
theta TVKA(1.0, 0.01, 50.0)
block_omega (ETA_CL, ETA_V) = [0.09, 0.02, 0.04]
omega ETA_KA ~ 0.40
sigma PROP_ERR ~ 0.01