jump.prim: Peeling trajectory jump

Description Usage Arguments Details Value References Examples

View source: R/peeling_trajectory.R

Description

Identifies a jump in the peeling trajectory of object.

Usage

1
jump.prim(object, rel.support = TRUE)

Arguments

object

A prim object resulting from a call to peeling.

rel.support

Logical indicating if the trajectory difference should be relative to the support for finding the jump (default to TRUE).

Details

Computes the (relative) trajectory differences of object:

(yfun[k] - yfun[k - 1])/(support[k - 1] - support[k])

and returns its maximum value. The rationale is that the biggest jump in peeling trajectory gives a good cut-off point for the peeling algorithm. If rel.support = FALSE, the denominator is not used in the differences calculation.

Value

A list with elements:

trajectory.difference

Numeric vector of the computed (relative) differences.

npeel.opt

Integer giving the npeel value of the highest difference.

final.box

The extracted box corresponding to npeel.opt. See extract.box.

References

Masselot P., Chebana F., Campagna C., Lavigne E., Ouarda T.B.M.J., Gosselin P. On threshold identification for weather-health warning systems. Submitted.

Examples

1
2
3
4
5
6
7
8
9
   # A simple bump
   set.seed(12345)
   x <- matrix(runif(2000), ncol = 2, dimnames = list(NULL, c("x1", "x2")))
   y <- 2 * x[,1] + 5 * x[,2] + 10 * (x[,1] >= .8 & x[,2] >= .5) + 
     rnorm(1000)
   # Peeling with alpha = 0.05 and beta.stop = 0.05
   peel_res <- peeling(y, x, beta.stop = 0.05)
   # Automatically choose the best box
   chosen <- jump.prim(peel_res)

PierreMasselot/primr documentation built on Feb. 5, 2021, 7:33 p.m.