gamcdf
Builtin index · Statistics & ML
result = gamcdf(x, a, [b=1])
Input: x, a, b · Output: result
What it is
Gamma cumulative distribution with shape a and scale b (mean a*b) -- MATLAB's parameterisation, not a rate.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = gamcdf(x, a, [b=1]) | x —Returns the same shape as x.a —Gamma cumulative distribution with shape a and scale b (mean a*b) -- MATLAB's parameterisation, not a rate.b optional (default 1)Gamma cumulative distribution with shape a and scale b (mean a*b) -- MATLAB's parameterisation, not a rate. | result — | Returns the same shape as x. Added in v0.4.3. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
print("geo = nbin(r=1): {geopdf(3, 0.2)} {nbinpdf(3, 1, 0.2)}")
print("bern = bino(n=1): {bernpdf(1, 0.3)} {binopdf(1, 1, 0.3)}")
print("chi2 = gam(k/2, 2): {chi2cdf(4.5, 3)} {gamcdf(4.5, 1.5, 2)}")
print("exp = gam(1, mu): {expcdf(2, 3)} {gamcdf(2, 1, 3)}")
print("bino -> poiss: {binocdf(3, 10000, 0.0004)} vs {poisscdf(3, 4)}")
s = hygestat(50, 10, 12)
print("hypergeometric mean {s.mean}, variance {round(s.var, 4)}")
x = gamrnd(2.5, 1.5, 5000, 1, seed = 7)
g = gamfit(x)
print("gamfit: a = {round(g.a, 2)}, b = {round(g.b, 2)}, loglik = {round(g.loglik, 1)}")
k = binoinv(0.95, 20, 0.3)
print("95% of Binomial(20, 0.3) draws are <= {k}: binocdf = {round(binocdf(k, 20, 0.3), 4)}")
output
geo = nbin(r=1): 0.1024 0.1024 bern = bino(n=1): 0.3 0.3 chi2 = gam(k/2, 2): 0.78771 0.78771 exp = gam(1, mu): 0.486583 0.486583 bino -> poiss: 0.433431 vs 0.43347 hypergeometric mean 2.4, variance 1.489 gamfit: a = 2.55, b = 1.47, loglik = -10647.1 95% of Binomial(20, 0.3) draws are <= 9: binocdf = 0.952
from statistics-ml