tsEvaTransformSeriesToStationaryPeakTrend {RtsEva} | R Documentation |
tsEvaTransformSeriesToStationaryPeakTrend
Description
tsEvaTransformSeriesToStationaryPeakTrend
transforms a time series to a stationary one by focusing on extremes.
The trend and slowly varying amplitude are computed on values above a
threshold defined by the user or automatically
with the function tsEvaFindTrendThreshold
.
Usage
tsEvaTransformSeriesToStationaryPeakTrend(
timeStamps,
series,
timeWindow,
TrendTh
)
Arguments
timeStamps |
A vector of time stamps corresponding to the observations in the series. |
series |
A vector of the time series data. |
timeWindow |
The size of the time window used for detrending. |
TrendTh |
The threshold for fitting the trend on the means above a given quantile. Default is 0.5. |
Value
A list containing the following components:
runningStatsMulteplicity
The multiplicity of running statistics.
stationarySeries
The stationary series after removing the trend.
trendSeries
The trend component of the series.
trendSeriesNonSeasonal
NULL (not used).
trendError
The error on the trend component.
stdDevSeries
The standard deviation series.
stdDevSeriesNonSeasonal
NULL (not used).
stdDevError
The error on the standard deviation series.
timeStamps
The time stamps.
nonStatSeries
The original non-stationary series.
statSer3Mom
The running mean of the third moment of the stationary series.
statSer4Mom
The running mean of the fourth moment of the stationary series.
See Also
Examples
timeAndSeries <- ArdecheStMartin
timeStamps <- ArdecheStMartin[,1]
series <- ArdecheStMartin[,2]
#select only the 5 latest years
yrs <- as.integer(format(timeStamps, "%Y"))
tokeep <- which(yrs>=2015)
timeStamps <- timeStamps[tokeep]
series <- series[tokeep]
timeWindow <- 365 # 1 year
TrendTh <- NA
result <- tsEvaTransformSeriesToStationaryPeakTrend(timeStamps,
series, timeWindow, TrendTh)
plot(result$trendSeries)