View source: R/gpfr.functions6.R
mat2fd | R Documentation |
Easy setting up for creating an 'fd' object
mat2fd(mat, fdList = NULL)
mat |
Input data, should be a matrix with ncol time points and nrow replications or samples. |
fdList |
A list with following items:
|
All items listed above have default values. If any item is required to change, add that item into the list; otherwise, leave it as NULL. For example, if one only wants to change the number of basis functions, do:
mat2fd(SomeMatrix,list(nbasis=21))
An 'fd' object
Ramsay, J., and Silverman, B. W. (2006),
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.