Packages

object Quantile extends Error

The Quantile object contains methods for computing 'Finv', the "inverse" Cumulative Distribution Functions (iCDF's) for popular sampling distributions: StandardNormal, StudentT, ChiSquare and Fisher. For a given CDF 'F' and probability/quantile 'p', compute 'x' such that 'F(x) = p'. The iCDF may be thought of as giving value of 'x' for which the area under the curve from -infinity to 'x' of the probability density function (pdf) is equal to 'p'.

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Quantile
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def check(p: Double, x_min: Double = NEGATIVE_INFINITY): (Boolean, Double)

    Check whether the probability 'p' is out of range (giving NaN) or extreme, either close to 0 (giving -infinity) or 1 (giving +infinity).

    Check whether the probability 'p' is out of range (giving NaN) or extreme, either close to 0 (giving -infinity) or 1 (giving +infinity). Return (true, special-value) for these cases.

    p

    the p-th quantile, e.g., .95 (95%)

    x_min

    the smallest value in the distribution's domain

  2. def chiSquareInv(p: Double, df: Int): Double

    Compute the 'p'-th quantile for "ChiSquare distribution" function.

    Compute the 'p'-th quantile for "ChiSquare distribution" function.

    p

    the p-th quantile, e.g., .95 (95%)

    df

    the degrees of freedom

  3. def chiSquareInv(p: Double = .95, pr: Parameters = null): Double

    Compute the 'p'-th quantile for "ChiSquare distribution" function using bisection search of the CDF.

    Compute the 'p'-th quantile for "ChiSquare distribution" function using bisection search of the CDF. FIX: need a faster algorithm

    p

    the p-th quantile, e.g., .95 (95%)

    pr

    parameter for the degrees of freedom

  4. def empiricalInv(p: Double, data: Parameters): Double

    Compute the 'p'-th quantile for the Empirical distribution function.

    Compute the 'p'-th quantile for the Empirical distribution function.

    p

    the p-th quantile, e.g., .95 (95%)

    data

    parameters as data

  5. def empiricalInv(p: Double, eCDF: (VectorD, VectorD)): Double

    Compute the 'p'-th quantile for the Empirical distribution function.

    Compute the 'p'-th quantile for the Empirical distribution function.

    p

    the p-th quantile, e.g., .95 (95%)

    eCDF

    the empirical CDF

  6. def exponentialInv(p: Double, pr: Parameters = null): Double

    Compute the 'p'-th quantile for the Exponential distribution function.

    Compute the 'p'-th quantile for the Exponential distribution function.

    p

    the p-th quantile, e.g., .95 (95%)

    pr

    parameter for the rate

  7. def fisherInv(p: Double, df: (Int, Int)): Double

    Compute the 'p'-th quantile for "Fisher (F) distribution" function.

    Compute the 'p'-th quantile for "Fisher (F) distribution" function.

    p

    the p-th quantile, e.g., .95 (95%)

    df

    the pair of degrees of freedom ('df1' and 'df2')

  8. def fisherInv(p: Double = .95, pr: Parameters = null): Double

    Compute the 'p'-th quantile for "Fisher (F) distribution" function using bisection search of the CDF.

    Compute the 'p'-th quantile for "Fisher (F) distribution" function using bisection search of the CDF. FIX: need a faster algorithm

    p

    the p-th quantile, e.g., .95 (95%)

    pr

    parameters for the degrees of freedom (numerator, denominator)

  9. final def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  10. def normalInv(p: Double = .95, pr: Parameters = null): Double

    Compute the 'p'-th quantile for the "standard normal distribution" function.

    Compute the 'p'-th quantile for the "standard normal distribution" function.

    p

    the p-th quantile, e.g., .95 (95%)

    pr

    parameter for the distribution (currently not used)

    See also

    home.online.no/~pjacklam/notes/invnorm/impl/sprouse/ltqnorm.c -------------------------------------------------------------------------

  11. def studentTInv(p: Double, df: Int): Double

    Compute the 'p'-th quantile for "Student's t" distribution function.

    Compute the 'p'-th quantile for "Student's t" distribution function.

    p

    the p-th quantile, e.g., 95 (95%)

    df

    the degrees of freedom

  12. def studentTInv(p: Double = .95, pr: Parameters = null): Double

    Compute the 'p'-th quantile for "Student's t" distribution function.

    Compute the 'p'-th quantile for "Student's t" distribution function.

    p

    the p-th quantile, e.g., 95 (95%)

    pr

    parameter for the degrees of freedom

    See also

    wp.csiro.au/alanmiller/toms/cacm396.f90 -------------------------------------------------------------------------

  13. def studentTInv2(p: Double = .95, pr: Parameters = null): Double

    Compute the 'p'-th quantile for "Student's t" distribution function.

    Compute the 'p'-th quantile for "Student's t" distribution function. This algorithm is less accurate than the one above. ------------------------------------------------------------------------- It is a transliteration of the 'STUDTP' function given in Appendix C

    p

    the p-th quantile, e.g., 95 (95%)

    pr

    parameter for the degrees of freedom

    See also

    "Principles of Discrete Event Simulation", G. S. Fishman, Wiley, 1978. -------------------------------------------------------------------------

  14. def uniformInv(p: Double, pr: Parameters = null): Double

    Compute the 'p'-th quantile for the Uniform distribution function.

    Compute the 'p'-th quantile for the Uniform distribution function.

    p

    the p-th quantile, e.g., .95 (95%)

    pr

    parameters for the end-points of the Uniform distribution