Package distrib
contains a set of functions for making probability computations on both discrete and continuous univariate models.
What follows is a short reminder of basic probabilistic related definitions.
Let \(f(x)\) be the density function of an absolute continuous random variable \(X\). The distribution function is defined as
which equals the probability \({\rm Pr}(X \le x)\) .
The mean value is a localization parameter and is defined as
The variance is a measure of variation,
which is a positive real number. The square root of the variance is the standard deviation, \(D[x]=\sqrt{V[X]}\) , and it is another measure of variation.
The skewness coefficient is a measure of non-symmetry,
And the kurtosis coefficient measures the peakedness of the distribution,
If \(X\) is gaussian, \(KU[X]=0\). In fact, both skewness and kurtosis are shape parameters used to measure the non–gaussianity of a distribution.
If the random variable \(X\) is discrete, the density, or probability, function \(f(x)\) takes positive values within certain countable set of numbers \(x_i\), and zero elsewhere. In this case, the distribution function is
The mean, variance, standard deviation, skewness coefficient and kurtosis coefficient take the form
respectively.
There is a naming convention in package distrib
. Every function name has two parts, the first one makes reference to the function or parameter we want to calculate,
Functions: Density function (pdf_*) Distribution function (cdf_*) Quantile (quantile_*) Mean (mean_*) Variance (var_*) Standard deviation (std_*) Skewness coefficient (skewness_*) Kurtosis coefficient (kurtosis_*) Random variate (random_*)
The second part is an explicit reference to the probabilistic model,
Continuous distributions: Normal (*normal) Student (*student_t) Chi^2 (*chi2) Noncentral Chi^2 (*noncentral_chi2) F (*f) Exponential (*exp) Lognormal (*lognormal) Gamma (*gamma) Beta (*beta) Continuous uniform (*continuous_uniform) Logistic (*logistic) Pareto (*pareto) Weibull (*weibull) Rayleigh (*rayleigh) Laplace (*laplace) Cauchy (*cauchy) Gumbel (*gumbel) Discrete distributions: Binomial (*binomial) Poisson (*poisson) Bernoulli (*bernoulli) Geometric (*geometric) Discrete uniform (*discrete_uniform) hypergeometric (*hypergeometric) Negative binomial (*negative_binomial) Finite discrete (*general_finite_discrete)
For example, pdf_student_t(x,n)
is the density function of the Student distribution with n degrees of freedom, std_pareto(a,b)
is the standard deviation of the Pareto distribution with parameters a and b and kurtosis_poisson(m)
is the kurtosis coefficient of the Poisson distribution with mean m.
In order to make use of package distrib
you need first to load it by typing
(%i1) load("distrib")$
For comments, bugs or suggestions, please contact the author at ’riotorto AT yahoo DOT com’.