# NOT RUN {
#Generate training dataset
set.seed(890)
nobs = 250
nts = 100
train_data <- ts(apply(matrix(ncol = nts, nrow = nobs), 2, function(nobs){10 + rnorm(nobs, 0, 3)}))
# Generate test stream with some outliying series
nobs = 15000
test_stream <- ts(apply(matrix(ncol = nts, nrow = nobs), 2, function(nobs){10 + rnorm(nobs, 0, 3)}))
test_stream[360:1060, 20:25] = test_stream[360:1060, 20:25] * 1.75
test_stream[2550:3550, 20:25] = test_stream[2550:3550, 20:25] * 2
find_odd_streams(train_data, test_stream , trials = 100)
# }
# NOT RUN {
# Considers the first window of the data set as the training set and the remaining as
# the test stream
# }
# NOT RUN {
train_1data <- anomalous_stream[1:100,]
test_stream <-anomalous_stream[101:1456,]
find_odd_streams(train_data, test_stream , trials = 100)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab