sampler {anomaly}R Documentation

Post processing of BARD results.

Description

Draw samples from the posterior distribution to give the locations of anomalous segments.

Usage

sampler(bard_result, gamma = 1/3, num_draws = 1000)

Arguments

bard_result

An instance of the S4 class .bard.class containing a result returned by the bard function.

gamma

Parameter of loss function giving the cost of a false negative i.e. incorrectly allocating an anomalous point as being non-anomalous. For more details see Section 3.5 of Bardwell and Fearnhead (2017).

num_draws

Number of samples to draw from the posterior distribution.

Value

Returns an S4 class of type bard.sampler.class.

References

Bardwell L, Fearnhead P (2017). “Bayesian Detection of Abnormal Segments in Multiple Time Series.” Bayesian Anal., 12(1), 193–218. doi: 10.1214/16-BA998, https://doi.org/10.1214/16-BA998.

See Also

bard

Examples

library(anomaly)
set.seed(0)
sim.data<-simulate(n=500,p=50,mu=2,locations=c(100,200,300),
duration=6,proportions=c(0.04,0.06,0.08))
# run bard
res<-bard(sim.data, alpha = 1e-3, h = 0.5)
# sample 
sampler(res)


[Package anomaly version 4.0.1 Index]