Is there a way to do Fourier basis smoothing of functional data in R

Viewed 59

I would want to use Fourier Basis in R to smooth my simulated functional data before I calculate the dissimilarity matrix. This is what I have done so far

library(fda)
library(fad.usc)
x<-fdata(func.obs)
y<-create.fourier.basis(rangeval = range(x),nbasis = 50)
z<-smooth.basis(y)

Below is part of the results for my simulated data.

> func.obs[1:5,1:5]
 [,1]      [,2]      [,3]      [,4]       [,5]
[1,]  1.5 1.7818424 1.2107282 1.0486646  1.2890734
[2,]  1.5 1.8585156 0.7269540 3.3554564 -0.1634684
[3,]  1.5 0.6231975 2.0778415 0.8234746  1.5967294
[4,]  1.5 2.1215671 0.3158835 2.4765020  0.2244624
[5,]  1.5 2.7281892 0.7679411 1.5414498  1.0882794

Am I doing the right thing? if not how do I go about it?

0 Answers
Related