TSrepr (version 1.0.4)

repr_gam: GAM regression coefficients as representation

Description

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

Usage

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

Value

the numeric vector of GAM regression coefficients

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).

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<U+00E1> M (2018) Clustering-based forecasting method for individual consumers electricity load using time series representations. Open Comput Sci, 8(1):38<U+2013>50, DOI: 10.1515/comp-2018-0006

See Also

repr_lm, repr_exp, gam

Examples

Run this code
# NOT RUN {
repr_gam(rnorm(96), freq = 24)

# }

Run the code above in your browser using DataLab