Learn R Programming

fdars (version 0.3.3)

norm: Compute Lp Norm of Functional Data

Description

Generic function to compute Lp norms for functional data objects. Works with both regular fdata and irregular irregFdata objects.

Usage

norm(x, p = 2, ...)

# S3 method for fdata norm(x, p = 2, ...)

# S3 method for irregFdata norm(x, p = 2, ...)

Value

A numeric vector of norms, one per curve.

Arguments

x

A functional data object (fdata or irregFdata).

p

The order of the norm (default 2 for L2 norm).

...

Additional arguments passed to methods.

Examples

Run this code
# Regular fdata
fd <- fdata(matrix(rnorm(100), 10, 10))
norms <- norm(fd)

# Irregular fdata
ifd <- sparsify(fd, minObs = 3, maxObs = 7, seed = 42)
norms_irreg <- norm(ifd)

Run the code above in your browser using DataLab