wedge: Computes wedge probabilities

Description Usage Arguments Details Value Author(s) References Examples

Description

Computes the probability for a standard Brownian motion to stay in a wedge of the plane limited by two straight lines, given by their slopes and intercepts.

Usage

1
wedge(a1, b1, a2, b2, N = 3, lower.tail = TRUE, type = c("R","Rcpp","RcppParallel"), nb.threads)

Arguments

a1

vector of numeric: slopes of lower boundaries

b1

vector of numeric: intercepts of lower boundaries

a2

vector of numeric: slopes of upper boundaries

b2

vector of numeric: intercepts of upper boundaries

N

integer: number of terms to be computed in each series

lower.tail

logical: if TRUE the probabilities to stay inside the wedges are returned; if FALSE the exit probabilities are returned.

type

character: type of function to wrap

nb.threads

integer: number of threads

Details

Wedge probabilities are invariant through symmetry: wedge(a1,b1,a2,b2) returns the same as wedge(b1,a1,b2,a2) and wedge(a2,b2,a1,b1). Depending on N a threshold is computed. If (a1+a2)*(b1+b2)/4 is above the threshold, N terms of Doob's formula are computed. If it is below the threshold, N terms of the theta-function transform are computed.

Value

a vector of wedge probabilities.

Author(s)

R\'emy Drouilhet and Bernard Ycart

References

B. Ycart and R. Drouilhet (2016) Computing wedge probabilities. arXiv:1612.05764

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# random wedges
a1 <- 10*runif(10^6)^2
b1 <- 10*runif(10^6)^2
a2 <- 10*runif(10^6)^2
b2 <- 10*runif(10^6)^2
# wedge probabilities, 3 term approximation
pw3 <- wedge(a1,b1,a2,b2)
summary(pw3)
# wedge probabilities, 4 term approximation
pw4 <- wedge(a1,b1,a2,b2,N=4)
summary(abs(pw3-pw4))
#  exit probabilities, 3 term approximation
length(which(pw3==1))
pw3m <- wedge(a1,b1,a2,b2,lower.tail=FALSE)
summary(pw3+pw3m)

rcqls/wedge documentation built on May 27, 2019, 3:05 a.m.