Leave-one-out cross validation analysis. The function returns a matrix with n rows. The first column contains the logarithm of the CPO (Geisser and Eddy, 1979). Larger values of the CPO indicate better predictive accuracy of the model. The second and third columns contain the KL divergence between \(\pi(\beta, \sigma^2, \theta | t_{-i})\) and \(\pi(\beta, \sigma^2, \theta | t)\) and its calibration index \(p_i\), respectively.
Arguments
- Time
Vector containing the survival times.
- Cens
Censoring indication (1: observed, 0: right-censored).
- X
Design matrix with dimensions \(n\) x \(k\) where \(n\) is the number of observations and \(k\) is the number of covariates (including the intercept).
- chain
MCMC chains generated by a BASSLINE MCMC function
- set
Indicator for the use of set observations (1: set observations, 0: point observations). The former is strongly recommended over the latter as point observations cause problems in the context of Bayesian inference (due to continuous sampling models assigning zero probability to a point).
- eps_l
Lower imprecision \((\epsilon_l)\) for set observations (default value: 0.5).
- eps_r
Upper imprecision \((\epsilon_r)\) for set observations (default value: 0.5)
Examples
library(BASSLINE)
# Please note: N=1000 is not enough to reach convergence.
# This is only an illustration. Run longer chains for more accurate
# estimations.LM
LN <- MCMC_LN(N = 1000, thin = 20, burn = 40, Time = cancer[, 1],
Cens = cancer[, 2], X = cancer[, 3:11])
#> Sampling initial betas from a Normal(0, 1) distribution
#> Initial beta 1 : 2.45
#> Initial beta 2 : 0.75
#> Initial beta 3 : -0.76
#> Initial beta 4 : -0.36
#> Initial beta 5 : 1.02
#> Initial beta 6 : 1.93
#> Initial beta 7 : -0.1
#> Initial beta 8 : -0.94
#> Initial beta 9 : 1.04
#>
#> Sampling initial sigma^2 from a Gamma(2, 2) distribution
#> Initial sigma^2 : 0.84
#>
LN.CD <- CaseDeletion_LN(Time = cancer[, 1], Cens = cancer[, 2],
X = cancer[, 3:11], chain = LN)
