getOTevents | R Documentation |
Definition of over-threshold events, i.e continuous runs of over-threshold values, with successive runs being potentially merged according to some independence constraints. NA's are treated as below-threshold values
getOTevents(x, threshold, minIEduration = 0, IEminval = threshold)
x |
numeric vector, values. |
threshold |
numeric, threshold value. |
minIEduration |
numeric, minimum inter-event duration: two runs separated by less than minIEduration steps are merged. |
IEminval |
numeric, minimum inter-event value: if the series does not go below IEminval between two events, they are merged. |
An integer vector with same size as x, containing the index of over-threshold events (and 0 for values below the threshold).
x <- as.numeric(arima.sim(n=365,list(ar=c(0.9)))) # No independence constraint events <- getOTevents(x=x,threshold=2) plot(x,type='l',col='gray') for(i in 1:max(events)){foo=x;foo[events!=i]=NA;points(foo,col=i,pch=19)} # At least 5 time steps between events events <- getOTevents(x=x,threshold=2,minIEduration=5) plot(x,type='l',col='gray') for(i in 1:max(events)){foo=x;foo[events!=i]=NA;points(foo,col=i,pch=19)} # At least 5 time steps between events and values go back below 0 events <- getOTevents(x=x,threshold=2,minIEduration=5,IEminval=0) plot(x,type='l',col='gray') for(i in 1:max(events)){foo=x;foo[events!=i]=NA;points(foo,col=i,pch=19)}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.