| norm | R Documentation |
This function calculates the norm for each observation of a funData,
irregFunData or multiFunData object.
object |
An object of class |
... |
Further parameters (see Details). |
For funData objects, the standard L^2 norm is calculated:
||f|| = \left( \int_{\mathcal{T}} f(t)^2 dt \right)^{1/2}.
For irregFunData objects, each observed function is
integrated only on the observed grid points (unless fullDom = TRUE).
The (weighted) norm of a multivariate functional data object f = (f_1 ,
\ldots, f_p) is defined as
||| f ||| :=
\left(\sum_{j=1}^p w_j || f_j ||^2 \right) ^{1/2}.
Further parameters passed to this function may include:
squared: Logical. If TRUE (default), the function calculates
the squared norm, otherwise the result is not squared.
obs: A
numeric vector, giving the indices of the observations, for which the norm is
to be calculated. Defaults to all observations.
method: A
character string, giving the integration method to be used. See
integrate for details.
weight: An optional vector
of weights for the scalar product; particularly useful for multivariate
functional data, where each entry can be weighted in the scalar product /
norm. Defaults to 1 for each element.
fullDom: Logical.
If object is of class irregFunData and
fullDom = TRUE, all functions are extrapolated to the same domain.
Defaults to FALSE. See integrate for details.
A numeric vector representing the norm of each observation.
The function is currently implemented only for functional data with one- and two-dimensional domains.
funData, irregFunData,
multiFunData, integrate
# Univariate
object <- funData(argvals = 1:5, X = rbind(1:5, 6:10))
norm(object)
# Univariate (irregular)
irregObject <- irregFunData(argvals = list(1:5, 2:4), X = list(2:6, 3:5))
norm(irregObject) # no extrapolation
norm(irregObject, fullDom = TRUE) # extrapolation (of second function)
# Multivariate
multiObject <- multiFunData(object, funData(argvals = 1:3, X = rbind(3:5, 6:8)))
norm(multiObject)
norm(multiObject, weight = c(2,1)) # with weight vector, giving more weight to the first element
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.