Simulate random coefficients and create a multivariate functional data object of class `mfd`. It is mainly for internal use, to check that the package functions work.

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.10362887  0.4277242 -1.4200321 -1.1743309 -1.3785552
#> [2,] -0.27179484  1.4447899 -0.1124185  1.4278521  0.4269738
#> [3,] -0.05418921  1.9617607 -0.7836197 -0.6696932 -0.6522580
#> [4,] -0.06695518  0.4317132 -0.2729055  2.6728888 -0.6290876
#> [5,] -0.05248127 -0.6005361  0.9306487 -0.1469386  1.2915971
#> 
#> , , var2
#> 
#>            rep1        rep2       rep3       rep4        rep5
#> [1,] -1.3182278  2.13879953 -0.2614760 -2.0205621  0.73742143
#> [2,] -1.0732330  0.22517828  1.4444713  1.7406258  0.30134386
#> [3,]  2.1775680 -1.87540752 -0.6168936 -1.3643650 -1.06808329
#> [4,] -0.7479164 -0.06095322  0.4475044 -0.9714751  1.09508655
#> [5,]  1.7766253  0.29862472 -2.3145775 -1.2039372  0.02186879
#> 
#> 
#> $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] "t"
#> 
#> $fdnames[[2]]
#> [1] "rep1" "rep2" "rep3" "rep4" "rep5"
#> 
#> $fdnames[[3]]
#> [1] "var1" "var2"
#> 
#> 
#> attr(,"class")
#> [1] "mfd" "fd"