Sum_p: p-variation summation function

View source: R/p-variation.R

Sum_pR Documentation

p-variation summation function

Description

It is the sum of absolute differences in the power of p.

Usage

Sum_p(x, p, lag = 1)

Arguments

x

a numeric vector of data values.

p

a number indicating the power in summing function.

lag

a number, indicating the lag of differences.

Details

This is a function that must be maximized by taking a proper subset of x, i.e. if prt is a p-variation partition of sample x, then Sum_p(x[prt], p) == pvar(x, p)$value.

Value

The number equal to sum((abs(diff(x, lag)))^p)

See Also

pvar

Examples

x = rbridge(1000)
pv = pvar(x, 2); pv 
# Sum_p in supreme partition and the value form pvar must match
Sum_p(x[pv$partition], 2)
pv

pvar documentation built on Oct. 18, 2022, 9:09 a.m.