anom_est: Quantify Anomaly Clusters

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/anom_est.R

Description

This function returns the total amount of detected anomaly clusters under different alpha_lvl.

Usage

1
anom_est(clst_p_values, alpha_lvl, x, fhat = NULL, dist_null = "norm", ...)

Arguments

clst_p_values

a list of matrices. Each matrix has three columns where the first column is clusters starting indexes, second column is the corresponding clusters ending indexes and the third column is the corresponding significant level for clusters.

alpha_lvl

significance level for quantifying clusters.

x

tested data where the clusters are detected.

fhat

a function adjust the distribution misspecification. The default value is NULL, means no adjustment.

dist_null

a character string giving the underlying distribution in null hypothesis. Distribution options are shown in details.

...

further arguments for distribution parameters.

Details

The dist_null indicates the underlying distribution class. The options follow the distributions regular abbreviation in R, Like norm is normal distribution, unif is uniform distribution, gpd is generalized pareto distribution. Distributions for more distribution options.

Value

This function returns the estimated anomalous amount.

Note

clst_p_values is not same as the return of hypo_test. Corresponding p-values need to be added on the last column.

Author(s)

Zhicong Zhao

See Also

F_exp for estimated expections.

HRR_pt_est and HRR_sbsp_est for fhat estimation.

Examples

1
2
3
4
5
6
## two clusters with different significant levels
clst_p_values <- list(matrix(c(10,15,0.01,25,30,0.1),nrow = 2,byrow = TRUE))
x <- sort(runif(40))
x <- c(x[1:10],rep(x[10],5),x[11:20],rep(x[20],5),x[21:40])
anom_est(clst_p_values,0.05,x,dist_null = "unif")
anom_est(clst_p_values,0.1,x,dist_null = "unif")

zhicongz/AnomDetct documentation built on Dec. 12, 2019, 9:16 a.m.