innerProduct {mrct} | R Documentation |
Pairwise inner product for
functions
Description
Calculate all pairwise inner products between elements from supplied to this function. The integral is approximated by the Trapezoidal rule for uniform grids:
whereas is an uniform grid on
such that
and
the step size, i.e.
.
Therefore, it is assumed that the functions are evaluated at the same, equidistant grid.
Usage
innerProduct(grid, data)
Arguments
grid |
A numeric vector of the uniform grid on which the functions are evaluated. |
data |
A numeric matrix. Each function has to be a vector stored in a column of |
Value
Numeric symmetric matrix containing the approximated pairwise inner products between the functions supplied by data
. The entry of the result is the inner product
between the
-th and
-th column of
data
.
Examples
# Create orthogonal fourier basis via `fdapace` package
library(fdapace)
basis <- fdapace::CreateBasis(K = 10,
type = "fourier")
iP <- innerProduct(grid = seq(0, 1, length.out = 50), # default grid in CreateBasis()
data = basis)
round(iP,3)
# Since the basis is orthogonal, the resulting matrix will be the identity matrix.