cbar (version 0.1.2)

cbar: cbar package

Description

cbar: Contextual Bayesian Anomaly Detection in R

This function generates cbar object to detect contextual anomaly and to abstract analysis output.

Usage

cbar(.data, ref_period, mea_period, apply_standardized = T, interval = 0.95,
  ...)

Arguments

.data

data table with datetime, y, and predictors

ref_period

performance reference period

mea_period

performance measurement period

apply_standardized

whether it will standardized data or not

interval

credible interval. 0.95 by default.

...

params for bsts_model

Details

See the README on Github

For the input .data, note that you should use datetime for the first column name. Also, you should use numeric type for other columns.

Examples

Run this code
# NOT RUN {
library(cbar)

.data <- mtcars
rownames(.data) <- NULL
datetime <- seq(from = Sys.time(), length.out = nrow(.data), by = "mins")
.data <- cbind(datetime = datetime, .data)

ref_session <- 1:16
mea_session <- 17:nrow(.data)

obj <- cbar(.data, ref_session, mea_session)
# }

Run the code above in your browser using DataLab