tsEvaTransformSeriesToStatSeasonal_ciPercentile {RtsEva} | R Documentation |
tsEvaTransformSeriesToStatSeasonal_ciPercentile
Description
This function decomposes a time series into a season-dependent trend and a season-dependent standard deviation. The season-dependent amplitude is given by a seasonal factor multiplied by a slowly varying percentile.
Usage
tsEvaTransformSeriesToStatSeasonal_ciPercentile(
timeStamps,
series,
timeWindow,
percentile
)
Arguments
timeStamps |
A vector of time stamps for the time series. |
series |
The original time series. |
timeWindow |
The length of the moving window used for trend estimation. |
percentile |
The percentile value used for computing the slowly varying percentile. |
Value
A list containing the following components:
runningStatsMulteplicity
The size of each sample used to compute the average
stationarySeries
The transformed stationary series
trendSeries
The trend series
trendSeriesNonSeasonal
The non-seasonal trend series
stdDevSeries
The season-dependent standard deviation series
stdDevSeriesNonSeasonal
The non-seasonal standard deviation series
trendError
The error on the trend
stdDevError
The error on the standard deviation
statSer3Mom
The 3rd moment of the transformed stationary series
statSer4Mom
The 4th moment of the transformed stationary series
nonStatSeries
The original non-stationary series
Regime
The regime of the trend seasonality
timeStamps
The time stamps
trendNonSeasonalError
The error on the non-seasonal trend
stdDevNonSeasonalError
The error on the non-seasonal standard deviation
trendSeasonalError
The error on the seasonal trend
stdDevSeasonalError
The error on the seasonal standard deviation
this function decomposes the series into a season-dependent trend and a
season-dependent standard deviation. The season-dependent standard deviation is given by a seasonal factor multiplied by a slowly varying standard deviation. transformation non stationary -> stationary x(t) = (y(t) - trend(t) - ssn_trend(t))/(stdDev(t)*ssn_stdDev(t)) transformation stationary -> non stationary y(t) = stdDev(t)*ssn_stdDev(t)*x(t) + trend(t) + ssn_trend(t) trasfData.trendSeries = trend(t) + ssn_trend(t) trasfData.stdDevSeries = stdDev(t)*ssn_stdDev(t)
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
percentile <- 90
result <- tsEvaTransformSeriesToStatSeasonal_ciPercentile(timeStamps,
series, timeWindow, percentile)
plot(result$trendSeries)