# 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.
Run the code above in your browser using DataLab