fda.usc_efic | R Documentation |
Auxiliary functions required for the methods
implemented in the goffda package, as enhancements of the auxiliary
functions fdata.cen
and
func.mean
from the
fda.usc-package
.
fdata_cen(X_fdata, mean_X = func_mean(X_fdata))
func_mean(X_fdata)
inprod_fdata(X_fdata1, X_fdata2 = NULL, int_rule = "trapezoid",
as_matrix = TRUE, verbose = FALSE)
X_fdata |
sample of functional data as an
|
mean_X |
functional mean of |
X_fdata1, X_fdata2 |
samples of functional
data as |
int_rule |
quadrature rule for approximating the definite
unidimensional integral: trapezoidal rule ( |
as_matrix |
flag to indicate if |
verbose |
whether to show or not information about the
|
func_mean
: computes the functional mean of
X_fdata
.
fdata_cen
: centers the
functional data X_fdata
.
inprod_fdata(X_fdata1)
: computes as a row vector the
elements of the lower triangular part of the inner products matrix
(X_fdata
vs X_fdata
). If as_matrix = TRUE
, the
matrix of inner products is given.
inprod_fdata(X_fdata1, X_fdata2)
: computes the matrix of
inner products (as_matrix = TRUE
is forced) between X_fdata1
and X_fdata2
.
Code iterated by Eduardo García-Portugués, Gonzalo Álvarez-Pérez,
and Javier Álvarez-Liébana from the fda.usc-package
originals.
## fdata_cen() vs fda.usc::fdata_cen()
data(phoneme, package = "fda.usc")
mlearn <- phoneme$learn[1:10, ]
plot(fda.usc::fdata.cen(mlearn)$Xcen)
plot(fdata_cen(mlearn))
## inprod_fdata() vs fda.usc::inprod.fdata()
# inprod_fdata between mlearn and mlearn: as a row vector
A <- fda.usc::inprod.fdata(fdata1 = mlearn)
A[upper.tri(A, diag = TRUE)]
inprod_fdata(X_fdata1 = mlearn, int_rule = "trapezoid", as_matrix = FALSE)
# inprod_fdata between mlearn and mlearn: as a matrix
A <- fda.usc::inprod.fdata(fdata1 = mlearn)
A
inprod_fdata(X_fdata1 = mlearn, int_rule = "trapezoid", as_matrix = TRUE)
# inprod_fdata between mlearn and mlearn2: as a matrix
mlearn2 <- phoneme$learn[11:30, ]
A <- fda.usc::inprod.fdata(fdata1 = mlearn, fdata2 = mlearn2)
A
B <- inprod_fdata(X_fdata1 = mlearn, X_fdata2 = mlearn2,
int_rule = "trapezoid", as_matrix = TRUE)
B
## Efficiency comparisons
microbenchmark::microbenchmark(fda.usc::fdata.cen(mlearn), fdata_cen(mlearn),
times = 1e3, control = list(warmup = 20))
microbenchmark::microbenchmark(fda.usc::inprod.fdata(fdata1 = mlearn),
inprod_fdata(X_fdata1 = mlearn,
as_matrix = FALSE), times = 1e3,
control = list(warmup = 20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.