Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
mir.stat.distribution.cornish_fisher
This module contains algorithms for the Cornish-Fisher Expansion.
License:
Authors:
John Michael Hall
- T
cornishFisherInvCDF
(T)(const Tp
, const Tmu
, const Tstd
, const Tskewness
, const TexcessKurtosis
)
if (isFloatingPoint!T); - Approximates the inverse CDF of a continuous distribution using the Cornish-Fisher expansion.It is generally recommended to only use the Cornish-Fisher expansion with distributions that are similar to the normal distribution. Extreme values of
skewness
orexcessKurtosis
can result in poorer approximations.Parameters:T p
quantile to calculate inverse CDF T mu
mean T std
standard deviation T skewness
skewness T excessKurtosis
excess kurtosis (kurtosis - 3) See Also:Examples:import mir.test: shouldApprox; 0.99.cornishFisherInvCDF(0, 1, 0.1, 1).shouldApprox == 2.629904; 0.99.cornishFisherInvCDF(0.1, 0.2, 0.1, 1).shouldApprox == 0.6259808;
- T
cornishFisherInvCDF
(T)(const Tp
, const Tskewness
= 0, const TexcessKurtosis
= 0)
if (isFloatingPoint!T); - Ditto, but assumes mu = 0 and std = 1Parameters:
T p
quantile to calculate inverse CDF T skewness
skewness (default = 0) T excessKurtosis
excess kurtosis (kurtosis - 3) (default = 0) Examples:import mir.test: shouldApprox; 0.5.cornishFisherInvCDF.shouldApprox == 0; 0.5.cornishFisherInvCDF(1).shouldApprox == -0.1666667; 0.5.cornishFisherInvCDF(-1, 0).shouldApprox == 0.1666667; 0.9.cornishFisherInvCDF(0.1, 0).shouldApprox == 1.292868; 0.9.cornishFisherInvCDF(0.1, 1).shouldApprox == 1.220374; 0.9.cornishFisherInvCDF(0.1, -1).shouldApprox == 1.365363; 0.99.cornishFisherInvCDF(0.1, 0).shouldApprox == 2.396116; 0.99.cornishFisherInvCDF(0.1, 1).shouldApprox == 2.629904; 0.99.cornishFisherInvCDF(0.1, -1).shouldApprox == 2.162328; 0.01.cornishFisherInvCDF(0.1, 0).shouldApprox == -2.249053 ; 0.01.cornishFisherInvCDF(0.1, 1).shouldApprox == -2.482841; 0.01.cornishFisherInvCDF(0.1, -1).shouldApprox == -2.015265;
Copyright © 2016-2023 by Ilya Yaroshenko | Page generated by
Ddoc on Wed Oct 18 12:23:06 2023