Simulate random coefficients and create a multivariate functional data object of class `mfd`.

data_sim_mfd(nobs = 5, nbasis = 5, nvar = 2, seed)

Arguments

nobs

Number of functional observations to be simulated.

nbasis

Number of basis functions.

nvar

Number of functional covariates.

seed

Deprecated: use set.seed() before calling the function for reproducibility.

Value

A simulated object of class `mfd`.

Examples

library(funcharts)
data_sim_mfd()
#> $coefs
#> , , var1
#> 
#>            rep1       rep2       rep3       rep4       rep5
#> [1,] -1.8115196 -0.7410517  1.0317418  0.4482356  2.3354763
#> [2,]  0.1009284 -0.3230369  0.6082947 -1.2165843 -1.2811748
#> [3,]  1.3370177  0.6422774  0.1086859  0.3880983 -0.4227795
#> [4,]  1.1357744 -0.8989071  0.3142596  0.9384884  1.2421352
#> [5,] -1.2760091  0.7134635 -0.9458076  0.7323917 -1.9814837
#> 
#> , , var2
#> 
#>            rep1       rep2       rep3        rep4        rep5
#> [1,] -1.1360112  0.2110865 -0.8132533  1.49001553 -1.59942549
#> [2,] -1.6127452 -1.3383927 -2.9536557  0.89269664 -0.02507674
#> [3,] -0.5119996  0.6677481 -1.1564257  0.59136508  0.33050310
#> [4,] -0.1997933 -1.2626061 -0.7194822 -0.25362252 -0.41220807
#> [5,] -0.6338169 -0.3427665  1.1316581 -0.09902294 -0.05439122
#> 
#> 
#> $basis
#> $call
#> basisfd(type = type, rangeval = rangeval, nbasis = nbasis, params = params, 
#>     dropind = dropind, quadvals = quadvals, values = values, 
#>     basisvalues = basisvalues)
#> 
#> $type
#> [1] "bspline"
#> 
#> $rangeval
#> [1] 0 1
#> 
#> $nbasis
#> [1] 5
#> 
#> $params
#> [1] 0.5
#> 
#> $dropind
#> NULL
#> 
#> $quadvals
#> NULL
#> 
#> $values
#> list()
#> 
#> $basisvalues
#> list()
#> 
#> $names
#> [1] "bspl4.1" "bspl4.2" "bspl4.3" "bspl4.4" "bspl4.5"
#> 
#> $B
#>              [,1]         [,2]        [,3]         [,4]         [,5]
#> [1,] 0.0714285714 0.0437500000 0.008928571 0.0008928571 0.0000000000
#> [2,] 0.0437500000 0.1107142857 0.069642857 0.0250000000 0.0008928571
#> [3,] 0.0089285714 0.0696428571 0.092857143 0.0696428571 0.0089285714
#> [4,] 0.0008928571 0.0250000000 0.069642857 0.1107142857 0.0437500000
#> [5,] 0.0000000000 0.0008928571 0.008928571 0.0437500000 0.0714285714
#> 
#> attr(,"class")
#> [1] "basisfd"
#> 
#> $fdnames
#> $fdnames[[1]]
#> [1] "arg"
#> 
#> $fdnames[[2]]
#> [1] "rep1" "rep2" "rep3" "rep4" "rep5"
#> 
#> $fdnames[[3]]
#> [1] "var1" "var2"
#> 
#> 
#> attr(,"class")
#> [1] "mfd" "fd"