smooth_ts: Smooth time series

Description Usage Arguments Details Value See Also Examples

View source: R/smooth_ts.R

Description

Smooth the time series by impute the outlers.

Usage

1
2
3
4
5
6
smooth_ts(
  data,
  vars = c("date", "ts"),
  par = list(lambda = 1.5, s = 7),
  weekday.sep = FALSE
)

Arguments

data

A data frame includes dates and time series columns

vars

A character vector with variable names with respect to date and time series

par

A list of parameters. lambda = 1.5, the "distance" describes the outlier and the main population. s = 7, the most obvious seasonality of the time series is 7 (days).

weekday.sep

A logical value indicating whether model each weekday time series separately.

Details

Use find_outlier to find the outliers and use one seasonal exponential smoothing to imput outliers

Value

A list with:

See Also

find_outlier

Examples

1
2
3
data(tickets)
smooth.dat = smooth_ts(tickets, vars = c("date", "ticket"))
cbind(tickets, smooth.dat)

placeboo/amplify documentation built on Oct. 6, 2020, 9:04 a.m.