Learn R Programming

fdars (version 0.3.3)

standardize: Standardize functional data (z-score normalization)

Description

Transforms each curve to have mean 0 and standard deviation 1. This is useful for comparing curve shapes regardless of their level or scale.

Usage

standardize(fdataobj)

# S3 method for fdata standardize(fdataobj)

# S3 method for irregFdata standardize(fdataobj)

Value

A standardized 'fdata' object where each curve has mean 0 and sd 1.

Arguments

fdataobj

An object of class 'fdata'.

Examples

Run this code
fd <- fdata(matrix(rnorm(100) * 10 + 50, 10, 10), argvals = seq(0, 1, length.out = 10))
fd_std <- standardize(fd)
# Check: each curve now has mean ~0 and sd ~1
rowMeans(fd_std$data)
apply(fd_std$data, 1, sd)

Run the code above in your browser using DataLab