ts_trend_season: ts_trend_season

View source: R/ts_trend_season.R

ts_trend_seasonR Documentation

ts_trend_season

Description

Estimate a trend and season model from a ts_data object.

Usage

ts_trend_season(ts, trend = NULL, season = NULL)

Arguments

ts

ts_data object

trend

numeric or logical: if trend is TRUE then a linear trend will be estimated otherwise an exponential trend. If trendis numeric this is talen as trend values

season

numeric or logical:

Value

returns an extended ts_data object with list elements:

  • t the time points

  • s the season for the time poins

  • xt the time series values

  • trend the fitted trend values

  • trend.coeff the trend coefficients

  • trend.linear the trend type, if NA then it is unknown

  • season the fitted season values

  • season.t the fitted season values for the time series

  • trend.season the fitted values for trend and season

  • trend.linear the trend type, if NA then it is unknown

  • var the variance of the residuals

  • r.square the R^2 of the final model

Examples

ts <- ts_data(12, trend.coeff= c(sample(0:10, 1), sample(1+(1:10)/20, 1)))
ts_trend_season(ts)

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.