Singular spectrum analysis
Arguments
- y
A time series or a vector.
- L
The window length.
- groups
The number of eigentriples for reconstruction.
Examples
s<- ssa(AirPassengers[1:20], L=10, groups=5)
s$approximation
#> [1] 110.9834 122.9300 129.7799 124.4868 125.0599 136.6269 145.7690 146.6196
#> [9] 137.1660 119.3853 106.9202 110.2286 119.7662 129.4375 136.1734 133.3477
#> [17] 130.3966 146.7139 168.4876 172.1838
s$residual
#> [1] 1.016600 -4.930034 2.220079 4.513240 -4.059871 -1.626929 2.230957
#> [8] 1.380418 -1.166037 -0.385348 -2.920188 7.771408 -4.766184 -3.437535
#> [15] 4.826560 1.652261 -5.396551 2.286126 1.512377 -2.183819
AirPassengers[1:20] - (s$approximation + s$residual)
#> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0