spike_median: Modified Hampel Median Filter.

Description Usage Arguments Details Author(s) References Examples

View source: R/outlier.R

Description

Modified Hampel Median Filter.

Usage

1
spike_median(v, w, ypts, w_min = 0, spk = 2, cpp = T)

Arguments

v

numeric vector. Vegetation index values.

w

numeric vector. Initial weights.

ypts

numeric. The number of values per year. Used to determine the moving window size.

w_min

numeric. Specifies the weight that should be assigned to outliers.

spk

numeric. The Spike parameter. the higher, the more values are classified outliers.

Details

#TODO

Author(s)

Sandro Groth

References

Hampel F. R., ”The influence curve and its role in robust estimation,” Journal of the American Statistical Association, 69, 382–393, 1974

Eklundh, L., and Jönsson, P., 2017, TIMESAT 3.3 with seasonal trend decomposition and parallel processing - Software Manual. Lund University, 92 pp.

Examples

1
2
3
4
5
6
7
8
## Create a random normal distribution with outliers.
values <- c(rnorm(19), 50, rnorm(19), -50, rnorm(20))

## set all initial weights to 1
init_weights <- rep(1, 60)

## get the spike filtered weights
filtered_weights <- spike_median(values, init_weights, 20, 0, 2)

SandroGroth/phenoRS documentation built on July 12, 2020, 4:33 a.m.