generalPNorm: Generalised P-Norm

View source: R/generalPNorm.R

generalPNormR Documentation

Generalised P-Norm

Description

Calculate the p-norm of any function between given limits.

Usage

generalPNorm(fun, p, lower, upper, range = NULL)

Arguments

fun

function to calculate the p-norm of.

p

the pth norm to calculate

lower

lower bound for the integral

upper

upper bound for the integral

range

if discrete then range of the function to sum over

Details

The p-norm of a continuous function f is given by,

(\int_S |f|^p d\mu)^{1/p}

where S is the function support. And for a discrete function by

\sum_i (x_{i + 1} - x_i) * |f(x_i)|^p

where i is over a given range.

The p-norm is calculated numerically using the integrate function and therefore results are approximate only.

Value

Returns a numeric value for the p norm of a function evaluated between given limits.

Examples

generalPNorm(Exponential$new()$pdf, 2, 0, 10)

RaphaelS1/distr6 documentation built on Feb. 24, 2024, 9:14 p.m.