get_mfd_list {funcharts} | R Documentation |
Get Multivariate Functional Data from a list of matrices
Description
Get Multivariate Functional Data from a list of matrices
Usage
get_mfd_list(
data_list,
grid = NULL,
n_basis = 30,
n_order = 4,
basisobj = NULL,
Lfdobj = 2,
lambda = NULL,
lambda_grid = 10^seq(-10, 1, length.out = 10),
ncores = 1
)
Arguments
data_list |
A named list of matrices. Names of the elements in the list denote the functional variable names. Each matrix in the list corresponds to a functional variable. All matrices must have the same dimension, where the number of rows corresponds to replications, while the number of columns corresponds to the argument values at which functions are evaluated. |
grid |
A numeric vector, containing the argument values at which functions are evaluated. Its length must be equal to the number of columns in each matrix in data_list. Default is NULL, in this case a vector equally spaced numbers between 0 and 1 is created, with as many numbers as the number of columns in each matrix in data_list. |
n_basis |
An integer variable specifying the number of basis functions; default value is 30. See details on basis functions. |
n_order |
An integer specifying the order of B-splines, which is one higher than their degree. The default of 4 gives cubic splines. |
basisobj |
An object of class |
Lfdobj |
An object of class |
lambda |
A non-negative real number.
If you want to use a single specified smoothing parameter
for all functional data objects in the dataset,
this argument is passed to the function |
lambda_grid |
A vector of non-negative real numbers.
If |
ncores |
Deprecated. |
Details
Basis functions are created with
fda::create.bspline.basis(domain, n_basis)
, i.e.
B-spline basis functions of order 4 with equally spaced knots
are used to create mfd
objects.
The smoothing penalty lambda is provided as
fda::fdPar(bs, 2, lambda)
,
where bs is the basis object and 2 indicates that
the integrated squared second derivative is penalized.
Rather than having a list of matrices,
you may have a data frame with long format,
i.e. with all functional observations in a single column
for each functional variable.
In this case, see get_mfd_df
.
Value
An object of class mfd
.
See also mfd
for additional details
on the multivariate functional data class.
See Also
mfd
,
get_mfd_list
,
get_mfd_array
Examples
library(funcharts)
data("air")
# Only take first 5 multivariate functional observations
# and only two variables from air
air_small <- lapply(air[c("NO2", "CO")], function(x) x[1:5, ])
mfdobj <- get_mfd_list(data_list = air_small)