trend_season: Trend and aeasonality estimation of a univariate time series

View source: R/trend_season.R

trend_seasonR Documentation

Trend and aeasonality estimation of a univariate time series

Description

Estimate a trend and seasonaliyt for a time series. Available functions:

  • trend_season to generate an estimate

  • print to print the estimate

  • summary to summarize the etsimate result

  • plot to plot the time series, its estimation and the residuals

  • coef to extract the coefficients if a seasonality estimation was done

  • residuals to extract the residuals of the model

  • fitted to the fitted values

Usage

trend_season(t, ...)

## Default S3 method:
trend_season(
  t,
  trend = c("constant", "linear", "exponential"),
  season = c("none", "additive", "multiplicative"),
  ...
)

## S3 method for class 'trend_season'
print(x, ...)

## S3 method for class 'trend_season'
summary(object, ...)

## S3 method for class 'trend_season'
plot(x, y, which = 1, ...)

Arguments

t

ts: time series object

...

unused

trend

character: trend method, either none (default), linear or exponential

season

character: seasonality method, either none (default), additive or multiplicative

x, object

trend_season: estimated time series

y

unused

which

integer: what to plot, 1 time series and estimation (default) or 2 residuals

Value

trend_season returns a trend_season object with

  • call the function call

  • ts the input time series

  • trend the trend estimation (ts object)

  • trend.residuals the residuals of the trend estimation (ts object)

  • season the trend and season estimation (ts object)

  • season.residuals the residuals of the trend and season estimation (ts object)

  • coefficients the coefficients used in the seasonality estimation

  • residuals the residuals of the model

  • fitted.values the fitted values of the model

Examples

tts <- trend_season(austres, "linear")
print(tts)
summary(tts)
plot(tts)
plot(tts, which=2)
residuals(tts)
fitted(tts)
coef(tts)  # if NULL then no seasonality was estimated

sigbertklinke/smvgraph documentation built on Dec. 10, 2022, 9:13 a.m.