findJumps: Finds jumps of a function of a certain minimum height

View source: R/helpers.R

findJumpsR Documentation

Finds jumps of a function of a certain minimum height

Description

This is a helper tool to infere supports from cummulative density functions.

Usage

findJumps(f, a, b, minJump = 1/100, eps = 1e-07, digits = 5, n = 100)

Arguments

f

a vectorized function, whos jumps need to be found. The function is expected to be deterministic, nondecreasing (or nonincreasing) and continuous from the right.

a

a numeric value, the lower bound of the range to look for jumps

b

a numeric value, the upper bound of the range to look for jumps

minJump

a numeric value giving the minimum jump height, that is considered a jump.

eps

a numeric value given the distance of evaluations. If the distance of two evaluations drops to epsilon, and the jump height is achieved the higher value is rounded to digits and returned. if eps=0, the search goes until machine precision.

digits

an integer providing the digits of rounding, if search has finished accordint to the epsilon criterion.

n

the numer discretization intervals considered in each iteration step.

Value

a vector of numerical values at which the function f jumps by at least minJump in an eps distance, possibly rounded to digits.

Examples

findJumps(function(x) pbinom(x,4,0.2),-pi,17)
findJumps(pnorm,-3,3)
p <- findJumps(function(x) ifelse(x<pi,x,x+pi),0,6,eps=0)
p==pi # TRUE



DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.