tsEstimateAverageSeasonality {RtsEva}R Documentation

Estimate Average Seasonality

Description

This function estimates the average seasonality of a time series based on the given parameters.

Usage

tsEstimateAverageSeasonality(timeStamps, seasonalitySeries, timeWindow)

Arguments

timeStamps

The time stamps of the time series.

seasonalitySeries

The series representing the seasonality.

timeWindow

The time window used for averaging the seasonality.

Value

A list containing the estimated regime and the seasonality series:

regime

The estimated regime of the time series.

Seasonality

A data frame containing the average and varying seasonality series.

averageSeasonalitySeries

The average seasonality series.

varyingSeasonalitySeries

The varying seasonality series.

Examples

timeAndSeries <- ArdecheStMartin
timeStamps <- ArdecheStMartin[,1]
series  <- ArdecheStMartin[,2]
timeWindow <- 30*365  # 30 years
rs <- tsEvaDetrendTimeSeries(timeStamps, series, timeWindow)
nRunMn <- rs@nRunMn
cat("computing trend seasonality ...\n")
seasonalitySeries <- rs@detrendSeries
result <- tsEstimateAverageSeasonality(timeStamps, seasonalitySeries, timeWindow=rs@nRunMn)
plot(result$regime, type = "l", xlab = "Day", ylab = "Regime", main = "Estimated Regime")
plot(result$Seasonality$averageSeasonalitySeries, type = "l", xlab = "Day",
ylab = "Seasonality", main = "Average Seasonality")
plot(result$Seasonality$varyingSeasonalitySeries, type = "l", xlab = "Day",
ylab = "Seasonality", main = "Varying Seasonality")

[Package RtsEva version 1.0.0 Index]