tsEvaTransformSeriesToStationaryTrendAndChangepts_ciPercentile {RtsEva} | R Documentation |
Transform Time Series to Stationary Trend and Change Points with Confidence Intervals
Description
This function takes a time series and transforms it into a stationary trend series with change points and confidence intervals.
Usage
tsEvaTransformSeriesToStationaryTrendAndChangepts_ciPercentile(
timeStamps,
series,
timeWindow,
percentile
)
Arguments
timeStamps |
A vector of time stamps corresponding to the observations in the series. |
series |
The time series data. |
timeWindow |
The size of the sliding window used for detrending the series. |
percentile |
The percentile value used for computing the running percentile of the stationary series. |
Value
A list containing the following elements:
runningStatsMulteplicity
The running statistics multiplicity
stationarySeries
The transformed stationary series
trendSeries
The trend series
trendonlySeries
The trend series without the stationary component
ChpointsSeries2
The trend series with change points
changePoints
The detected change points
trendSeriesNonSeasonal
The trend series without the seasonal component
trendError
The error on the trend
stdDevSeries
The standard deviation series
stdDevSeriesNonStep
The standard deviation series without the step change component
stdDevError
The error on the standard deviation
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
Examples
timeAndSeries <- ArdecheStMartin
#go from six-hourly values to daily max
timeAndSeries <- max_daily_value(timeAndSeries)
timeStamps <- timeAndSeries[,1]
series <- timeAndSeries[,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
percentile <- 90
result <- tsEvaTransformSeriesToStationaryTrendAndChangepts_ciPercentile(timeStamps,
series, timeWindow, percentile)
plot(result$trendSeries)