Learn R Programming

fdars (version 0.3.3)

normalize: Normalize functional data

Description

Scales each curve to have Lp norm equal to 1.

Usage

normalize(fdataobj, p = 2)

Value

A normalized 'fdata' object where each curve has unit norm.

Arguments

fdataobj

An object of class 'fdata'.

p

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

Examples

Run this code
fd <- fdata(matrix(rnorm(100), 10, 10), argvals = seq(0, 1, length.out = 10))
fd_norm <- normalize(fd)
norm(fd_norm)  # All values should be 1

Run the code above in your browser using DataLab