107  Direct Sampling

NONMEM 7 Technical Guide

Author

Robert J. Bauer

Published

February 1, 2024

Direct sampling is much less efficient than importance sampling, and can require 10000 to 300000 random samples per subject to properly obtain conditional means and variances. Direct sampling does not use an “importance” region sampling density, but creates samples \(\boldsymbol{\phi}_{k,i}\) directly from the normal distribution population parameter density: \(\boldsymbol{\phi}_{k,i} \sim N(\boldsymbol{\mu}_i, \boldsymbol{\Omega})\) (see (Bauer and Guzy 2004)). The following weight is then associated with the sample, based on the appropriate substitutions into equation 11:

\[ u_{i,k,y} = l(\mathbf{y}_i \mid \boldsymbol{\phi}_{k,i}, \boldsymbol{\theta}_{\enclose{horizontalstrike}{\mu}}) \tag{1}\]

Conditional means and variances are obtained as shown earlier:

\[ z_{i,k,y} = \frac{u_{i,k,y}}{\sum_{k=1}^{r} u_{i,k,y}} \tag{2}\]

\[ \bar{\boldsymbol{\phi}}_i = \sum_{k=1}^{r} z_{i,k,y} \boldsymbol{\phi}_{k,i} \tag{3}\]

\[ \bar{\mathbf{B}}_i = \sum_{k=1}^{r} z_{i,k,y} (\boldsymbol{\phi}_{k,i} - \bar{\boldsymbol{\phi}}_i)(\boldsymbol{\phi}_{k,i} - \bar{\boldsymbol{\phi}}_i)^{\prime} \tag{4}\]

As with importance sampling, an average of weights is obtained,

\[ \psi_i = \frac{1}{r} \sum_{k=1}^{r} u_{i,k,y} \tag{5}\]

From which the integrated objective function is obtained

\[ L_i = -\log(\psi_i) \tag{6}\]