Decompose a time series according to its pattern into seasonal, trend and irregular component (remainder) using robust Loess

tsFeatureExtraction(
  dataset = cs.in.dataset(),
  preds = cs.in.predictors(),
  resps = cs.in.responses(),
  scriptvars = cs.in.scriptvars(),
  return.results = FALSE
)

Arguments

dataset

[data.frame]
Dataset with named columns. The names correspond to predictors and responses.

preds

[character]
Character vector of predictor variables.

resps

[character]
Character vector of response variables.

scriptvars

[list]
Named list of script variables set via the Cornerstone "Script Variables" menu. For details see below.

return.results

[logical(1)]
If FALSE the function returns TRUE invisibly. If TRUE, it returns a list of results. Default is FALSE.

Value

Logical [TRUE] invisibly and outputs to Cornerstone or, if return.results = TRUE, list of resulting data.frame objects:

featureSum

contains grouped data according to pattern and seasonal, trend and irregular component for each variable.

dirtyData

contains original data and indicators for potential problems.

Details

The following script variable is summarized in scriptvars list:

pattern

[character(1)]
time unit and frequency in the unit.
1. for multiple years data: monthly over years, quarterly over years
2. for one year data: hourly over days, daily over weeks,daily over months, weekly over months,monthly over quarters
3. for one day/hour data:secondly over minutes, minutely over hours
Default is daily over months.

Examples

# convert R ts Object to data frame
airPassengers <- data.frame(X = as.matrix(AirPassengers),
  date = as.POSIXct(zoo::as.yearmon(time(AirPassengers))))

tsFeatureExtraction(airPassengers,
  preds = names(airPassengers)[1],
  resps = names(airPassengers)[2],
  scriptvars = list(pattern="monthly over years"),
  return.results = FALSE
)

#> NULL