| findJumps | R Documentation |
This is a helper tool to infere supports from cummulative density functions.
findJumps(f, a, b, minJump = 1/100, eps = 1e-07, digits = 5, n = 100)
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. |
a vector of numerical values at which the function f jumps by at least minJump in an eps distance, possibly rounded to digits.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.