Learn R Programming

pvar (version 1.0.6)

Sum_p: 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.
p
A number indicating the power in summing function.
lag
A number, indicating the lag.

Value

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

Details

It is the the function that should be maximised in p-variation calculations.

See Also

pvar

Examples

Run this code
set.seed(10)
x = rbridge(1, 1000)
# the p-variation
pv = pvar(x, 2); pv			
# the same value the used the the p-varation partitnio.
Sum_p(x[pv$Partition], 2)	
# any other partition must give not greater result
Sum_p(x, 2)

Run the code above in your browser using DataLab