icdf — Evaluate inverse cumulative distribution functions by distribution name or fitted distribution object.

icdf(name,p,...) evaluates inverse cumulative distribution functions for supported named distributions. icdf(pd,p) evaluates quantiles for a ProbabilityDistribution object returned by fitdist.

Syntax

x = icdf("Normal", p)
x = icdf("Normal", p, mu, sigma)
x = icdf("t", p, nu)
x = icdf("Weibull", p, a, b)
x = icdf("Chi-square", p, nu)
x = icdf("Binomial", p, n, prob)
All supported icdf forms
x = icdf("Normal", p)
x = icdf("Normal", p, mu, sigma)
x = icdf("t", p, nu)
x = icdf("Weibull", p, a, b)
x = icdf("Chi-square", p, nu)
x = icdf("Binomial", p, n, prob)
x = icdf("Gamma", p, shape, scale)
x = icdf("Exponential", p, mu)
x = icdf("Poisson", p, lambda)
x = icdf("Uniform", p)
x = icdf("Uniform", p, a, b)
x = icdf("Lognormal", p, mu, sigma)
x = icdf("Beta", p, a, b)
x = icdf("F", p, v1, v2)
x = icdf(pd, p)

Inputs

NameTypeRequiredDefaultDescription
nameStringScalarYesDistribution name.
pAnyYesProbability value.
muAnyNo0Mean parameter.
sigmaAnyNo1Standard deviation parameter.
nuAnyYesDegrees of freedom parameter.
aAnyNo1Scale parameter.
bAnyNo1Shape parameter.
nAnyYesNumber of trials.
probAnyYesSuccess probability parameter.
shapeAnyYesShape parameter.
scaleAnyYesScale parameter.
muAnyYesMean parameter.
lambdaAnyYesRate or mean parameter.
aAnyYesLower endpoint.
bAnyYesUpper endpoint.
aAnyYesFirst shape parameter.
bAnyYesSecond shape parameter.
v1AnyYesNumerator degrees of freedom.
v2AnyYesDenominator degrees of freedom.
pdAnyYesProbabilityDistribution object returned by fitdist.
pNumericArrayYesProbability values.

Returns

NameTypeDescription
yNumericArrayDistribution function value.
yNumericArrayDistribution function values.

Errors

IdentifierWhenMessage
RunMat:icdf:InvalidArgumentInputs are nonnumeric, sizes are incompatible, or too many arguments are supplied.icdf: invalid argument
RunMat:icdf:InternalInternal tensor conversion or allocation fails.icdf: internal error

How icdf works

  • Supported distribution names include "Normal", "t", "Weibull", "Chi-square", "Binomial", "Gamma", "Exponential", "Poisson", "Uniform", "Lognormal", "Beta", and "F".
  • Common aliases are accepted after case-insensitive normalization and removal of punctuation or spaces, including "norm", "gaussian", "student t", "wbl", "chi2", "bino", "gam", "exp", "poiss", "unif", "logn", and "fdist".
  • icdf("Normal",p) uses mean 0 and standard deviation 1; icdf("Normal",p,mu,sigma) uses supplied normal parameters.
  • icdf("t",p,nu) returns Student's t quantiles for degrees of freedom nu.
  • icdf("Weibull",p) uses scale 1 and shape 1; icdf("Weibull",p,a,b) uses supplied Weibull scale and shape.
  • icdf("Chi-square",p,nu) inverts the chi-square CDF with degrees of freedom nu.
  • icdf("Binomial",p,n,prob) returns the smallest integer outcome whose binomial CDF is at least p.
  • icdf("Gamma",p,shape,scale), icdf("Exponential",p,mu), icdf("Poisson",p,lambda), icdf("Beta",p,a,b), and icdf("F",p,v1,v2) require the shown distribution parameters.
  • icdf("Uniform",p) uses bounds [0,1]; icdf("Uniform",p,a,b) uses supplied lower and upper bounds.
  • icdf("Lognormal",p) uses mean 0 and standard deviation 1 for the underlying normal distribution; icdf("Lognormal",p,mu) and icdf("Lognormal",p,mu,sigma) use supplied lognormal parameters.
  • icdf(pd,p) supports fitted normal, exponential, lognormal, gamma, Weibull, and Poisson distribution objects returned by fitdist.
  • Scalar and compatible array inputs broadcast to a common output shape. Invalid probabilities or distribution parameters produce NaN elements.
  • Continuous distributions return endpoint values at p = 0 and Inf where the upper tail is unbounded at p = 1; bounded distributions return their finite endpoints. The Poisson inverse returns Inf at p = 1.

Examples

Normal median with parameters

x = icdf("Normal", 0.5, 10, 2)

Expected output:

x = 10

Discrete binomial quantile

k = icdf("Binomial", 0.75, 10, 0.5)

Expected output:

k = 6

Uniform quantile with bounds

x = icdf("Uniform", 0.25, 10, 20)

Expected output:

x = 12.5

Fitted distribution median

pd = fitdist([1;2;3], "Normal"); x = icdf(pd, 0.5)

Expected output:

x = 2

Using icdf with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how icdf changes the result.

Run a small icdf example, explain the result, then change one input and compare the output.

FAQ

How is icdf related to distribution-specific inverse functions?

icdf("Normal",p,mu,sigma) dispatches to the same numerical path as norminv(p,mu,sigma), icdf("t",p,nu) to tinv, and icdf("Weibull",p,a,b) to wblinv. Other supported distribution names use matching runtime CDF or inverse helper implementations.

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how icdf is executed, line by line, in Rust.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.