directional_inverse: Algorithm to Compute a Directional Inverse

View source: R/eval_quantile_from_cdf.R

directional_inverseR Documentation

Algorithm to Compute a Directional Inverse

Description

Calculates the smallest value for which a function f evaluates to be greater than or equal to y – that is, the left inverse of f at y. Intended for internal use only.

Usage

directional_inverse(distribution, p, low, high, tol, maxiter, direction)

Arguments

distribution

A distribution having access to a cdf.

p

Single value for which to calculate the left inverse.

low, high

Single numeric values forming a range within which to search for the solution.

tol, maxiter

Tolerance (a small positive number) and maximum number of iterations

direction

One of "left" for calculating left-inverse, or "right" for calculating right-inverse.

Details

This algorithm works by progressively cutting the specified range in half, so that the width of the range after k iterations is 1/2^k times the original width.


vincenzocoia/distionary documentation built on March 5, 2024, 3:13 a.m.