| 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.
runningStatsMulteplicityThe size of the moving window used for trend estimation
stationarySeriesThe transformed stationary series
trendSeriesThe trend component of the transformed series
trendSeriesNonSeasonalThe trend component of the original series without seasonality
stdDevSeriesThe standard deviation component of the transformed series
stdDevSeriesNonSeasonalThe standard deviation component of the original series without seasonality
trendNonSeasonalErrorThe error on the non-seasonal trend component
stdDevNonSeasonalErrorThe error on the non-seasonal standard deviation component
trendSeasonalErrorThe error on the seasonal trend component
stdDevSeasonalErrorThe error on the seasonal standard deviation component
trendErrorThe overall error on the trend component
stdDevErrorThe overall error on the standard deviation component
RegimeThe estimated regime of the trend seasonality
timeStampsThe input timestamps
nonStatSeriesThe original non-stationary series
statSer3MomThe third moment of the transformed stationary series
statSer4MomThe 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)