Remove spikes from time series data using running median and a threshold.
Usage
despike(x, k = 7, thresh = 6)
Arguments
- x
A numeric vector containing the time series data.
- k
The window size for the running median (default: 7).
- thresh
The threshold for identifying spikes (default: 6).
Value
A numeric vector with the spikes removed.