Learn R Programming

psc (version 1.2.0)

pscEst: Function for performing estimation procedures in 'pscfit'

Description

Function for performing estimation procedures in 'pscfit'

Usage

pscEst(CFM, DC_clean, nsim, start, start.se, trt)

Value

A matrix containing the draws form the posterior distribution

Arguments

CFM

a model object supplied to pscfit

DC_clean

a cleaned dataset ontained using dataComb().

nsim

the number of MCMC simulations to run

start

the stating value for

start.se

the stating value for

trt

an optional vector denoting treatment allocations where mulitple treatment comparisons are bieng made

Details

Define the set of model parameters \(B\) to contain \(\Gamma\) which summarize the parameters of the CFM. Prior distributions are defined for B using a multivariate normal distribution \(\pi (B) \sim MVN(\mu ,\Sigma)\) where \(\mu|\) is the vector of coefficient estimates from the validated model and \(\Sigma\) is the variance-covariance matrix. This information is taken directly from the outputs of the parametric model and no further elicitation is required. The prior distirbution for the efficacy parameter (\(\pi{(\beta)}\)) is set as an uniformative \(N(0,1000)\).

Ultimately the aim is to estimate the posterior distribution for \(\beta\) conditional on the distribution of B and the observed data. A full form for the posterior distribution is then given as

$$P(\beta \vert B,D) \propto L(D \vert B,\beta) \pi(B) \pi(\beta)$$

Please see 'pscfit' for more details on liklihood formation.

For each iteration of the MCMC procedure, the following algorithm is performed

  1. Set and indicator s=1, and define an initial state based on prior hyperparameters for \(\pi(B)\) and \(\pi(\beta)\) such that \(b_s = \mu and \tau_s=0\)

  2. Update \(s = s+1\) and draw model parameters \(b_s\) from \(\pi(B)\) and an draw a proposal estimate of \(\beta\) from some target distribution

  3. Estimate \(\Gamma_(i,S)=\nu^T x_i\) where \(\nu\) is the subset of parameters from \(b_s\) which relate to the model covariates and define 2 new likelihood functions \(\Theta_(s,1)=L(D \vert B=b_s,\beta=\tau_(s-1) )\) & \(\Theta_(s,2)= L(D \vert B=b_s,\beta=\tau_s)\)

  4. Draw a single value \(\psi\) from a Uniform (0,1) distribution and estimate the condition \(\omega= \Theta_(s,1)/\Theta_(s,2)\). If \(\omega > \psi\) then accept \(\tau_s\) as belonging to the posterior distribution \(P(\beta \vert B,D)\) otherwise retain \(\tau_(s-1)\)

  5. Repeat steps 2 – 4 for the required number of iterations

The result of the algorithm is a posterior distribution for the log hazard ratio, \(\beta\), captures the variability in B through the defined priors \(\pi{(\beta)}\).