Tutorials › Pharmacometric Workflows and Reproducible Modeling › Transferring Monolix Parameters into mrgsolve

Software Landscape and Interoperability · Tutorial 217 of 399

Transferring Monolix Parameters into mrgsolve

Map Monolix estimates and random effects into mrgsolve, and verify the translation with matched concentration-time calculations and simulations.

Intermediate 10 min read

What You'll Learn

  • Distinguish Monolix population estimates from random-effect standard deviations and variances.
  • Translate lognormal and normal individual-parameter models into mrgsolve expressions.
  • Convert random-effect standard deviations and correlations into an mrgsolve covariance matrix.
  • Check parameter names, units, model equations, and dose semantics before comparing profiles.
  • Separate a matched individual profile from a population simulation with newly drawn random effects.
  • Diagnose common causes of discrepancies in cross-tool simulations.

Why the Transfer Requires More Than Copying Estimates

A Monolix estimate is not ready for mrgsolve merely because both programs use a parameter called \(CL\). A valid transfer must preserve what each estimate represents: its population scale, units, random-effect distribution, and position in the model. It must also preserve the structural equations and dosing assumptions that turn parameters into concentrations. Copying a random-effect standard deviation into a field that expects a variance, for example, changes the simulated variability even when the typical parameter is unchanged.

The earlier material on Monolix results and exports covers where estimates are reported. Here the task is to translate those results into mrgsolve inputs and expressions, then check the translation using an explicitly matched model and profile.

Definition: A parameter transfer is a mapping from an estimated model in one software system to an implemented model in another. A successful transfer preserves parameter meanings, units, transformations, random-effect distributions and covariance, structural equations, and relevant dosing and observation conventions. A matched profile is a concentration-time profile calculated under the same model, parameter values, individual effects, dose, and observation times in both implementations.

State the Random-Effect Model Before Mapping It

Suppose a positive parameter such as clearance is modeled as lognormal in Monolix. A common specification is

$$ CL_i=TVCL\exp(\eta_{CL,i}), \qquad \eta_{CL,i}\sim N(0,\omega_{CL}^{2}). $$

Here \(TVCL\) is the typical population value, and \(\omega_{CL}\) is the standard deviation of the normally distributed random effect on the log scale. It is not the variance. The individual parameter is positive because the exponential is positive. In mrgsolve, the corresponding expression is typically written as \(TVCL\exp(ETA(1))\); the variance supplied for that random effect must be \(\omega_{CL}^{2}\).

For a normal parameter model, the corresponding form is \(CL_i=TVCL+\eta_{CL,i}\). This does not guarantee positive individual clearances. If positivity is essential, use the transformation specified by the fitted model rather than silently switching between normal and lognormal forms.

With multiple random effects, the vector of effects has a covariance matrix. If Monolix reports standard deviations \(\omega_j\) and pairwise correlations \(\rho_{jk}\), the covariance is \(\Omega_{jk}=\rho_{jk}\omega_j\omega_k\), with diagonal elements \(\Omega_{jj}=\omega_j^2\). mrgsolve’s random-effect specification must represent that covariance, and the indexing of each `ETA` must agree with the expressions that use it.

Worked Example: Converting Monolix Random-Effect Estimates

Suppose a hypothetical Monolix fit gives \(TVCL=5.00\) L/h and \(TVV=50.0\) L. Both parameters are lognormal. The reported random-effect standard deviations are \(\omega_{CL}=0.200\) and \(\omega_V=0.300\), with correlation \(0.250\). Map these quantities to mrgsolve’s random-effect covariance.

The diagonal variances are the squared standard deviations:

$$ \operatorname{Var}(\eta_{CL})=0.200^2=0.0400,\qquad \operatorname{Var}(\eta_V)=0.300^2=0.0900. $$

The covariance is the correlation multiplied by both standard deviations:

$$ \operatorname{Cov}(\eta_{CL},\eta_V) =0.250(0.200)(0.300)=0.0150. $$

Thus the covariance matrix to represent in mrgsolve is

$$ \Omega= \begin{pmatrix} 0.0400 & 0.0150\\ 0.0150 & 0.0900 \end{pmatrix}. $$

The individual parameters are \(CL_i=5.00\exp(ETA(1))\) and \(V_i=50.0\exp(ETA(2))\), assuming the first random effect is assigned to clearance and the second to volume. The population values retain units of L/h and L, respectively; the random effects and their covariance are on the dimensionless log scale. As a basic check, the determinant is \(0.0400(0.0900)-0.0150^2=0.003375>0\), consistent with a positive-definite two-parameter covariance matrix.

Map Names, Equations, and Units Together

Do not treat the mapping as a list of numbers alone. Make an explicit correspondence between every Monolix parameter and the mrgsolve symbol or expression that uses it. For each entry, record its meaning, unit, population estimate, random-effect form, and any transformation. For example, if Monolix defines elimination rate as \(k=CL/V\), the mrgsolve model should calculate the same quantity from clearance and volume; it should not use a separately copied rate unless the fitted model actually estimated that rate.

For an oral one-compartment model with first-order absorption and elimination, a typical structural specification is \(dA_g/dt=-k_aA_g\), \(dA_c/dt=k_aA_g-(CL/V)A_c\), and \(C=A_c/V\), where \(A_g\) and \(A_c\) are gut and central amounts. The units must agree: \(k_a\) and \(CL/V\) have units of inverse time, and dividing central amount by \(V\) gives concentration. The same definition of bioavailability, absorption, and concentration must be used in both implementations.

Worked Example: A Deterministic Oral Concentration Check

Consider a hypothetical one-compartment oral model with dose \(D=100\) mg, bioavailability \(F=1\), \(k_a=1.20\) h\(^{-1}\), \(CL=5.00\) L/h, and \(V=50.0\) L. Assume first-order absorption, first-order elimination, no lag time, and no random effects for this calculation. The elimination rate is \(k=CL/V=5.00/50.0=0.100\) h\(^{-1}\). For \(k_a\ne k\), the concentration after a single dose is

$$ C(t)=\frac{F D k_a}{V(k_a-k)} \left[\exp(-kt)-\exp(-k_at)\right]. $$

At \(t=1.00\) h, substitute the values, retaining the exponential values with adequate precision:

$$ \begin{aligned} C(1) &=\frac{(1)(100\ \mathrm{mg})(1.20\ \mathrm{h}^{-1})} {(50.0\ \mathrm{L})(1.20-0.100)\ \mathrm{h}^{-1}} \left[\exp(-0.100)-\exp(-1.20)\right]\\ &=2.181818\ \mathrm{mg/L}\,(0.9048374-0.3011942)\\ &=1.317\ \mathrm{mg/L}. \end{aligned} $$

This value is a check on the structural model, units, and dose interpretation, not evidence that a stochastic population simulation must return exactly 1.317 mg/L for every individual. In mrgsolve, the oral dose must enter the absorption compartment, the central concentration must be amount divided by volume, and the parameter values and time units must match those used in the calculation.

From a Matched Individual to a Population Simulation

There are two useful checks, and they answer different questions. A deterministic matched-individual check uses the same fixed random effects in both implementations, often all zero for a typical individual. A population simulation draws random effects from the transferred distribution. The second check can differ between runs because the random draws differ; it is not a direct point-by-point test of the structural translation unless the same draws are deliberately supplied to both tools.

Before simulating, verify the assumptions that make the comparison meaningful: the structural model is the same; estimates are on the same scale; units and time units agree; the random-effect distribution and covariance are represented correctly; and the dose record, route, bioavailability, and observation times have the same meaning. Residual error should be included only if the comparison is intended to include observation-level variability. To compare predicted concentrations, it is usually clearer to compare predictions without adding different residual-error draws.

Worked Example: Checking Typical-Individual Parameters

Use the hypothetical estimates \(TVCL=5.00\) L/h, \(TVV=50.0\) L, and \(k_a=1.20\) h\(^{-1}\) from the oral model. For a typical individual under the lognormal model, set both random effects to zero. Then \(CL_i=5.00\exp(0)=5.00\) L/h and \(V_i=50.0\exp(0)=50.0\) L. The implied elimination rate remains \(0.100\) h\(^{-1}\).

At 1.00 h after the hypothetical 100 mg oral dose, the analytical calculation above gives \(1.317\) mg/L. A matched mrgsolve run should use the same parameter values, a single oral dose with \(F=1\), no lag, and the same time origin and units. Its predicted concentration at that time should agree up to numerical integration and rounding differences. If it does not, inspect the dose compartment, the definition of \(k_a\), the expression \(CL/V\), and whether the reported output is concentration rather than amount.

Now suppose instead that a particular individual has \(ETA(1)=0.100\) and \(ETA(2)=-0.200\). Their individual parameters are \(CL_i=5.00\exp(0.100)=5.526\) L/h and \(V_i=50.0\exp(-0.200)=40.94\) L. These values—not the population typical values—must be used when reproducing that individual’s profile. The population covariance determines how such pairs of effects are generated, but does not change the arithmetic once the two effects are fixed.

Practical Translation and Diagnostics

A disciplined transfer separates input estimates from model expressions. In a mrgsolve model, population estimates can be represented as parameters such as `TVCL`, `TVV`, and `KA`; model expressions then apply the appropriate transformations, such as `TVCL*exp(ETA(1))`. The `$OMEGA` specification supplies random-effect variances and covariances. A diagonal specification is appropriate only if the fitted random effects are uncorrelated; a block covariance is needed when correlations were estimated. Keep random-effect order documented because changing the order without changing the expressions assigns variability to the wrong parameters.

Check the following before trusting a profile comparison:

  • Scale: distinguish a standard deviation from a variance, and a log-scale effect from an effect on the natural scale.
  • Units: check dose, clearance, volume, time, concentration, and any conversion factors. A rate expressed per minute cannot be used as if it were per hour.
  • Parameterization: confirm which quantities were estimated and which were derived. In particular, do not confuse clearance with the elimination rate \(CL/V\).
  • Random-effect structure: compare the full covariance, not just marginal variances. Confirm the mapping from each random-effect index to each parameter.
  • Events and outputs: use the same route, dose timing, infusion or absorption assumptions, and output definition. An amount in a compartment is not a concentration.
  • Numerical behavior: inspect several times, including early absorption and later elimination, rather than relying on a single rounded value.

A useful failure diagnosis is to temporarily set all random effects to zero and omit residual error. If the typical-individual predictions disagree, first investigate model equations, parameter mapping, units, and event semantics. If those predictions agree but simulated population profiles do not, inspect the random-effect scale, covariance, distribution, and random-number draws. A mismatch that appears only after residual error is added points instead to the residual model or to how observations are generated.

Alternatives and Limits of the Check

Copying population estimates and simulating new individuals is appropriate when the goal is to reproduce population-level variability under the fitted model. Reproducing an existing individual profile instead calls for that individual’s estimated effects or parameter values, not fresh random draws. Setting all effects to zero is a convenient structural check, but it evaluates only a typical individual; it cannot verify that the random-effect covariance was transferred correctly.

An independent analytical calculation, when available, provides a useful check of a simple structural model. It is not a replacement for checking more complex models with multiple compartments, time-varying covariates, or special dosing features. Likewise, close agreement in one profile does not establish that every parameter, event, or stochastic component has been translated correctly. Simulation comparisons are sensitive to numerical tolerances and to stochastic inputs, so record whether the comparison is deterministic or uses matched random draws.

A common mistake is to copy a reported Monolix \(\omega=0.200\) directly as an mrgsolve variance of 0.200. The correction is to identify what Monolix reports: if 0.200 is the standard deviation of \(\eta\), the variance is \(0.200^2=0.0400\). Another mistake is to exponentiate a random effect twice. If the model already defines the individual parameter as \(TVCL\exp(\eta)\), do not exponentiate a parameter that has already been converted to an individual clearance. Preserve the model’s stated scale at every step.

Key takeaway: Transfer the model, not just its estimate table. Match each population value, transformation, random-effect variance and covariance, unit, structural equation, and event assumption; then check a typical individual before interpreting stochastic population simulations.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. A Monolix lognormal random-effect standard deviation is 0.25. What variance should be represented in mrgsolve?
  2. For \(TVCL=4\) L/h and \(\eta_{CL}=-0.10\) in a lognormal model, calculate the individual clearance to three significant figures.
  3. Two random effects have standard deviations 0.10 and 0.20 and correlation \(-0.30\). What is their covariance?
  4. A typical-individual profile agrees across tools, but the simulated population spread does not. Name two transfer features to inspect first.

Solutions. (1) The variance is \(0.25^2=0.0625\). (2) \(CL_i=4\exp(-0.10)=3.62\) L/h. (3) The covariance is \((-0.30)(0.10)(0.20)=-0.00600\). (4) Check that standard deviations were squared to obtain variances, and that the full covariance, random-effect distribution, and `ETA` ordering match the Monolix model. Agreement for the typical individual alone does not test these population-variability features.

Clinical Biostats