eventCluster: Cluster detected events

Description Usage Arguments Details Value References See Also Examples

View source: R/eventCluster.R

Description

This function groups the detected events into clusters.

Usage

1
eventCluster(events, k0)

Arguments

events

an object of class ‘events’.

k0

the number of clusters.

Details

The clustering is based on statistical characteristics of event. Each extracted event is first described using a feature vector, and then the events are clustered according to the Euclidean distances among the feature vectors. Note that before clustering, we apply principal component analysis (PCA) to the feature vectors to reduce the correlation as well as the dimension of the feature space.

Value

a list consisting of:

cl

a vector indicating which cluster each event belongs to.

center

a matrix which gives cluster centroids.

pca

PCA results for characteristics of the detected events.

References

Xiaozhe Wang, Kate Smith-Miles and Rob Hyndman (2005). Characteristic-Based Clustering for Time Series Data. Data Mining and Knowledge Discovery. 13(3), 335-364. http://dx.doi.org//10.1007/s10618-005-0039-x

Yanfei Kang, Danijel Belusic, Kate Smith-Miles (2014). Detecting and Classifying Events in Noisy Time Series. J. Atmos. Sci., 71, 1090-1104. http://dx.doi.org/10.1175/JAS-D-13-0182.1.

Gregory S. Poulos, William Blumen, David C. Fritts, Julie K. Lundquist, Jielun Sun, Sean P. Burns, Carmen Nappo, Robert Banta, Rob Newsom, Joan Cuxart, Enric Terradellas, Ben Balsley, and Michael Jensen. CASES-99: A comprehensive investigation of the stable nocturnal boundary layer (2002). Bulletin of the American Meteorological Society, 83(4):555-581.

See Also

measures

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##################################
#   An artificial example
##################################
set.seed(123)
n <- 128
types <- c('box','rc','cr','sine')
shapes <- matrix(NA,20,n)
for (i in 1:20){
  shapes[i,] <- cbfs(type=types[sample(1:4,1)])
}
whitenoise <- ts2mat(rnorm(128*20),128)
# generate x which randomly combine the four types of events with each two of them
# separated by noise
x <- c(rnorm(128),t(cbind(shapes,whitenoise)))
## Not run: 
plot(x,ty='l')

## End(Not run)
# specify a sliding window size
w <- 128
# specify a significant level
alpha <- 0.05
# event detection
## Not run: 
events <- eventDetection(x,w,'white',parallel=FALSE,alpha, 'art')
# clustering
cc <- eventCluster(events,4)
myclkm <- cc$cl

## End(Not run)
##################################
#   CASES-99 dataset (9.5m)
##################################
# a sliding window length chosen by the user
w <- 120
# specify a significant level
alpha <- 0.05
data(CASES99)
## Not run: 
CASESevents <- eventDetection(CASES99,w,'red',parallel=FALSE,0.05,'real')
cc <- eventCluster(CASESevents,3)
cc$center
myclkm <- cc$cl
# visualise the clustering in 2-dimension PCA space
pc.cr <- cc$pca
pca.dim1 <- pc.cr$scores[,1]
pca.dim2 <- pc.cr$scores[,2]
plot(pca.dim1,pca.dim2,col=myclkm+1,main='PCA plots for k-means clustering',pch=16)

## End(Not run)

TED documentation built on May 2, 2019, 4:26 a.m.