require(fda)
require(fda.usc)
nrep <- 20 # number of replications
n <- 100 # number of time points
input <- seq(-1, pi, length.out=n) # time points
ry <- rnorm(nrep, sd=10)
y <- matrix(NA, ncol=n, nrow=nrep)
for(i in 1:nrep) y[i,] <- sin(2*input)*ry[i]
plot.fdata(fdata(y,input))
yfd <- mat2fd(y, list(lambda=0.01))
plot(yfd)
yfd <- mat2fd(y, list(lambda=0.00001))
plot(yfd)
Run the code above in your browser using DataLab