vtPost: Postetrior sampling for given observed samples

View source: R/visit_stan.R

vtPostR Documentation

Postetrior sampling for given observed samples

Description

Call STAN to draw posterior samples of the joint distribution of immunogenicity rate and toxicity risk

Usage

vtPost(obs.y, prob.mdl = c("NONPARA", "NONPARA+", "PARA", "PARA+"),
  priors = NULL, ..., nsmp = 4000, prior.const = 0.5)

Arguments

obs.y

Observed data matrix with l rows and 4 columns. Row k in the matrix represents the observed data from dose level k. The columns are

  • column 1: number of patient with no DLT, no immune response

  • column 2: number of patient with no DLT, immune response

  • column 3: number of patient with DLT, no immune response

  • column 4: number of patient with DLT, immune response

prob.mdl

Option of the probability models:

  • NONPARA: non-parametric+ model

  • NONPARA+: non-parametric model

  • PARA: partially parametric model

  • PARA+: partially parametric+ model

Default value is NONPARA. See visit for details.

priors

A class VTPRIOR object created by vtPriorPar for PARA and PARA+ model.

...

additional parameters for package rstan's sampling method. These options include warmup, thin, algorithm. See rstan::sampling for details.

nsmp

number of iterations

prior.const

Specify \alpha for a Beta(\alpha, \alpha) prior. The Beta prior is used for NONPARA and NONPARA+ models. Default value 0.5.

Value

A class VTPOST matrix of posterior samples with nsmp rows and 4 columns. Columns 1-4 correspond to\theta^{(l)}_{00}, \theta^{(l)}_{01}, \theta^{(l)}_{10}, \theta^{(l)}_{11}. See visit for details about \theta's.

Examples

obs.y    <- rbind(c(5, 2, 0, 0), c(3, 4, 0, 0), c(1, 6, 0, 0))
prior <- vtPriorPar(prior.y = NULL, tau = c(0.1, 0.3, 0.6), sdalpha=10, sdrho=10, vtheta=NULL)
rst.post <- vtPost(obs.y, priors = prior, warmup = 100, prob.mdl = "PARA", nsmp = 200)


visit documentation built on Aug. 9, 2023, 5:08 p.m.