Inner products of functional data contained in mfd objects.

inprod_mfd(mfdobj1, mfdobj2 = NULL)

Arguments

mfdobj1

A multivariate functional data object of class mfd.

mfdobj2

A multivariate functional data object of class mfd. It must have the same functional variables as mfdobj1. If NULL, it is equal to mfdobj1.

Value

a three-dimensional array of L^2 inner products. The first dimension is the number of functions in argument mfdobj1, the second dimension is the same thing for argument mfdobj2, the third dimension is the number of functional variables. If you sum values over the third dimension, you get a matrix of inner products in the product Hilbert space of multivariate functional data.

Details

Note that L^2 inner products are not calculated for couples of functional data from different functional variables. This function is needed to calculate the inner product in the product Hilbert space in the case of multivariate functional data, which for each observation is the sum of the L^2 inner products obtained for each functional variable.

Examples

library(funcharts)
set.seed(123)
mfdobj1 <- data_sim_mfd()
mfdobj2 <- data_sim_mfd()
inprod_mfd(mfdobj1)
#> , , var1
#> 
#>             rep1       rep2        rep3         rep4         rep5
#> rep1  0.22013526 -0.2893794  0.02787384 -0.220788472 -0.208386512
#> rep2 -0.28937941  0.5374372  0.14012277  0.398243560  0.150788802
#> rep3  0.02787384  0.1401228  0.22577777  0.135926002 -0.218510918
#> rep4 -0.22078847  0.3982436  0.13592600  0.378541141  0.005934849
#> rep5 -0.20838651  0.1507888 -0.21851092  0.005934849  0.507319424
#> 
#> , , var2
#> 
#>             rep1        rep2        rep3        rep4        rep5
#> rep1  0.24032374 -0.04733756 -0.05893029  0.03243801  0.06223961
#> rep2 -0.04733756  0.36266137 -0.04844452  0.33178288  0.01717313
#> rep3 -0.05893029 -0.04844452  0.12076057 -0.22157572 -0.14818322
#> rep4  0.03243801  0.33178288 -0.22157572  0.67198057  0.24126248
#> rep5  0.06223961  0.01717313 -0.14818322  0.24126248  0.19836967
#> 
inprod_mfd(mfdobj1, mfdobj2)
#> , , var1
#> 
#>             rep1        rep2        rep3        rep4        rep5
#> rep1  0.13611413 -0.05254425 -0.23311810  0.18312540 -0.09129140
#> rep2 -0.17927508  0.05862381  0.33175649 -0.26413721 -0.06282078
#> rep3  0.06276960  0.01158441 -0.04004683  0.05229128 -0.25852481
#> rep4 -0.04878113  0.11647660  0.16148217 -0.06063127 -0.12330030
#> rep5 -0.24709763 -0.04018282  0.38477931 -0.45810165  0.43251719
#> 
#> , , var2
#> 
#>             rep1         rep2        rep3         rep4        rep5
#> rep1 -0.08665361 -0.031359929  0.03174048 -0.001426963  0.00568502
#> rep2 -0.13824014  0.075879253  0.20430977  0.121572474  0.19419740
#> rep3  0.03281408  0.008568841  0.08360825  0.089017135  0.20264014
#> rep4 -0.06161998  0.048456200  0.02318809 -0.003369564 -0.33259741
#> rep5 -0.03569104 -0.011414731 -0.14848601 -0.158286911 -0.24898745
#>