L2: L2-error

Description Usage Arguments Value

View source: R/Pathfinder.R

Description

Given two functions y1(t) and y2(t), this function finds the L2-distance between the following two curves: a) y1(t)-y2(t) sampled at all time points (tp) b) y1(t)-y2(t) sampled at the time points indexed by index (tp[index]). Note that by setting y2 to rep(0,length(tp)), this function can be used to estimate the L2-error in the shape of y1.

Usage

1
L2(tp, y1, y2, start, stop, index, numSubdivisions = 2000)

Arguments

tp

A numerical vector of time points (or spatial coordinates along a single axis)

y1

A numerical vector of measurements (of the control)

y2

A numerical vector of measurements (of the experimental condition)

start

A numerical value representing the start time (or spatial coordinate) of the integration

stop

A numerical value representing the end time (or spatial coordinate) of the integration

index

A vector of positive integers representing the indices of tp that we subsample

numSubdivisions

This can be adjusted to ensure the integration doesn't take too long, especially if we aren't overly concerned with rounding errors.

Value

A numeric value– the L2 error.


ezer/NITPicker documentation built on June 29, 2018, 8:06 p.m.