BF_lambda_obs_LST: Outlier detection for observation for the log-student's t...

View source: R/LogStudentsT.R

BF_lambda_obs_LSTR Documentation

Outlier detection for observation for the log-student's t model

Description

This returns a unique number corresponding to the Bayes Factor associated to the test M_0: Λ_{obs} = λ_{ref} versus M_1: Λ_{obs}\neq λ_{ref} (with all other Λ_j,\neq obs free). The value of λ_{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 Λ_{obs} = λ_{ref} needs to be generated

Usage

BF_lambda_obs_LST(
  N,
  thin,
  burn,
  ref,
  obs,
  Time,
  Cens,
  X,
  chain,
  Q = 1,
  prior = 2,
  set = TRUE,
  eps_l = 0.5,
  eps_r = 0.5,
  ar = 0.44
)

Arguments

N

Total number of iterations. Must be a multiple of thin.

thin

Thinning period.

burn

Burn-in period

ref

Reference value λ_{ref} or u_{ref}

obs

Indicates the number of the observation under analysis

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

Q

Update period for the λ_{i}’s

prior

Indicator of prior (1: Jeffreys, 2: Type I Ind. Jeffreys, 3: Ind. Jeffreys).

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 (ε_l) for set observations (default value: 0.5).

eps_r

Upper imprecision (ε_r) for set observations (default value: 0.5)

ar

Optimal acceptance rate for the adaptive Metropolis-Hastings updates

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.

LST <- MCMC_LST(N = 1000, thin = 20, burn = 40, Time = cancer[, 1],
                Cens = cancer[, 2], X = cancer[, 3:11])

LST.Outlier <- BF_lambda_obs_LST(N = 100, thin = 20 , burn = 1, ref = 1,
                                 obs = 1, Time = cancer[, 1],
                                 Cens = cancer[, 2], X = cancer[, 3:11],
                                 chain = LST)


nathansam/SMLN documentation built on May 14, 2022, 9:07 p.m.