Create a binomial distribution with n trials and success probability p. The binomial distribution models the number of successes in n independent trials. Returns an object with pmf(k), cdf(k), mean, and variance.
Syntax
binomialDist(n | p)
Type Signatures
number, number
Parameters
Name
Type
Description
n
number
Number of trials (positive integer)
p
number
Probability of success (in [0, 1])
Returns
Object — Distribution object with pmf, cdf, mean, variance
Create a chi-squared distribution with k degrees of freedom. Commonly used in hypothesis testing and confidence interval estimation for variance. Returns an object with pdf(x), cdf(x), mean, and variance.
Syntax
chiSquaredDist(k)
Parameters
Name
Type
Description
k
number
Degrees of freedom (must be a positive integer)
Returns
Object — Distribution object with pdf, cdf, mean, variance
Examples
d = chiSquaredDist(3) d.pdf(1) d.cdf(7.815) d.mean d.variance
Create an exponential distribution with rate parameter lambda. Models the time between events in a Poisson process. Returns an object with pdf(x), cdf(x), icdf(p), mean, and variance.
Syntax
exponentialDist(lambda)
Parameters
Name
Type
Description
lambda
number
Rate parameter (must be positive)
Returns
Object — Distribution object with pdf, cdf, icdf, mean, variance
Examples
d = exponentialDist(2) d.pdf(1) d.cdf(1) d.icdf(0.5) d.mean
Compute a frequency histogram. If bins is a number, creates that many equal-width bins from min to max. If bins is an array, uses those values as bin edges. Returns an object with counts, binEdges, and binCenters.
Compute the sample excess kurtosis of a dataset. Kurtosis measures the "tailedness" of the probability distribution. A normal distribution has excess kurtosis of 0.
Perform simple linear regression (ordinary least squares) on two datasets. Returns an object with slope, intercept, r (correlation coefficient), r2 (R-squared), and predict(x) function.
Syntax
linreg(x | y)
Type Signatures
Array | Matrix, Array | Matrix
Parameters
Name
Type
Description
x
Array | Matrix
Independent variable (predictor)
y
Array | Matrix
Dependent variable (response)
Returns
Object — Object with slope, intercept, r, r2, predict
Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.
Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.
Syntax
median(a | b | c
Type Signatures
number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit, Array | Matrix, number | BigNumber, ...
Create a Poisson distribution with rate parameter lambda. The Poisson distribution models the number of events in a fixed interval. Returns an object with pmf(k), cdf(k), mean, and variance.
Syntax
poissonDist(lambda)
Parameters
Name
Type
Description
lambda
number
Rate parameter (must be positive)
Returns
Object — Distribution object with pmf, cdf, mean, variance
Examples
d = poissonDist(3) d.pmf(3) d.cdf(4) d.mean d.variance
Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the
Compute the sample skewness of a dataset. Skewness measures the asymmetry of the probability distribution. Uses the adjusted Fisher-Pearson standardized moment coefficient.
Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".
Perform a two-sample Welch t-test (unequal variances). Tests whether the means of two independent samples differ significantly. Uses the Welch-Satterthwaite approximation for degrees of freedom. Returns an object with t (statistic), df (degrees of freedom), and pValue (two-tailed).
Create a Weibull distribution with shape parameter k and scale parameter lambda. Generalizes the exponential distribution (k=1 reduces to exponential with rate 1/lambda). Returns an object with pdf(x), cdf(x), mean, and variance.
Syntax
weibullDist(k | lambda)
Type Signatures
number, number
Parameters
Name
Type
Description
k
number
Shape parameter (must be positive)
lambda
number
Scale parameter (must be positive)
Returns
Object — Distribution object with pdf, cdf, mean, variance