repr_gam: GAM regression coefficients as representation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/model_based_repr.R

Description

The repr_gam computes seasonal GAM regression coefficients. Additional exogenous variables can be also added.

Usage

1
repr_gam(x, freq = NULL, xreg = NULL)

Arguments

x

the numeric vector (time series)

freq

the frequency of the time series. Can be vector of two frequencies (seasonalities) or just an integer of one frequency.

xreg

the numeric vector or the data.frame with additional exogenous regressors

Details

This model-based representation method extracts regression coefficients from a GAM (Generalized Additive Model). The extraction of seasonal regression coefficients is automatic. The maximum number of seasonalities is 2 so it is possible to compute representation for double-seasonal time series. The first set seasonality (frequency) is main, so for example if we have hourly time series (freq = c(24, 24*7)), the number of extracted daily seasonal coefficients is 24 and the number of weekly seasonal coefficients is 7, because the length of second seasonality representation is always freq_1 / freq_2. The smooth function for seasonal variables is set to cubic regression spline. There is also possibility to add another independent variables (xreg).

Value

the numeric vector of GAM regression coefficients

Author(s)

Peter Laurinec, <tsreprpackage@gmail.com>

References

Laurinec P, Lucka M (2016) Comparison of representations of time series for clustering smart meter data. In: Lecture Notes in Engineering and Computer Science: Proceedings of The World Congress on Engineering and Computer Science 2016, pp 458-463

Laurinec P, Loderer M, Vrablecova P, Lucka M, Rozinajova V, Ezzeddine AB (2016) Adaptive time series forecasting of energy consumption using optimized cluster analysis. In: Data Mining Workshops (ICDMW), 2016 IEEE 16th International Conference on, IEEE, pp 398-405

Laurinec P, Lucká M (2018) Clustering-based forecasting method for individual consumers electricity load using time series representations. Open Comput Sci, 8(1):38–50, DOI: 10.1515/comp-2018-0006

See Also

repr_lm, repr_exp, gam

Examples

1
repr_gam(rnorm(96), freq = 24)

TSrepr documentation built on July 13, 2020, 9:07 a.m.