cbar
packagecbar: Contextual Bayesian Anomaly Detection in R
This function generates cbar
object to detect contextual anomaly and
to abstract analysis output.
cbar(.data, ref_period, mea_period, apply_standardized = T, interval = 0.95,
...)
data table with datetime, y, and predictors
performance reference period
performance measurement period
whether it will standardized data or not
credible interval. 0.95 by default.
params for bsts_model
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.
# 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