| 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:
runningStatsMulteplicityThe size of each sample used to compute the average
stationarySeriesThe transformed stationary series
trendSeriesThe trend series
trendSeriesNonSeasonalThe non-seasonal trend series
stdDevSeriesThe season-dependent standard deviation series
stdDevSeriesNonSeasonalThe non-seasonal standard deviation series
trendErrorThe error on the trend
stdDevErrorThe error on the standard deviation
statSer3MomThe 3rd moment of the transformed stationary series
statSer4MomThe 4th moment of the transformed stationary series
nonStatSeriesThe original non-stationary series
RegimeThe regime of the trend seasonality
timeStampsThe time stamps
trendNonSeasonalErrorThe error on the non-seasonal trend
stdDevNonSeasonalErrorThe error on the non-seasonal standard deviation
trendSeasonalErrorThe error on the seasonal trend
stdDevSeasonalErrorThe 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)