Learn R Programming

timeSeries (version 4041.111)

splits: splits

Description

Searches for outlier splits in a "timeSeries" object.

Usage

splits(x, sd = 3, complement = TRUE, ...)

Value

a "timeSeries" object

Arguments

x

a "timeSeries" object.

sd

numeric(1); deviations of how many standard deviations to consider too big? Can be fractional. E.g., 5 means that values larger or smaller than five times the standard deviation of the series will be detected.

complement

a logical flag, should the outlier series or its complements be returned?

...

arguments to be passed.

Details

This function finds splits in financial price or index series. If a price or index is splitted we observe a big jump of several standard deviations in the returns, which is identified usually as an outlier.

See Also

returns, cumulated, drawdowns, spreads, midquotes, index2wealth

Examples

Run this code
## Create a Return Series with a Split - 
   data <- runif(12, -1, 1)
   data[6] <- 20
   x <- timeSeries(data, timeCalendar(), units="RUNIF")
   x
   
## Search for the Split:
   splits(x, sd=3, complement=TRUE)
   splits(x, sd=3, complement=FALSE)

Run the code above in your browser using DataLab