Define matrix A of the functional model

create_A_matrix(t_nogap, jumps, n_seasonal)

Arguments

t_nogap

A vector specifying the index of the time series.

jumps

A vector specifying the time at which there is a mean shift of the time series. Should be specified to NULL if there is not presence of offsets in the signal.

n_seasonal

An integer specifying the number of sinusoidal signals in the time series.

Value

Matrix A in order to compute the functional component of the model in a linear fashion

Examples

n= 10*365
jump_vec <- c(200, 300, 500)
nbr_sin = 2
A <- create_A_matrix(1:n, jump_vec, n_seasonal = nbr_sin)
head(A)
#>      [,1]    [,2]       [,3]      [,4]       [,5]       [,6] [,7] [,8] [,9]
#> [1,]    1 -1824.5 -0.6708865 0.7415600 -0.9950053 0.09982256    0    0    0
#> [2,]    1 -1823.5 -0.6580313 0.7529906 -0.9909827 0.13398974    0    0    0
#> [3,]    1 -1822.5 -0.6449813 0.7641984 -0.9857873 0.16799833    0    0    0
#> [4,]    1 -1821.5 -0.6317404 0.7751800 -0.9794251 0.20180808    0    0    0
#> [5,]    1 -1820.5 -0.6183126 0.7859322 -0.9719037 0.23537897    0    0    0
#> [6,]    1 -1819.5 -0.6047019 0.7964519 -0.9632319 0.26867128    0    0    0
A <- create_A_matrix(1:n, jumps = NULL, n_seasonal = nbr_sin)
head(A)
#>      [,1]    [,2]       [,3]      [,4]       [,5]       [,6]
#> [1,]    1 -1824.5 -0.6708865 0.7415600 -0.9950053 0.09982256
#> [2,]    1 -1823.5 -0.6580313 0.7529906 -0.9909827 0.13398974
#> [3,]    1 -1822.5 -0.6449813 0.7641984 -0.9857873 0.16799833
#> [4,]    1 -1821.5 -0.6317404 0.7751800 -0.9794251 0.20180808
#> [5,]    1 -1820.5 -0.6183126 0.7859322 -0.9719037 0.23537897
#> [6,]    1 -1819.5 -0.6047019 0.7964519 -0.9632319 0.26867128