| 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:
runningStatsMulteplicityThe multiplicity of running statistics.
stationarySeriesThe stationary series after removing the trend.
trendSeriesThe trend component of the series.
trendSeriesNonSeasonalNULL (not used).
trendErrorThe error on the trend component.
stdDevSeriesThe standard deviation series.
stdDevSeriesNonSeasonalNULL (not used).
stdDevErrorThe error on the standard deviation series.
timeStampsThe time stamps.
nonStatSeriesThe original non-stationary series.
statSer3MomThe running mean of the third moment of the stationary series.
statSer4MomThe 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)