$PRIOR

Provides instructions for the PRIOR subroutine.

1
2
3
4
5
6
  $PRIOR subroutine  [([ESTIMATION | SIMULATION | PROBLEM=n] ...) ... ]
      [DISPLAY[=ALL|CNT]]   [ICMAX=n]
      [argument1 , argument2 ...]

  ;# Example
  $PRIOR TNPRI (PROBLEM 2) PLEV=.9999 ISS=0 IVAR=1

Discussion

The optional record invokes the use of the priors. It does not support abbreviated code block but delegates to the subroutine option on prior specification.

One can specify which PROBLEM to apply the given prior, and/or whether to apply the prior to ESTIMATION or SIMULATION. By default the prior is applied to all tasks, i.e., all values of ICALL (recall ICALL=2 for ESTIMATION and ICALL=4 for SIMULATION). Problems can also be selected using .NE., .LT., .LE., .GT., and .GE. When multiple selections are given a task that meets any of the condition is imposed with the prior. See examples below.

Options

subroutine

  • TNPRI: use a previous run (through MSF) as the source of prior information;
  • NWPRI: user-specified distribution hyperparameters using the prior control records. NONMEM7's new $ESTIMATION methods (BAYES, NUTS, SAEM, etc) can only use NWPRI to specify priors.

arguments

[argument1 , argument2 ...]: the arguments to NWPRI or TNPRI. See TNPRI and NWPRI for details. All arguments have default 0.

DISPLAY[=ALL|CNT]

Optional. The PRIOR subroutine will contain code to print items of interest in the NONMEM report.

  • DISPLAY=ALL (default): print when everytime PRIOR is called. Sample output:

    1
    
      PRIOR ICALL,IPROB,IREP,CNT:  2  2  0   -41.898951681785.
  • DISPLAY=CNT: print only when PRIOR is called for simulation or estimation. Sample output:

    1
    
      PRIOR CNT:    -41.898951681785

Examples

1
 $PRIOR TNPRI (ESTIMATION, PROB .GE.3 ) IFND=1

Call TNPRI with the Estimation step of problems 3 and later. IFND is set to 1 with these calls; all other arguments are 0.

1
2
  $PRIOR TNPRI IFND=1
  (EST, PROB 3) (EST,PROB 4) (EST,PROB 5)

Call TNPRI with the Estimation step of problems 3, 4 and 5. IFND is set to 1 with these calls; all other arguments are 0.

1
2
3
  $PRIOR TNPRI (EST, PROB 3) IFND=1
         TNPRI (EST, PROB 4) IFND=1
         TNPRI (EST, PROB 5) IFND=1

A more verbose version the previous example. There may be at most 10 $PRIOR records per problem.

Priors control records

NONMEM v7.3+ provides more informative record names so that users do not have to directly specifying $PRIOR parameters such as NTHETA, NETA, etc. These control records are intended to be used with $PRIOR NWPRI. If given, options in $PRIOR NWPRI override the prior control record settings listed below.

Similar to $OMEGA, the BLOCK and VALUES options are used to specify the prior covariance matrices.

$THETAP, $THETAPV

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 $THETAP  value1  [value2]  [value3] ...
 $THETAPV  value1  [value2]  [value3] ...

;# EXAMPLE
 $PRIOR NWPRI
 ;#...
 ;# Prior information of THETAS (NTHP=4 of them)
 $THETAP (2.0 FIX) (2.0 FIX) (2.0 FIX) (2.0 FIX)
 ;# Variance to prior information of THETAS (NTHPxNTHP=4x4 of them).
 $THETAPV BLOCK(4)
 10000 FIX
 0.00 10000
 0.00  0.00 10000
 0.00  0.00 0.0 10000

$THETAP and $THETAPV are for THETA prior's mean and covariance matrix, respectively. By default the prior uses the (multivariate) normal distribution. For the NUTS algorithm ($EST METHOD=NUTS) one can also specify the t-distribution using $TTDF.

$TTDF (NM75)

Specifies t-distribution degrees of freedom for \(\theta\).

1
2
3
4
5
6
 $TTDF 0 (default)
 $TTDF [value ... ]
 $TTDF [(value)[xn]] ...

;# Example
 $TTDF (2.0)x2 (3.0)x2

The example sets t-distribution degrees of freedom for \(\theta_1\) and \(\theta_2\) to value of 2.0, and degrees of freedom for \(\theta_3\) and \(\theta_4\) to value of 3.0.

1
$ESTIMATION METHOD=NUTS

and

1
$SIMULATION

These values will be used in estimation and simulation unless $EST TTDF or $SIM TTDF is set, respectively, which set the degrees of freedom to a same value for all THETA's for that step.

By default $TTDF value is 0 and the multivariate normal distribution is used.

$OMEGAP, $OMEGAPD

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 $OMEGAP  value1  [value2]  [value3] ...
 $OMEGAPD  value1  [value2]  [value3] ...

;# Example
 $PRIOR NWPRI
 ;#...
;# Prior to OMEGA (NETPxNETP=4x4 of them)
 $OMEGAP BLOCK(4)
 0.2 FIX
 0.0  0.2
 0.0  0.0 0.2
 0.0  0.0 0.0 0.2
;# Set degrees of freedom of OMEGA Prior (one value per OMEGA block)
 $OMEGAPD (4 FIX)

By default, the prior for OMEGA follows the inverse Wishart distribution. $OMEGAP specifies the prior for elements, and $OMEGAPD specifies degrees of freedom (also known as the dispersion factor). Note that $OMEGAPD specifies a vector, similar to $THETA.

For NUTS algorithm ($EST METHOD=NUTS), one can also use LKJ prior for OMEGA using $OLKJDF. See below.

In addition, one can use the source/OMEGA_STD_PRIORU.f90 file as a template to provide the prior density function. Set $SUBR OTHER=OMEGA_STD_PRIORU.f90 to use the user modified template.

$OLKJDF, $OVARF

Specifies LKJ decorrelation degrees of freedom for each OMEGA block.

1
2
3
4
5
6
 $OLKJDF 0 ;# default
 $OLKJDF [value ... ]
 $OLKJDF [(value)[xn]] ...

;# EXAMPLE
 $OLKJDF 4.5 3.5 -2.0

The example shows that the first OMEGA block has degrees of freedom 4.5, the second has 3.5, and the third has -2.0.

The default 0 specifies the inverse Wishart as OMEGA prior.

$OVARF specifies the weighting (inverse variance) to the standard deviations of the LKJ decorrelation degrees of freedom for each OMEGA block.

1
2
3
4
5
6
   $OVARF 0 ;# default
   $OVARF [value ... ]
   $OVARF [(value)[xn]] ...

  ;# EXAMPLE
   $OVARF 2.0 5.0

The example specifies 2.0 for the first OMEGA block, 5.0 for the second.

If the corresponding $OLKJDF value is negative $OVARF is argument STDSSP in user-defined OMEGA_STD_PRIORU.f90.

$OVARF separate records that allow the user to specify the weighting to the standard deviations LKJ decorrelation degrees of freedom for each OMEGA block and SIGMA block. Used with the NUTS algorithm.

See also OLKJDF and OVARF option of $ESTIM. These options override the control records.

$SIGMAP, $SIGMAPD

1
2
3
4
5
6
7
8
 $SIGMAP  value1  [value2]  [value3] ...
 $SIGMAPD  value1  [value2]  [value3] ...

;# EXAMPLE
 ;# Prior to SIGMA (NEPPxNEPP=1x1 of them)
 $SIGMAP 0.05 FIX
 ;# Set degrees of freedom of SIGMA Prior (one value per SIGMA block)
 $SIGMAPD (1 FIX)

By default, the prior for SIGMA follows the inverse Wishart distribution, with $SIGMAP specifying the prior for elements, and $SIGMAPD the degrees of freedom (also known as the dispersion factor). Note that $SIGMAPD specifies a vector, similar to $THETA.

For NUTS algorithm ($EST METHOD=NUTS), one can also use LKJ prior for SIGMA using $SLKJDF. See below.

In addition, one can use the source/SIGMA_STD_PRIORU.f90 file as a template to provide the prior density function. Set $SUBR OTHER=SIGMA_STD_PRIORU.f90 to use the user modified template.

$SLKJDF, $SVARF

Similarly to OMEGA, SIMGA has corresponding LKJ prior specification control records for the NUTS algorithm.

$SLKJDF Specifies LKJ decorrelation degrees of freedom for each SIGMA block.

1
2
3
4
5
6
 $SLKJDF 0 ;# default
 $SLKJDF [value ... ]
 $SLKJDF [(value)[xn]] ...

;# Example
 $SLKJDF 4.5 3.5 -2.0

One can also use the source/SIGMA_STD_PRIORU.f90 file as template to provide the desired probability density function.

$SVARF specifies the weighting to the weighting (inverse variance) to the standard deviations LKJ decorrelation degrees of freedom for each SIGMA block.

1
2
3
4
5
6
  $SVARF 0 ;# default
  $SVARF [value ... ]
  $SVARF [(value)[xn]] ...

  ;# EXAMPLE
  $SVARF 2.0 5.0

The SLKJDF and SVARF option of $ESTIM override the control records.