get_l2_distance: Computes the L^2 distance between two SRVFs

View source: R/refactoring.R

get_l2_distanceR Documentation

Computes the L^2 distance between two SRVFs

Description

Computes the L^2 distance between two SRVFs

Usage

get_l2_distance(q1fun, q2fun, method = "quadrature")

Arguments

q1fun

A function that takes a numeric vector s of values in [0, 1] as input and returns the values of the first SRVF at s.

q2fun

A function that takes a numeric vector s of values in [0, 1] as input and returns the values of the second SRVF at s.

method

A character string specifying the method to use for computing the L^2 distance. Options are "quadrature" and "trapz". Defaults to "quadrature".

Value

A numeric value storing the L^2 distance between the two SRVFs.

Examples

q1 <- curve2srvf(beta[, , 1, 1])
q2 <- curve2srvf(beta[, , 1, 2])
get_l2_distance(q1, q2)

fdasrvf documentation built on Oct. 5, 2024, 1:08 a.m.