Learn R Programming

pvar (version 1.0.6)

DropMidAll: Drop all mid points that appier to be insignificant is 'small' intervals.

Description

Checks all inner points of small intervals. If a point appears to be insignificant in at least one case it will be drooped out. This is an internal function and it has no practical use for users.

Usage

DropMidAll(x, p, dn)

DropMidAllB(x, p, dn)

Arguments

x
a numeric vector.
p
a positive number indicating the power p in p-variation.
dn
a positive add number determining the length of 'small' interval.

Value

  • Function DropMidAll returns values from x that have been left after checking. Function DropMidAllB returns a logical vector indicating which values from x should be left.

Details

The requarements for the x is that the monotanic points should be removed.

See Also

pvar, SplitByExtremum, ChangePointsId

Examples

Run this code
set.seed(6)
xx = rwiener(end = 1, frequency = 1000)
x = xx[ChangePointsId(xx)]

### finds the points that remains
id = which(DropMidAllB(x, p=4, dn=5))	
### all p-variation partition points are form id
pvar(x, p=4)$Partition
### we can find the x points directly by DropMidAll
all(x[id] == DropMidAll(x, p=4, dn=5))

Run the code above in your browser using DataLab