tsEvaTransformSeriesToStationaryMultiplicativeSeasonality {RtsEva} | R Documentation |
tsEvaTransformSeriesToStationaryMultiplicativeSeasonality
Description
This function decomposes a time series into a season-dependent trend and a season-dependent standard deviation.It performs a transformation from non-stationary to stationary.
Usage
tsEvaTransformSeriesToStationaryMultiplicativeSeasonality(
timeStamps,
series,
timeWindow,
seasonalityVar = TRUE
)
Arguments
timeStamps |
A vector of timestamps for the time series data. |
series |
A vector of the time series data. |
timeWindow |
The size of the moving window used for trend estimation. |
seasonalityVar |
A logical value indicating whether to consider a time varying seasonality (30 years moving average) or a static seasonal cycle in the transformation. Default is TRUE. |
Value
A list containing the transformed data and various statistics and errors.
runningStatsMulteplicity
The size of the moving window used for trend estimation
stationarySeries
The transformed stationary series
trendSeries
The trend component of the transformed series
trendSeriesNonSeasonal
The trend component of the original series without seasonality
stdDevSeries
The standard deviation component of the transformed series
stdDevSeriesNonSeasonal
The standard deviation component of the original series without seasonality
trendNonSeasonalError
The error on the non-seasonal trend component
stdDevNonSeasonalError
The error on the non-seasonal standard deviation component
trendSeasonalError
The error on the seasonal trend component
stdDevSeasonalError
The error on the seasonal standard deviation component
trendError
The overall error on the trend component
stdDevError
The overall error on the standard deviation component
Regime
The estimated regime of the trend seasonality
timeStamps
The input timestamps
nonStatSeries
The original non-stationary series
statSer3Mom
The third moment of the transformed stationary series
statSer4Mom
The fourth moment of the transformed stationary series
transformation non stationary -> stationary
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
TrendTh <- NA
result <- tsEvaTransformSeriesToStationaryMultiplicativeSeasonality(timeStamps,
series, timeWindow,seasonalityVar=FALSE)
plot(result$trendSeries)