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
)
[data.frame
]
Dataset with named columns. The names correspond to predictors and responses.
[character
]
Character vector of predictor variables.
[character
]
Character vector of response variables.
[list
]
Named list of script variables set via the Cornerstone "Script Variables" menu.
For details see below.
[logical(1)
]
If FALSE
the function returns TRUE
invisibly.
If TRUE
, it returns a list
of results.
Default is FALSE
.
Logical [TRUE
] invisibly and outputs to Cornerstone or,
if return.results = TRUE
, list
of
resulting data.frame
objects:
contains grouped data according to pattern and seasonal, trend and irregular component for each variable.
contains original data and indicators for potential problems.
The following script variable is summarized in scriptvars
list:
[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
.
# 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