fit_multiple_models: Fit Multiple Models

Description Usage Arguments Value See Also Examples

View source: R/api_fit_outlier.R

Description

Conduct multiple novelty tests for a new observation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fit_multiple_models(
  A,
  z,
  response,
  alpha = 0.05,
  type = "fwd",
  q = 0.5,
  comp = NULL,
  nsim = 10000,
  ncores = 1,
  trace = TRUE,
  validate = TRUE
)

Arguments

A

A character matrix or data.frame

z

Named vector. Same names as colnames(A) but without the class variable

response

A character with the name of the class variable of interest

alpha

The significance level

type

Character ("fwd", "bwd", "tree" or "tfwd") - the type of interaction graph to be used

q

Penalty term in the stopping criterion when fitting the interaction graph (0 = AIC and 1 = BIC)

comp

A list with character vectors. Each element in the list is a component in the graph (using expert knowledge)

nsim

Number of simulations

ncores

Number of cores to use in parallelization

trace

Logical indicating whether or not to trace the procedure

validate

Logical. If true, it checks if A has only single character values and converts it if not.

Value

An object of type multiple_models; a list of of novely objects from which one can query pvalues etc. for outlierdetection.

See Also

fit_outlier, fit_mixed_outlier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(dplyr)
set.seed(1)

# A patient with psoriasis
z <- unlist(derma[2, 1:10])

d <- derma[, c(names(z), "ES")] %>%
     filter(ES %in% c("chronic dermatitis", "psoriasis"))

m <- fit_multiple_models(d, z, "ES", nsim = 1000, trace = FALSE, validate = FALSE)

plot(m)
print(m)

molic documentation built on June 2, 2021, 5:07 p.m.