# 6 Prior Object

For Bayesian estimation, the user must specify a Prior Object, which is used in place of the Parameter Object. The Prior Object defines prior distributions or values for all model parameters – both structural and variability. The prior distributions form an additional level of model hierarchy above all other levels of variability in the model. This level of the hierarchy does not need to be explicitly defined in the Model Object VARIABILITY_LEVELS block. it is implied through use of the Prior Object.

## 6.1 Prior distributions vs initial values vs fixed values

At present we do not support translation of the Prior Object to NONMEM prior specification for use with the \$BAYES estimation algorithm. The only supported Bayesian estimation tool currently is WinBUGS. While NONMEM accepts a mix of prior distribution specification and initial values for estimation, WinBUGS requires prior distributions for all parameters, or fixing parameters to a given value. A fixed value can be thought of as a probability mass function (pmf) on a single value. A fixed value for a parameter represents a very strong prior on the value of that parameter. Bounds on parameters should be handled using an appropriate ProbOnto distribution e.g. Beta, Gamma, Uniform, Half-Normal, Truncated-Normal.

## 6.2PRIOR_PARAMETERS Block

The [PRIOR_PARAMETERS] block holds constants which may be used in the PRIOR_VARIABLE_DEFINITION or PRIOR_VARIABLE_DEFINITION blocks. This allows the user to specify the general form of the prior distribution in the PRIOR_VARIABLE_DEFINITION block and then examine sensitivity to prior choice by altering the values in the [PRIOR_PARAMETERS].

The [PRIOR_PARAMETERS] block should contain variable assignment statements.

  <VARIABLE> = <value>

Note that In the [PRIOR_PARAMETERS] block, the variable is assigned a value, not a list with attributes. As mentioned above, if a model parameter is to be fixed then it takes the value assigned in the [PRIOR_PARAMETERS] block. An attribute “fix=true” is not required.

For example (/Priors/UseCase1_PRIOR):

PRIOR_PARAMETERS{
# prior on "THETA"
MU_POP_CL = 0.2
MU_POP_V = 10
MU_POP_KA = 0.3
MU_POP_TLAG = 0.75
VAR_POP_CL = 1
VAR_POP_V = 1
VAR_POP_KA = 1
VAR_POP_TLAG = 0.1

# prior on "OMEGA"
MU_R_CL = 0.2
MU_R_V = 0.2
MU_R_V_CL = 0
DF_OMEGA = 2
MU_OMEGA_KA = 1
MU_OMEGA_TLAG = 1

# prior on "SIGMA"
a_POP_RUV_PROP = 1.1
b_POP_RUV_PROP = 3
} # end PRIOR_PARAMETERS

## 6.3PRIOR_VARIABLE_DEFINITION

### 6.3.1 Parametric distributions as priors

In the PRIOR_VARIABLE_DEFINITION block we set up the prior distributions for the STRUCTURAL and VARIABILITY parameters of the Model Object. All model parameters must have a prior distribution specified, or a constant value set.

If model parameters are correlated or have a multivariate distribution then it is common (although not mandatory) to specify multivariate prior distributions. To do so, the user is likely to need to specify vectors of means and matrices for covariances or correlations. The syntax for specifying vectors and matrices is given in section 9.1.4.7.

The PRIOR_VARIABLE_DEFINITION block can contain assignment, transformation and random variable definitions using ProbOnto definitions for distributions.

For example (UseCase1_PRIOR):

PRIOR_VARIABLE_DEFINITION{
# prior on "THETA"
lMU_POP_CL = ln(MU_POP_CL)
lPOP_CL ~ Normal(mean = lMU_POP_CL, var = VAR_POP_CL)
POP_CL = exp(lPOP_V)

lMU_POP_V = ln(MU_POP_V)
lPOP_V ~ Normal(mean = lMU_POP_V, var = VAR_POP_V)
POP_V = exp(lPOP_V)

lMU_POP_KA = ln(MU_POP_KA)
lPOP_KA ~ Normal(mean = lMU_POP_KA, var = VAR_POP_KA)
POP_KA = exp(lPOP_KA)

lMU_POP_TLAG = ln(MU_POP_TLAG)
lPOP_TLAG ~ Normal(mean = lMU_POP_TLAG, var = VAR_POP_TLAG)
POP_TLAG = exp(lPOP_TLAG)

# priors on "OMEGA"
R_mat = [[ MU_R_CL, MU_R_V_CL;
MU_R_V_CL, MU_R_V ]]

TAU_CL_V ~ Wishart2(inverseScaleMatrix = R_mat, degreesOfFreedom = DF_OMEGA)
OMEGA_CL_V = inverse(TAU_CL_V)
PPV_CL = sqrt(OMEGA_CL_V[1,1])
PPV_V = sqrt(OMEGA_CL_V[2,2])
PPV_V_CL = OMEGA_CL_V[1,2]

TAU_KA ~ Gamma2(shape = 0.001, rate = 0.001)
PPV_KA = sqrt(1/TAU_KA)

# prior on "SIGMA"
invRUV_PROP ~ Gamma2(shape = a_POP_RUV_PROP, rate = b_POP_RUV_PROP)
RUV_PROP = sqrt(1/invRUV_PROP)
} # end PRIOR_VARIABLE_DEFINITION

Note the following parameters have prior distributions assigned: POP_CL, POP_V, POP_KA, POP_TLAG, PPV_CL, PPV_V, COV_CL_V, PPV_KA, RUV_ADD, RUV_PROP.

Note that priors on between subject variability are given on the precision scale (= 1 / variance). This is to facilitate use in BUGS. Here the distributions used are Wishart and Gamma on the precision parameters, but Inverse-Wishart and Inverse-Gamma may alternatively be used on the variance-covariance matrix and variance parameters.

Note also that priors for POP_CL, POP_V, POP_KA and POP_TLAG could also be defined using logNormal1 distributions (using the ProbOnto distribution) instead of transforming and back-transforming using Normal(…) distributions.

To specify a matrix, we use double square brackets, and specify elements row-wise, separated with a semi-colon. To specify elements of a matrix we use the R convention of square bracket specifying row and column entries. For example:

R_mat = [[ MU_R_CL, MU_R_V_CL;
MU_R_V_CL, MU_R_V ]]

To specify the first row and column entry (corresponding to MU_R_CL): R_mat[1,1].

Note that a Gamma distribution is used to define the prior on the between subject variability for PPV_KA. This is a legacy from the early days of fitting hierarchical models in BUGS where Gamma priors were conjugate and easier to sample from. They have been somewhat discredited as prior choices. Recent literature has favoured Half-Cauchy priors on variance parameters of hierarchical models as they are robust against smaller numbers of subjects.(Gelman 2006)

## 6.4 Non-parametric and empirical distributions as priors – inline data.

As an alternative to parametric distributions as priors, the user can specify non-parametric distributions (specifying bins of values and probabilities for each bin) or empirical distributions (specifying data forming the basis of empirical sampling). Univariate and multivariate sampling distributions have been defined in MDL for non-parametric and empirical sampling distributions.

In both cases the source for the non-parametric or empirical sampling can be specified inline via the [PRIOR_PARAMETERS] block, or by referencing an external data source in the PRIOR_SOURCE block.

### 6.4.1 Non-parametric distribution specification with inline data.

To specify a non-parametric distribution, MDL has a distributions called NonParametric and MultiNonParametric. These map to the ProbOnto RandomSample non-parametric distribution definition. To specify the non-parametric distributions, the user must supply bins and probabilities for sampling. To specify this inline we create a vector (for NonParametric) or matrix (for MultiNonParametric) of bins and a vector of probabilities. These are specified in the [PRIOR_PARAMETERS] block.

For example (Priors examples, Example3421dep)

PRIOR_PARAMETERS{

…

# For Non-Parametric distribution

bins_POP_K_V =
matrix(vector = [2.006510,2.045465,2.084421,2.123377,2.162333,2.201288,2.240244,2.279200,2.318156,2.357111,
5.050013,5.050013,5.050013,5.050013,5.064166,5.064166,5.064166,5.064166,5.078318,5.078318],
ncol = 2, byRow is FALSE)

p_POP_K_V = [0.033333,0.100000,0.100000,0.200000,0.100000,0.066667,0.166667,0.100000,0.066667,0.066667]
} # end PRIOR

PRIOR_VARIABLE_DEFINITION{
# prior on "THETA"
POP_K_V ~ MultiNonParametric(probability = p_POP_K_V, bins = bins_POP_K_V)
POP_K = POP_K_V[1]
POP_V = POP_K_V[2]
…
} # end PRIOR_VARIABLE_DEFINITION

Here a matrix of bins for POP_K and POP_V is created by specifying a vector of values and then defining the number of columns and method for filling the matrix. A vector of probabilities is also defined. Then in the PRIOR_VARIABLE_DEFINITION block the multivariate non-parametric sampling distribution is defined referencing the probabilities and bins. Finally the Priors for POP_K and POP_V are defined by referencing the elements of the POP_K_V vector.

### 6.4.2 Empirical distribution specification with inline data.

Similarly, the user can specify the data source for empirical sampling within the [PRIOR_PARAMETERS] block and then refer to this in defining the sampling distribution for the PRIOR_VARIABLE_DEFINITION.

For example (Priors examples, Example 3422)

PRIOR_PARAMETERS{
data_POP_K_V =
matrix(vector = [2.006510,2.045465,2.084421,2.123377,2.162333,2.201288,2.240244,2.279200,2.318156,2.357111,
5.050013,5.050013,5.050013,5.050013,5.064166,5.064166,5.064166,5.064166,5.078318,5.078318],
ncol = 2, byRow is FALSE)
…

} # end PRIOR

PRIOR_VARIABLE_DEFINITION{
# prior on "THETA"
POP_K_V ~ MultiEmpirical(data = data_POP_K_V)
POP_K = POP_K_V[1]
POP_V = POP_K_V[2]
…
} # end PRIOR_VARIABLE_DEFINITION

Again, the data source is defined by specifying a matrix of values for POP_K and POP_V and then using this as the basis for the MultiEmpirical sampling distribution. For the univariate Empirical sampling distribution, only a vector would be needed as the basis for sampling.

## 6.5NON_CANONICAL_DISTRIBUTION

As an alternative to inline data specification for non-parametric or empirical sampling distributions, the user may reference and external dataset for bins and probabilities (for use with non-parametric sampling distributions) or data for the basis of the empirical sampling distribution.

### 6.5.1PRIOR_SOURCE

Similarly to the SOURCE block within the Data Object, the PRIOR_SOURCE block is a named list providing the file name, format of the source data. However the PRIOR_SOURCE block adds an argument to the list to provide a vector of column names to be used in the data source for the sampling distributions.

The syntax is as follows:

PRIOR_SOURCE{
<data source name> : { file = <”filename.csv”>,
inputFormat is csv,
column = [<”variable name1”, “variable name2”,
… , “variable name k”]}
}

Multiple data sources may be defined within the PRIOR_SOURCE block.

### 6.5.2INPUT_PRIOR_DATA

The PRIOR_SOURCE data objects can then be referenced in the INPUT_PRIOR_DATA block to define how the data file columns map to objects to be used in the PRIOR_VARIABLE_DEFINITION block sampling distributions. This is done using anonymous lists.

The syntax is as follows:

INPUT_PRIOR_DATA{
:: { src = <PRIOR_SOURCE data variable>,
vector | matrix = <**PRIOR_VARIABLE_DEFINITION object>,
column = “<PRIOR_SOURCE data column name>” }
}

For example :

NON_CANONICAL_DISTRIBUTION{
PRIOR_SOURCE{
NonPar_K_V : { file = "Nonparametric_K_V.csv",
inputFormat is csv,
column = ["bins_k", "bins_v", "p_k_v"]}

Emp_SIGMA : { file = "Empirical_Sigma.csv",
inputFormat is csv,
column = ["data_SIGMA2"]}
}

INPUT_PRIOR_DATA{
:: { src = NonPar_K_V, vectorVar = p_k_v, column = "p_k_v"}
:: { src = NonPar_K_V, matrixVar=bins_k_v, column = ["bin_k", "bins_v"] }
:: { src = Emp_SIGMA, column = "data_SIGMA2", vectorVar = data_SIGMA2 }
}
}

PRIOR_VARIABLE_DEFINITION{
p_k_v::vector
bins_k_v::matrix
data_SIGMA2::vector

POP_k_v ~ MultiNonParametric(bins = bins_k_v, probability = p_k_v)
POP_SIGMA2 ~ Empirical(data = data_SIGMA2)
POP_K = POP_k_v[0]
POP_V = POP_k_v[1]
}

In the above example, two sources are specified – one giving non-parametric sampling bins and probabilities for K and V, the other providing values for SIGMA to be used in the empirical sampling distribution. In the definition of NonPar_K_V we want to read three columns from the PRIOR_SOURCE data file – “bins_k” and “bins_v” to specify the bins for K and V, and “p_k_v” to specify the probabilities for sampling these bins. In the definition of Emp_SIGMA we define the columns of the PRIOR_SOURCE data file to use as the basis of the empirical sampling distribution of SIGMA.

In the INPUT_PRIOR_DATA block we specify how the defined PRIOR_SOURCE information is to be mapped to vectors and matrices defined in the PRIOR_VARIABLE_DEFINITION block and used in the definition of the sampling distributions. Note that in the PRIOR_VARIABLE_DEFINITION block we must define the type of the objects p_k_v, bins_k_v and data_SIGMA2 (vector, matrix and vector respectively). POP_k_v is then sampled from a multivariate non-parametric sampling distribution with bins specified by the matrix bins_k_v and sampling probabilities by the vector p_k_v, while POP_SIGMA2 is sampled from an empirical sampling distribution with values held in the vector data_SIGMA2.

### References

Gelman, Andrew. 2006. “Prior Distributions for Variance Parameters in Hierarchical Models(Comment on Article by Browne and Draper).” Bayesian Analysis 1. Institute of Mathematical Statistics: 515–34. doi:10.1214/06-ba117a.