This function returns the tensor product of two Multivariate Functional Data objects. Each object must contain only one replication.
tensor_product_mfd(mfdobj1, mfdobj2 = NULL)
A multivariate functional data object, of class mfd
,
having only one functional observation.
A multivariate functional data object, of class mfd
,
having only one functional observation.
If NULL, it is set equal to mfdobj1
. Default is NULL.
An object of class bifd
.
If we denote with x(s)=(x_1(s),...,x_p(s))
the vector of p functions represented by mfdobj1
and
with y(t)=(y_1(t),...,y_q(t)) the vector of q functions
represented by mfdobj2
,
the output is the
vector of pq bivariate functions
f(s,t)=(x_1(s)y_1(t),...,x_1(s)y_q(t), ...,x_p(s)y_1(t),...,x_p(s)y_q(t)).
library(funcharts)
mfdobj1 <- data_sim_mfd(nobs = 1, nvar = 3)
mfdobj2 <- data_sim_mfd(nobs = 1, nvar = 2)
tensor_product_mfd(mfdobj1)
#> $coefs
#> , , s.rep1 t.rep1, var1 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 1.3570408 1.6035360 -0.19533387 -1.8459676 -1.9546080
#> bspl4.2 1.6035360 1.8948051 -0.23081465 -2.1812724 -2.3096464
#> bspl4.3 -0.1953339 -0.2308147 0.02811656 0.2657105 0.2813483
#> bspl4.4 -1.8459676 -2.1812724 0.26571050 2.5110493 2.6588316
#> bspl4.5 -1.9546080 -2.3096464 0.28134831 2.6588316 2.8153113
#>
#> , , s.rep1 t.rep1, var2 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -0.56882704 -1.0235849 0.16876777 -0.54631502 -0.43828458
#> bspl4.2 -0.67214979 -1.2095106 0.19942305 -0.64554864 -0.51789536
#> bspl4.3 0.08187756 0.1473359 -0.02429261 0.07863715 0.06308714
#> bspl4.4 0.77376915 1.3923712 -0.22957294 0.74314629 0.59619368
#> bspl4.5 0.81930764 1.4743162 -0.24308395 0.78688254 0.63128135
#>
#> , , s.rep1 t.rep1, var3 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.8865517 0.34166541 0.15707941 -1.623720 1.2080098
#> bspl4.2 1.0475866 0.40372611 0.18561159 -1.918656 1.4274349
#> bspl4.3 -0.1276112 -0.04917968 -0.02261017 0.233720 -0.1738822
#> bspl4.4 -1.2059666 -0.46476368 -0.21367339 2.208729 -1.6432424
#> bspl4.5 -1.2769411 -0.49211633 -0.22624867 2.338718 -1.7399519
#>
#> , , s.rep1 t.rep1, var1 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -0.5688270 -0.6721498 0.08187756 0.7737691 0.8193076
#> bspl4.2 -1.0235849 -1.2095106 0.14733588 1.3923712 1.4743162
#> bspl4.3 0.1687678 0.1994230 -0.02429261 -0.2295729 -0.2430840
#> bspl4.4 -0.5463150 -0.6455486 0.07863715 0.7431463 0.7868825
#> bspl4.5 -0.4382846 -0.5178954 0.06308714 0.5961937 0.6312814
#>
#> , , s.rep1 t.rep1, var2 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.23843367 0.4290533 -0.07074192 0.22899736 0.18371454
#> bspl4.2 0.42905325 0.7720667 -0.12729768 0.41207295 0.33058805
#> bspl4.3 -0.07074192 -0.1272977 0.02098873 -0.06794222 -0.05450707
#> bspl4.4 0.22899736 0.4120729 -0.06794222 0.21993451 0.17644381
#> bspl4.5 0.18371454 0.3305881 -0.05450707 0.17644381 0.14155313
#>
#> , , s.rep1 t.rep1, var3 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -0.3716135 -0.14321495 -0.06584254 0.6806103 -0.5063582
#> bspl4.2 -0.6687057 -0.25771042 -0.11848141 1.2247351 -0.9111742
#> bspl4.3 0.1102556 0.04249107 0.01953511 -0.2019332 0.1502336
#> bspl4.4 -0.3569064 -0.13754704 -0.06323675 0.6536743 -0.4863184
#> bspl4.5 -0.2863304 -0.11034796 -0.05073207 0.5244142 -0.3901519
#>
#> , , s.rep1 t.rep1, var1 var3
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.8865517 1.0475866 -0.12761118 -1.2059666 -1.2769411
#> bspl4.2 0.3416654 0.4037261 -0.04917968 -0.4647637 -0.4921163
#> bspl4.3 0.1570794 0.1856116 -0.02261017 -0.2136734 -0.2262487
#> bspl4.4 -1.6237202 -1.9186555 0.23371998 2.2087286 2.3387185
#> bspl4.5 1.2080098 1.4274349 -0.17388220 -1.6432424 -1.7399519
#>
#> , , s.rep1 t.rep1, var2 var3
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -0.37161345 -0.6687057 0.11025561 -0.35690640 -0.28633035
#> bspl4.2 -0.14321495 -0.2577104 0.04249107 -0.13754704 -0.11034796
#> bspl4.3 -0.06584254 -0.1184814 0.01953511 -0.06323675 -0.05073207
#> bspl4.4 0.68061031 1.2247351 -0.20193324 0.65367433 0.52441425
#> bspl4.5 -0.50635815 -0.9111742 0.15023361 -0.48631841 -0.39015193
#>
#> , , s.rep1 t.rep1, var3 var3
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.5791823 0.22320926 0.10261963 -1.0607728 0.7891902
#> bspl4.2 0.2232093 0.08602192 0.03954826 -0.4088079 0.3041435
#> bspl4.3 0.1026196 0.03954826 0.01818217 -0.1879479 0.1398289
#> bspl4.4 -1.0607728 -0.40880792 -0.18794793 1.9428062 -1.4454023
#> bspl4.5 0.7891902 0.30414353 0.13982887 -1.4454023 1.0753455
#>
#>
#> $sbasis
#> $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"
#>
#> $tbasis
#> $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"
#>
#> $bifdnames
#> $bifdnames[[1]]
#> [1] "bspl4.1" "bspl4.2" "bspl4.3" "bspl4.4" "bspl4.5"
#>
#> $bifdnames[[2]]
#> [1] "bspl4.1" "bspl4.2" "bspl4.3" "bspl4.4" "bspl4.5"
#>
#> $bifdnames[[3]]
#> [1] "s.rep1 t.rep1"
#>
#> $bifdnames[[4]]
#> [1] "var1 var1" "var2 var1" "var3 var1" "var1 var2" "var2 var2" "var3 var2"
#> [7] "var1 var3" "var2 var3" "var3 var3"
#>
#>
#> attr(,"class")
#> [1] "bifd"
tensor_product_mfd(mfdobj1, mfdobj2)
#> $coefs
#> , , s.rep1 t.rep1, var1 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 2.4630333 -0.8949834 0.9507626 0.50803008 -1.0539098
#> bspl4.2 2.9104230 -1.0575497 1.1234608 0.60030956 -1.2453439
#> bspl4.3 -0.3545316 0.1288248 -0.1368538 -0.07312638 0.1517009
#> bspl4.4 -3.3504370 1.2174360 -1.2933119 -0.69106771 1.4336219
#> bspl4.5 -3.5476196 1.2890855 -1.3694269 -0.73173899 1.5179946
#>
#> , , s.rep1 t.rep1, var2 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.8889352 0.39731606 -1.7502058 -0.6154367 -0.63161006
#> bspl4.2 1.0504029 0.46948525 -2.0681162 -0.7272257 -0.74633682
#> bspl4.3 -0.1279543 -0.05719009 0.2519264 0.0885866 0.09091461
#> bspl4.4 -1.2092087 -0.54046465 2.3807856 0.8371718 0.85917219
#> bspl4.5 -1.2803740 -0.57227252 2.5209015 0.8864417 0.90973689
#>
#> , , s.rep1 t.rep1, var3 var1
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -1.0324229 0.3751477 -0.3985285 -0.21294957 0.4417645
#> bspl4.2 -1.8578098 0.6750655 -0.7171385 -0.38319549 0.7949401
#> bspl4.3 0.3063140 -0.1113042 0.1182412 0.06318094 -0.1310690
#> bspl4.4 -0.9915635 0.3603008 -0.3827563 -0.20452183 0.4242811
#> bspl4.5 -0.7954879 0.2890535 -0.3070686 -0.16407890 0.3403821
#>
#> , , s.rep1 t.rep1, var1 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 -0.3726125 -0.16654188 0.7336289 0.25797091 0.2647502
#> bspl4.2 -0.6705035 -0.29968644 1.3201403 0.46420986 0.4764090
#> bspl4.3 0.1105520 0.04941204 -0.2176636 -0.07653851 -0.0785499
#> bspl4.4 -0.3578659 -0.15995078 0.7045947 0.24776140 0.2542724
#> bspl4.5 -0.2871001 -0.12832150 0.5652654 0.19876810 0.2039916
#>
#> , , s.rep1 t.rep1, var2 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 1.6090942 -0.5846907 0.6211311 0.33189493 -0.6885170
#> bspl4.2 0.6201238 -0.2253321 0.2393758 0.12790795 -0.2653454
#> bspl4.3 0.2850996 -0.1035956 0.1100521 0.05880521 -0.1219916
#> bspl4.4 -2.9470572 1.0708614 -1.1376021 -0.60786581 1.2610193
#> bspl4.5 2.1925416 -0.7966958 0.8463493 0.45223795 -0.9381689
#>
#> , , s.rep1 t.rep1, var3 var2
#>
#> bspl4.1 bspl4.2 bspl4.3 bspl4.4 bspl4.5
#> bspl4.1 0.5807394 0.2595657 -1.1434056 -0.40206345 -0.41262946
#> bspl4.2 0.2238093 0.1000332 -0.4406535 -0.15494998 -0.15902198
#> bspl4.3 0.1028955 0.0459899 -0.2025888 -0.07123768 -0.07310977
#> bspl4.4 -1.0636246 -0.4753948 2.0941482 0.73637949 0.75573115
#> bspl4.5 0.7913118 0.3536826 -1.5579972 -0.54784912 -0.56224630
#>
#>
#> $sbasis
#> $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"
#>
#> $tbasis
#> $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"
#>
#> $bifdnames
#> $bifdnames[[1]]
#> [1] "bspl4.1" "bspl4.2" "bspl4.3" "bspl4.4" "bspl4.5"
#>
#> $bifdnames[[2]]
#> [1] "bspl4.1" "bspl4.2" "bspl4.3" "bspl4.4" "bspl4.5"
#>
#> $bifdnames[[3]]
#> [1] "s.rep1 t.rep1"
#>
#> $bifdnames[[4]]
#> [1] "var1 var1" "var2 var1" "var3 var1" "var1 var2" "var2 var2" "var3 var2"
#>
#>
#> attr(,"class")
#> [1] "bifd"