RMWreg_PredictCDF: CDF prediction based on a pre-computed MCMC chain.

Description Usage Arguments Value Author(s) Examples

View source: R/Functions.R

Description

This functions returns a Monte Carlo estimate of the predictive CDF P(T < t | D), based on a (pre-computed) posterior sample of all model parameters of the associated RMW regression model (obtained based on a dataset D).

Usage

1
RMWreg_PredictCDF(Chain, Time, x, Mixing = "None", BaseModel = "Weibull")

Arguments

Chain

List containing the pre-computed MCMC sample (as generated by the function RMWreg_MCMC).

Time

Time threshold t at which the predictive CDF is estimated.

x

Vector of covariate information for the new subject (must be in the same order as in the design matrix used to fit the model, including a '1' on the first position to represent the intercept).

Mixing

Mixing distribution assigned to the (frailty) random effects. Possible values are "None", "Exponential", "Gamma", "InvGamma", "InvGauss", "LogNormal"

BaseModel

If BaseModel = "Weibull", a RMW regression is used. If BaseModel = "Exponential", a RME regression is used.

Value

A Monte Carlo estimate of the predictive CDF.

Author(s)

Catalina A. Vallejos cvallejos@turing.ac.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(KMsurv)
data(alloauto)
n=dim(alloauto)[1]; k=2
Intercept=rep(1,times=n); x1=alloauto$type-1
DesignMat=cbind(Intercept,x1); rm(Intercept)
Time=alloauto$time; Event=alloauto$delta

Chain <- RMWreg_MCMC(N = 100, Thin = 2, Burn = 50,
                     Time, Event, DesignMat,
                     Mixing = "None", BaseModel = "Weibull",
                     PriorCV = "Pareto", PriorMeanCV = 1.5,
                     Hyp1Gam = 1, Hyp2Gam = 1)

# Predictive CDF at time = 5, for a given covariate configuration
RMWreg_PredictCDF(Chain, Time = 5, x = c(1,1), Mixing = "None", BaseModel = "Weibull")

catavallejos/RMWreg documentation built on Nov. 7, 2019, 2:01 p.m.