mtoutlier: Martin-Thomson outlier removal

Description Usage Arguments Value Examples

View source: R/mtoutlier.R

Description

Martin-Thomson filter-cleaning of a (presumed) AR timeseries

Usage

1
mtoutlier(y, ar = c(1, 10), tol = 3, set0 = TRUE, ...)

Arguments

y

timeseries; no NA allowed

ar

c(min, max) AR order in modeling; defaults to c(1, 10)

tol

outlier threshold value; defaults to 3 (Pearson's Rule)

set0

replace outlier with 0 (TRUE, default) or scaled tol (FALSE)

...

other arguments passed to arima

Value

cleaned timeseries

Examples

1
2
3
4
5
6
7
y <- arimaSim( 200, ar = c( 0.5, -0.1 ) )
# Add a few outliers
o <- floor( runif( 5, min = 5, max = 195 ) )
y[o] <- runif( 5, min = 4, max = 8 )
yc <- mtoutlier( y )
plot( y )
lines( yc, col = "red" )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.