AddPvar: Addition of p-variation

View source: R/p-variation.R

AddPvarR Documentation

Addition of p-variation

Description

Merges two objects of p-variation and effectively recalculates the p-variation of joined sample.

Usage

AddPvar(PV1, PV2, AddIfPossible = TRUE)

Arguments

PV1

an object of the class pvar.

PV2

an object of the class pvar, which has the same p value as PV1 object.

AddIfPossible

logical. If TRUE (the default), then is is assumed, that two samples has common point. So, the end of PV1 and the begging of PV2 will be treated as one point if it has the same value.

Details

Note: a short form of AddPvar(PV1, PV2 is PV1 + PV2.

Value

An object of the class pvar. See pvar.

Examples

### creating two pvar objects:
x = rwiener(1000)
PV1 = pvar(x[1:500], 2)
PV2 = pvar(x[500:1000], 2)

layout(matrix(c(1,3,2,3), 2, 2))
plot(PV1)
plot(PV2)
plot(AddPvar(PV1, PV2))
layout(1)

### AddPvar(PV1, PV2) is eqivavalent to PV1 + PV2
IsEqualPvar(AddPvar(PV1, PV2), PV1 + PV2)

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