
Outlier detection for observation for the log-logistic model
Source:R/LogLogistic.R
BF_lambda_obs_LLOG.RdThis returns a unique number corresponding to the Bayes Factor associated to the test \(M_0: \Lambda_{obs} = \lambda_{ref}\) versus \(M_1: \Lambda_{obs}\neq \lambda_{ref}\) (with all other \(\Lambda_j,\neq obs\) free). The value of \(\lambda_{ref}\) is required as input. The user should expect long running times for the log-Student’s t model, in which case a reduced chain given \(\Lambda_{obs} = \lambda_{ref}\) needs to be generated
Arguments
- ref
Reference value \(\lambda_{ref}\) or \(u_{ref}\)
- obs
Indicates the number of the observation under analysis
- 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
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.
LLOG <- MCMC_LLOG(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 : 0.12
#> Initial beta 2 : -0.19
#> Initial beta 3 : -0.28
#> Initial beta 4 : -0.29
#> Initial beta 5 : -1.22
#> Initial beta 6 : 0.8
#> Initial beta 7 : -0.98
#> Initial beta 8 : 0.99
#> Initial beta 9 : 0.68
#>
#> Sampling initial sigma^2 from a Gamma(2, 2) distribution
#> Initial sigma^2 : 0.48
#>
LLOG.Outlier <- BF_lambda_obs_LLOG(1,1, X = cancer[, 3:11], chain = LLOG)