2 * Introduction to distrib::
3 * Functions and Variables for continuous distributions::
4 * Functions and Variables for discrete distributions::
7 @node Introduction to distrib, Functions and Variables for continuous distributions, distrib-pkg, distrib-pkg
8 @section Introduction to distrib
11 Package @code{distrib} contains a set of functions for making probability computations on both discrete and continuous univariate models.
13 What follows is a short reminder of basic probabilistic related definitions.
15 Let @math{f(x)} be the @var{density function} of an absolute continuous random variable @math{X}. The @var{distribution function} is defined as
28 $$F\left(x\right)=\int_{ -\infty }^{x}{f\left(u\right)\;du}$$
30 which equals the probability @code{Pr(X <= x)}.
32 The @var{mean} value is a localization parameter and is defined as
45 $$E\left[X\right]=\int_{ -\infty }^{\infty }{x\,f\left(x\right)\;dx}$$
48 The @var{variance} is a measure of variation,
54 V[X] = I f(x) (x - E[X]) dx
61 $$V\left[X\right]=\int_{ -\infty }^{\infty }{f\left(x\right)\,\left(x
62 -E\left[X\right]\right)^2\;dx}$$
64 which is a positive real number. The square root of the variance is the @var{standard deviation}, @math{D[X]=sqrt(V[X])}, and it is another measure of variation.
66 The @var{skewness coefficient} is a measure of non-symmetry,
72 SK[X] = ----- I f(x) (x - E[X]) dx
79 $$SK\left[X\right]={{\int_{ -\infty }^{\infty }{f\left(x\right)\,
80 \left(x-E\left[X\right]\right)^3\;dx}}\over{D\left[X\right]^3}}$$
83 And the @var{kurtosis coefficient} measures the peakedness of the distribution,
89 KU[X] = ----- I f(x) (x - E[X]) dx - 3
96 $$KU\left[X\right]={{\int_{ -\infty }^{\infty }{f\left(x\right)\,
97 \left(x-E\left[X\right]\right)^4\;dx}}\over{D\left[X\right]^4}}-3$$
99 If @math{X} is gaussian, @math{KU[X]=0}. In fact, both skewness and kurtosis are shape parameters used to measure the non--gaussianity of a distribution.
101 If the random variable @math{X} is discrete, the density, or @var{probability}, function @math{f(x)} takes positive values within certain countable set of numbers @math{x_i}, and zero elsewhere. In this case, the distribution function is
114 $$F\left(x\right)=\sum_{x_{i}\leq x}{f\left(x_{i}\right)}$$
117 The mean, variance, standard deviation, skewness coefficient and kurtosis coefficient take the form
130 $$E\left[X\right]=\sum_{x_{i}}{x_{i}f\left(x_{i}\right)},$$
137 V[X] = > f(x ) (x - E[X]) ,
145 $$V\left[X\right]=\sum_{x_{i}}{f\left(x_{i}\right)\left(x_{i}-E\left[X\right]\right)^2},$$
154 $$D\left[X\right]=\sqrt{V\left[X\right]},$$
161 SK[X] = ------- > f(x ) (x - E[X])
169 $$SK\left[X\right]={{\sum_{x_{i}}{f\left(x\right)\,
170 \left(x-E\left[X\right]\right)^3\;dx}}\over{D\left[X\right]^3}}$$
177 KU[X] = ------- > f(x ) (x - E[X]) - 3 ,
185 $$KU\left[X\right]={{\sum_{x_{i}}{f\left(x\right)\,
186 \left(x-E\left[X\right]\right)^4\;dx}}\over{D\left[X\right]^4}}-3,$$
190 There is a naming convention in package @code{distrib}. Every function name has two parts, the first one makes reference to the function or parameter we want to calculate,
193 Density function (pdf_*)
194 Distribution function (cdf_*)
195 Quantile (quantile_*)
198 Standard deviation (std_*)
199 Skewness coefficient (skewness_*)
200 Kurtosis coefficient (kurtosis_*)
201 Random variate (random_*)
204 The second part is an explicit reference to the probabilistic model,
206 Continuous distributions:
210 Noncentral Chi^2 (*noncentral_chi2)
213 Lognormal (*lognormal)
216 Continuous uniform (*continuous_uniform)
225 Discrete distributions:
228 Bernoulli (*bernoulli)
229 Geometric (*geometric)
230 Discrete uniform (*discrete_uniform)
231 hypergeometric (*hypergeometric)
232 Negative binomial (*negative_binomial)
233 Finite discrete (*general_finite_discrete)
236 For example, @code{pdf_student_t(x,n)} is the density function of the Student distribution with @var{n} degrees of freedom, @code{std_pareto(a,b)} is the standard deviation of the Pareto distribution with parameters @var{a} and @var{b} and @code{kurtosis_poisson(m)} is the kurtosis coefficient of the Poisson distribution with mean @var{m}.
239 In order to make use of package @code{distrib} you need first to load it by typing
241 (%i1) load("distrib")$
244 For comments, bugs or suggestions, please contact the author at @var{'riotorto AT yahoo DOT com'}.
246 @opencatbox{Categories:}
247 @category{Statistical functions}
248 @category{Share packages}
249 @category{Package distrib}
255 @node Functions and Variables for continuous distributions, Functions and Variables for discrete distributions, Introduction to distrib, distrib-pkg
256 @section Functions and Variables for continuous distributions
260 @deffn {Function} pdf_normal (@var{x},@var{m},@var{s})
261 Returns the value at @var{x} of the density function of a @math{Normal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
263 @opencatbox{Categories:}
264 @category{Package distrib}
271 @deffn {Function} cdf_normal (@var{x},@var{m},@var{s})
272 Returns the value at @var{x} of the distribution function of a @math{Normal(m,s)} random variable, with @math{s>0}. This function is defined in terms of Maxima's built-in error function @code{erf}.
276 @c cdf_normal(x,m,s);
279 (%i1) load ("distrib")$
280 (%i2) cdf_normal(x,m,s);
284 (%o2) -------------- + -
288 See also @mrefdot{erf}
290 @opencatbox{Categories:}
291 @category{Package distrib}
297 @anchor{quantile_normal}
298 @deffn {Function} quantile_normal (@var{q},@var{m},@var{s})
299 Returns the @var{q}-quantile of a @math{Normal(m,s)} random variable, with @math{s>0}; in other words, this is the inverse of @mrefdot{cdf_normal} Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
303 @c quantile_normal(95/100,0,1);
307 (%i1) load ("distrib")$
308 (%i2) quantile_normal(95/100,0,1);
310 (%o2) sqrt(2) inverse_erf(--)
313 (%o3) 1.644853626951472
316 @opencatbox{Categories:}
317 @category{Package distrib}
324 @deffn {Function} mean_normal (@var{m},@var{s})
325 Returns the mean of a @math{Normal(m,s)} random variable, with @math{s>0}, namely @var{m}. To make use of this function, write first @code{load("distrib")}.
327 @opencatbox{Categories:}
328 @category{Package distrib}
335 @deffn {Function} var_normal (@var{m},@var{s})
336 Returns the variance of a @math{Normal(m,s)} random variable, with @math{s>0}, namely @var{s^2}. To make use of this function, write first @code{load("distrib")}.
338 @opencatbox{Categories:}
339 @category{Package distrib}
345 @deffn {Function} std_normal (@var{m},@var{s})
346 Returns the standard deviation of a @math{Normal(m,s)} random variable, with @math{s>0}, namely @var{s}. To make use of this function, write first @code{load("distrib")}.
348 @opencatbox{Categories:}
349 @category{Package distrib}
355 @anchor{skewness_normal}
356 @deffn {Function} skewness_normal (@var{m},@var{s})
357 Returns the skewness coefficient of a @math{Normal(m,s)} random variable, with @math{s>0}, which is always equal to 0. To make use of this function, write first @code{load("distrib")}.
359 @opencatbox{Categories:}
360 @category{Package distrib}
366 @anchor{kurtosis_normal}
367 @deffn {Function} kurtosis_normal (@var{m},@var{s})
368 Returns the kurtosis coefficient of a @math{Normal(m,s)} random variable, with @math{s>0}, which is always equal to 0. To make use of this function, write first @code{load("distrib")}.
370 @opencatbox{Categories:}
371 @category{Package distrib}
377 @anchor{random_normal}
378 @deffn {Function} random_normal (@var{m},@var{s}) @
379 @fname{random_normal} (@var{m},@var{s},@var{n})
381 Returns a @math{Normal(m,s)} random variate, with @math{s>0}. Calling @code{random_normal} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
383 This is an implementation of the Box-Mueller algorithm, as described in Knuth, D.E. (1981) @var{Seminumerical Algorithms. The Art of Computer Programming.} Addison-Wesley.
385 To make use of this function, write first @code{load("distrib")}.
387 @opencatbox{Categories:}
388 @category{Package distrib}
389 @category{Random numbers}
395 @anchor{pdf_student_t}
396 @deffn {Function} pdf_student_t (@var{x},@var{n})
397 Returns the value at @var{x} of the density function of a Student random variable @math{t(n)}, with @math{n>0} degrees of freedom. To make use of this function, write first @code{load("distrib")}.
399 @opencatbox{Categories:}
400 @category{Package distrib}
406 @anchor{cdf_student_t}
407 @deffn {Function} cdf_student_t (@var{x},@var{n})
408 Returns the value at @var{x} of the distribution function of a Student random variable @math{t(n)}, with @math{n>0} degrees of freedom.
412 @c cdf_student_t(1/2, 7/3);
416 (%i1) load ("distrib")$
417 (%i2) cdf_student_t(1/2, 7/3);
419 beta_incomplete_regularized(-, -, --)
421 (%o2) 1 - -------------------------------------
424 (%o3) .6698450596140415
427 @opencatbox{Categories:}
428 @category{Package distrib}
434 @anchor{quantile_student_t}
435 @deffn {Function} quantile_student_t (@var{q},@var{n})
436 Returns the @var{q}-quantile of a Student random variable @math{t(n)}, with @math{n>0}; in other words, this is the inverse of @code{cdf_student_t}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
438 @opencatbox{Categories:}
439 @category{Package distrib}
445 @anchor{mean_student_t}
446 @deffn {Function} mean_student_t (@var{n})
447 Returns the mean of a Student random variable @math{t(n)}, with @math{n>0}, which is always equal to 0. To make use of this function, write first @code{load("distrib")}.
449 @opencatbox{Categories:}
450 @category{Package distrib}
456 @anchor{var_student_t}
457 @deffn {Function} var_student_t (@var{n})
458 Returns the variance of a Student random variable @math{t(n)}, with @math{n>2}.
465 (%i1) load ("distrib")$
466 (%i2) var_student_t(n);
472 @opencatbox{Categories:}
473 @category{Package distrib}
479 @anchor{std_student_t}
480 @deffn {Function} std_student_t (@var{n})
481 Returns the standard deviation of a Student random variable @math{t(n)}, with @math{n>2}. To make use of this function, write first @code{load("distrib")}.
483 @opencatbox{Categories:}
484 @category{Package distrib}
490 @anchor{skewness_student_t}
491 @deffn {Function} skewness_student_t (@var{n})
492 Returns the skewness coefficient of a Student random variable @math{t(n)}, with @math{n>3}, which is always equal to 0. To make use of this function, write first @code{load("distrib")}.
494 @opencatbox{Categories:}
495 @category{Package distrib}
501 @anchor{kurtosis_student_t}
502 @deffn {Function} kurtosis_student_t (@var{n})
503 Returns the kurtosis coefficient of a Student random variable @math{t(n)}, with @math{n>4}. To make use of this function, write first @code{load("distrib")}.
505 @opencatbox{Categories:}
506 @category{Package distrib}
512 @anchor{random_student_t}
513 @deffn {Function} random_student_t (@var{n}) @
514 @fname{random_student_t} (@var{n},@var{m})
516 Returns a Student random variate @math{t(n)}, with @math{n>0}. Calling @code{random_student_t} with a second argument @var{m}, a random sample of size @var{m} will be simulated.
518 The implemented algorithm is based on the fact that if @var{Z} is a normal random variable @math{N(0,1)} and @math{S^2} is a chi square random variable with @var{n} degrees of freedom, @math{Chi^2(n)}, then
530 $$X={{Z}\over{\sqrt{{S^2}\over{n}}}}$$
532 is a Student random variable with @var{n} degrees of freedom, @math{t(n)}.
534 To make use of this function, write first @code{load("distrib")}.
536 @opencatbox{Categories:}
537 @category{Package distrib}
538 @category{Random numbers}
544 @anchor{pdf_noncentral_student_t}
545 @deffn {Function} pdf_noncentral_student_t (@var{x},@var{n},@var{ncp})
546 Returns the value at @var{x} of the density function of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>0} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
548 Sometimes an extra work is necessary to get the final result.
552 @c expand(pdf_noncentral_student_t(3,5,0.1));
556 (%i1) load ("distrib")$
557 (%i2) expand(pdf_noncentral_student_t(3,5,0.1));
560 0.04296414417400905 5 1.323650307289301e-6 5
561 (%o2) ------------------------ + -------------------------
565 1.94793720435093e-4 5
566 + ------------------------
570 (%o3) .02080593159405669
573 @opencatbox{Categories:}
574 @category{Package distrib}
580 @anchor{cdf_noncentral_student_t}
581 @deffn {Function} cdf_noncentral_student_t (@var{x},@var{n},@var{ncp})
582 Returns the value at @var{x} of the distribution function of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>0} degrees of freedom and noncentrality parameter @math{ncp}. This function has no closed form and it is numerically computed.
586 @c cdf_noncentral_student_t(-2,5,-5);
589 (%i1) load ("distrib")$
590 (%i2) cdf_noncentral_student_t(-2,5,-5);
591 (%o2) .9952030093319743
594 @opencatbox{Categories:}
595 @category{Package distrib}
601 @anchor{quantile_noncentral_student_t}
602 @deffn {Function} quantile_noncentral_student_t (@var{q},@var{n},@var{ncp})
603 Returns the @var{q}-quantile of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>0} degrees of freedom and noncentrality parameter @math{ncp}; in other words, this is the inverse of @code{cdf_noncentral_student_t}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
605 @opencatbox{Categories:}
606 @category{Package distrib}
612 @anchor{mean_noncentral_student_t}
613 @deffn {Function} mean_noncentral_student_t (@var{n},@var{ncp})
614 Returns the mean of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>1} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
618 @c mean_noncentral_student_t(df,k);
621 (%i1) load ("distrib")$
622 (%i2) mean_noncentral_student_t(df,k);
624 gamma(------) sqrt(df) k
626 (%o2) ------------------------
632 @opencatbox{Categories:}
633 @category{Package distrib}
639 @anchor{var_noncentral_student_t}
640 @deffn {Function} var_noncentral_student_t (@var{n},@var{ncp})
641 Returns the variance of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>2} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
643 @opencatbox{Categories:}
644 @category{Package distrib}
650 @anchor{std_noncentral_student_t}
651 @deffn {Function} std_noncentral_student_t (@var{n},@var{ncp})
652 Returns the standard deviation of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>2} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
654 @opencatbox{Categories:}
655 @category{Package distrib}
661 @anchor{skewness_noncentral_student_t}
662 @deffn {Function} skewness_noncentral_student_t (@var{n},@var{ncp})
663 Returns the skewness coefficient of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>3} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
665 @opencatbox{Categories:}
666 @category{Package distrib}
672 @anchor{kurtosis_noncentral_student_t}
673 @deffn {Function} kurtosis_noncentral_student_t (@var{n},@var{ncp})
674 Returns the kurtosis coefficient of a noncentral Student random variable @math{nc_t(n,ncp)}, with @math{n>4} degrees of freedom and noncentrality parameter @math{ncp}. To make use of this function, write first @code{load("distrib")}.
676 @opencatbox{Categories:}
677 @category{Package distrib}
683 @anchor{random_noncentral_student_t}
684 @deffn {Function} random_noncentral_student_t (@var{n},@var{ncp}) @
685 @fname{random_noncentral_student_t} (@var{n},@var{ncp},@var{m})
687 Returns a noncentral Student random variate @math{nc_t(n,ncp)}, with @math{n>0}. Calling @code{random_noncentral_student_t} with a third argument @var{m}, a random sample of size @var{m} will be simulated.
689 The implemented algorithm is based on the fact that if @var{X} is a normal random variable @math{N(ncp,1)} and @math{S^2} is a chi square random variable with @var{n} degrees of freedom, @math{Chi^2(n)}, then
701 $$U={{X}\over{\sqrt{{S^2}\over{n}}}}$$
703 is a noncentral Student random variable with @var{n} degrees of freedom and noncentrality parameter @math{ncp}, @math{nc_t(n,ncp)}.
705 To make use of this function, write first @code{load("distrib")}.
707 @opencatbox{Categories:}
708 @category{Package distrib}
709 @category{Random numbers}
716 @deffn {Function} pdf_chi2 (@var{x},@var{n})
717 Returns the value at @var{x} of the density function of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
718 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
725 (%i1) load ("distrib")$
729 (%o2) ----------------
735 @opencatbox{Categories:}
736 @category{Package distrib}
743 @deffn {Function} cdf_chi2 (@var{x},@var{n})
744 Returns the value at @var{x} of the distribution function of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
752 (%i1) load ("distrib")$
755 (%o2) 1 - gamma_incomplete_regularized(2, -)
758 (%o3) .4421745996289256
761 @opencatbox{Categories:}
762 @category{Package distrib}
768 @anchor{quantile_chi2}
769 @deffn {Function} quantile_chi2 (@var{q},@var{n})
770 Returns the @var{q}-quantile of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}; in other words, this is the inverse of @code{cdf_chi2}. Argument @var{q} must be an element of @math{[0,1]}.
772 This function has no closed form and it is numerically computed.
776 @c quantile_chi2(0.99,9);
779 (%i1) load ("distrib")$
780 (%i2) quantile_chi2(0.99,9);
781 (%o2) 21.66599433346194
784 @opencatbox{Categories:}
785 @category{Package distrib}
792 @deffn {Function} mean_chi2 (@var{n})
793 Returns the mean of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
795 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
802 (%i1) load ("distrib")$
807 @opencatbox{Categories:}
808 @category{Package distrib}
815 @deffn {Function} var_chi2 (@var{n})
816 Returns the variance of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
818 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
825 (%i1) load ("distrib")$
830 @opencatbox{Categories:}
831 @category{Package distrib}
838 @deffn {Function} std_chi2 (@var{n})
839 Returns the standard deviation of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
841 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
848 (%i1) load ("distrib")$
850 (%o2) sqrt(2) sqrt(n)
853 @opencatbox{Categories:}
854 @category{Package distrib}
860 @anchor{skewness_chi2}
861 @deffn {Function} skewness_chi2 (@var{n})
862 Returns the skewness coefficient of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
864 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
871 (%i1) load ("distrib")$
872 (%i2) skewness_chi2(n);
879 @opencatbox{Categories:}
880 @category{Package distrib}
886 @anchor{kurtosis_chi2}
887 @deffn {Function} kurtosis_chi2 (@var{n})
888 Returns the kurtosis coefficient of a Chi-square random variable @math{Chi^2(n)}, with @math{n>0}.
890 The @math{Chi^2(n)} random variable is equivalent to the @math{Gamma(n/2,2)}.
897 (%i1) load ("distrib")$
898 (%i2) kurtosis_chi2(n);
904 @opencatbox{Categories:}
905 @category{Package distrib}
912 @deffn {Function} random_chi2 (@var{n}) @
913 @fname{random_chi2} (@var{n},@var{m})
915 Returns a Chi-square random variate @math{Chi^2(n)}, with @math{n>0}. Calling @code{random_chi2} with a second argument @var{m}, a random sample of size @var{m} will be simulated.
917 The simulation is based on the Ahrens-Cheng algorithm. See @code{random_gamma} for details.
919 To make use of this function, write first @code{load("distrib")}.
921 @opencatbox{Categories:}
922 @category{Package distrib}
923 @category{Random numbers}
929 @anchor{pdf_noncentral_chi2}
930 @deffn {Function} pdf_noncentral_chi2 (@var{x},@var{n},@var{ncp})
931 Returns the value at @var{x} of the density function of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}. To make use of this function, write first @code{load("distrib")}.
933 @opencatbox{Categories:}
934 @category{Package distrib}
940 @anchor{cdf_noncentral_chi2}
941 @deffn {Function} cdf_noncentral_chi2 (@var{x},@var{n},@var{ncp})
942 Returns the value at @var{x} of the distribution function of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}. To make use of this function, write first @code{load("distrib")}.
944 @opencatbox{Categories:}
945 @category{Package distrib}
951 @anchor{quantile_noncentral_chi2}
952 @deffn {Function} quantile_noncentral_chi2 (@var{q},@var{n},@var{ncp})
953 Returns the @var{q}-quantile of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}; in other words, this is the inverse of @code{cdf_noncentral_chi2}. Argument @var{q} must be an element of @math{[0,1]}.
955 This function has no closed form and it is numerically computed.
957 @opencatbox{Categories:}
958 @category{Package distrib}
964 @anchor{mean_noncentral_chi2}
965 @deffn {Function} mean_noncentral_chi2 (@var{n},@var{ncp})
966 Returns the mean of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}.
968 @opencatbox{Categories:}
969 @category{Package distrib}
975 @anchor{var_noncentral_chi2}
976 @deffn {Function} var_noncentral_chi2 (@var{n},@var{ncp})
977 Returns the variance of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}.
979 @opencatbox{Categories:}
980 @category{Package distrib}
986 @anchor{std_noncentral_chi2}
987 @deffn {Function} std_noncentral_chi2 (@var{n},@var{ncp})
988 Returns the standard deviation of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}.
990 @opencatbox{Categories:}
991 @category{Package distrib}
997 @anchor{skewness_noncentral_chi2}
998 @deffn {Function} skewness_noncentral_chi2 (@var{n},@var{ncp})
999 Returns the skewness coefficient of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}.
1001 @opencatbox{Categories:}
1002 @category{Package distrib}
1008 @anchor{kurtosis_noncentral_chi2}
1009 @deffn {Function} kurtosis_noncentral_chi2 (@var{n},@var{ncp})
1010 Returns the kurtosis coefficient of a noncentral Chi-square random variable @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}.
1012 @opencatbox{Categories:}
1013 @category{Package distrib}
1019 @anchor{random_noncentral_chi2}
1020 @deffn {Function} random_noncentral_chi2 (@var{n},@var{ncp}) @
1021 @fname{random_noncentral_chi2} (@var{n},@var{ncp},@var{m})
1023 Returns a noncentral Chi-square random variate @math{nc_Chi^2(n,ncp)}, with @math{n>0} and noncentrality parameter @math{ncp>=0}. Calling @code{random_noncentral_chi2} with a third argument @var{m}, a random sample of size @var{m} will be simulated.
1025 To make use of this function, write first @code{load("distrib")}.
1027 @opencatbox{Categories:}
1028 @category{Package distrib}
1029 @category{Random numbers}
1037 @deffn {Function} pdf_f (@var{x},@var{m},@var{n})
1038 Returns the value at @var{x} of the density function of a F random variable @math{F(m,n)}, with @math{m,n>0}. To make use of this function, write first @code{load("distrib")}.
1040 @opencatbox{Categories:}
1041 @category{Package distrib}
1048 @deffn {Function} cdf_f (@var{x},@var{m},@var{n})
1049 Returns the value at @var{x} of the distribution function of a F random variable @math{F(m,n)}, with @math{m,n>0}.
1052 @c load ("distrib")$
1057 (%i1) load ("distrib")$
1058 (%i2) cdf_f(2,3,9/4);
1060 (%o2) 1 - beta_incomplete_regularized(-, -, --)
1063 (%o3) 0.66756728179008
1066 @opencatbox{Categories:}
1067 @category{Package distrib}
1074 @deffn {Function} quantile_f (@var{q},@var{m},@var{n})
1075 Returns the @var{q}-quantile of a F random variable @math{F(m,n)}, with @math{m,n>0}; in other words, this is the inverse of @code{cdf_f}. Argument @var{q} must be an element of @math{[0,1]}.
1078 @c load ("distrib")$
1079 @c quantile_f(2/5,sqrt(3),5);
1082 (%i1) load ("distrib")$
1083 (%i2) quantile_f(2/5,sqrt(3),5);
1084 (%o2) 0.518947838573693
1087 @opencatbox{Categories:}
1088 @category{Package distrib}
1095 @deffn {Function} mean_f (@var{m},@var{n})
1096 Returns the mean of a F random variable @math{F(m,n)}, with @math{m>0, n>2}. To make use of this function, write first @code{load("distrib")}.
1098 @opencatbox{Categories:}
1099 @category{Package distrib}
1106 @deffn {Function} var_f (@var{m},@var{n})
1107 Returns the variance of a F random variable @math{F(m,n)}, with @math{m>0, n>4}. To make use of this function, write first @code{load("distrib")}.
1109 @opencatbox{Categories:}
1110 @category{Package distrib}
1117 @deffn {Function} std_f (@var{m},@var{n})
1118 Returns the standard deviation of a F random variable @math{F(m,n)}, with @math{m>0, n>4}. To make use of this function, write first @code{load("distrib")}.
1120 @opencatbox{Categories:}
1121 @category{Package distrib}
1128 @deffn {Function} skewness_f (@var{m},@var{n})
1129 Returns the skewness coefficient of a F random variable @math{F(m,n)}, with @math{m>0, n>6}. To make use of this function, write first @code{load("distrib")}.
1131 @opencatbox{Categories:}
1132 @category{Package distrib}
1139 @deffn {Function} kurtosis_f (@var{m},@var{n})
1140 Returns the kurtosis coefficient of a F random variable @math{F(m,n)}, with @math{m>0, n>8}. To make use of this function, write first @code{load("distrib")}.
1142 @opencatbox{Categories:}
1143 @category{Package distrib}
1150 @deffn {Function} random_f (@var{m},@var{n}) @
1151 @fname{random_f} (@var{m},@var{n},@var{k})
1153 Returns a F random variate @math{F(m,n)}, with @math{m,n>0}. Calling @code{random_f} with a third argument @var{k}, a random sample of size @var{k} will be simulated.
1155 The simulation algorithm is based on the fact that if @var{X} is a @math{Chi^2(m)} random variable and @math{Y} is a @math{Chi^2(n)} random variable, then
1164 $$F={{n X}\over{m Y}}$$
1166 is a F random variable with @var{m} and @var{n} degrees of freedom, @math{F(m,n)}.
1168 To make use of this function, write first @code{load("distrib")}.
1170 @opencatbox{Categories:}
1171 @category{Package distrib}
1172 @category{Random numbers}
1179 @deffn {Function} pdf_exp (@var{x},@var{m})
1180 Returns the value at @var{x} of the density function of an @math{Exponential(m)} random variable, with @math{m>0}.
1182 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1185 @c load ("distrib")$
1189 (%i1) load ("distrib")$
1195 @opencatbox{Categories:}
1196 @category{Package distrib}
1203 @deffn {Function} cdf_exp (@var{x},@var{m})
1204 Returns the value at @var{x} of the distribution function of an @math{Exponential(m)} random variable, with @math{m>0}.
1206 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1209 @c load ("distrib")$
1213 (%i1) load ("distrib")$
1219 @opencatbox{Categories:}
1220 @category{Package distrib}
1226 @anchor{quantile_exp}
1227 @deffn {Function} quantile_exp (@var{q},@var{m})
1228 Returns the @var{q}-quantile of an @math{Exponential(m)} random variable, with @math{m>0}; in other words, this is the inverse of @code{cdf_exp}. Argument @var{q} must be an element of @math{[0,1]}.
1230 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1233 @c load ("distrib")$
1234 @c quantile_exp(0.56,5);
1235 @c quantile_exp(0.56,m);
1238 (%i1) load ("distrib")$
1239 (%i2) quantile_exp(0.56,5);
1240 (%o2) .1641961104139661
1241 (%i3) quantile_exp(0.56,m);
1243 (%o3) ------------------
1247 @opencatbox{Categories:}
1248 @category{Package distrib}
1255 @deffn {Function} mean_exp (@var{m})
1256 Returns the mean of an @math{Exponential(m)} random variable, with @math{m>0}.
1258 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1261 @c load ("distrib")$
1265 (%i1) load ("distrib")$
1272 @opencatbox{Categories:}
1273 @category{Package distrib}
1280 @deffn {Function} var_exp (@var{m})
1281 Returns the variance of an @math{Exponential(m)} random variable, with @math{m>0}.
1283 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1286 @c load ("distrib")$
1290 (%i1) load ("distrib")$
1298 @opencatbox{Categories:}
1299 @category{Package distrib}
1306 @deffn {Function} std_exp (@var{m})
1307 Returns the standard deviation of an @math{Exponential(m)} random variable, with @math{m>0}.
1309 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1312 @c load ("distrib")$
1316 (%i1) load ("distrib")$
1323 @opencatbox{Categories:}
1324 @category{Package distrib}
1330 @anchor{skewness_exp}
1331 @deffn {Function} skewness_exp (@var{m})
1332 Returns the skewness coefficient of an @math{Exponential(m)} random variable, with @math{m>0}.
1334 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1337 @c load ("distrib")$
1341 (%i1) load ("distrib")$
1342 (%i2) skewness_exp(m);
1346 @opencatbox{Categories:}
1347 @category{Package distrib}
1353 @anchor{kurtosis_exp}
1354 @deffn {Function} kurtosis_exp (@var{m})
1355 Returns the kurtosis coefficient of an @math{Exponential(m)} random variable, with @math{m>0}.
1357 The @math{Exponential(m)} random variable is equivalent to the @math{Weibull(1,1/m)}.
1360 @c load ("distrib")$
1364 (%i1) load ("distrib")$
1365 (%i2) kurtosis_exp(m);
1369 @opencatbox{Categories:}
1370 @category{Package distrib}
1377 @deffn {Function} random_exp (@var{m}) @
1378 @fname{random_exp} (@var{m},@var{k})
1380 Returns an @math{Exponential(m)} random variate, with @math{m>0}. Calling @code{random_exp} with a second argument @var{k}, a random sample of size @var{k} will be simulated.
1382 The simulation algorithm is based on the general inverse method.
1384 To make use of this function, write first @code{load("distrib")}.
1386 @opencatbox{Categories:}
1387 @category{Package distrib}
1388 @category{Random numbers}
1394 @anchor{pdf_lognormal}
1395 @deffn {Function} pdf_lognormal (@var{x},@var{m},@var{s})
1396 Returns the value at @var{x} of the density function of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1398 @opencatbox{Categories:}
1399 @category{Package distrib}
1405 @anchor{cdf_lognormal}
1406 @deffn {Function} cdf_lognormal (@var{x},@var{m},@var{s})
1407 Returns the value at @var{x} of the distribution function of a @math{Lognormal(m,s)} random variable, with @math{s>0}. This function is defined in terms of Maxima's built-in error function @code{erf}.
1410 @c load ("distrib")$
1411 @c cdf_lognormal(x,m,s);
1414 (%i1) load ("distrib")$
1415 (%i2) cdf_lognormal(x,m,s);
1420 (%o2) --------------- + -
1425 See also @mrefdot{erf}
1427 @opencatbox{Categories:}
1428 @category{Package distrib}
1434 @anchor{quantile_lognormal}
1435 @deffn {Function} quantile_lognormal (@var{q},@var{m},@var{s})
1436 Returns the @var{q}-quantile of a @math{Lognormal(m,s)} random variable, with @math{s>0}; in other words, this is the inverse of @code{cdf_lognormal}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
1439 @c load ("distrib")$
1440 @c quantile_lognormal(95/100,0,1);
1444 (%i1) load ("distrib")$
1445 (%i2) quantile_lognormal(95/100,0,1);
1446 sqrt(2) inverse_erf(9/10)
1449 (%o3) 5.180251602233015
1452 @opencatbox{Categories:}
1453 @category{Package distrib}
1459 @anchor{mean_lognormal}
1460 @deffn {Function} mean_lognormal (@var{m},@var{s})
1461 Returns the mean of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1463 @opencatbox{Categories:}
1464 @category{Package distrib}
1470 @anchor{var_lognormal}
1471 @deffn {Function} var_lognormal (@var{m},@var{s})
1472 Returns the variance of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1474 @opencatbox{Categories:}
1475 @category{Package distrib}
1480 @anchor{std_lognormal}
1481 @deffn {Function} std_lognormal (@var{m},@var{s})
1482 Returns the standard deviation of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1484 @opencatbox{Categories:}
1485 @category{Package distrib}
1491 @anchor{skewness_lognormal}
1492 @deffn {Function} skewness_lognormal (@var{m},@var{s})
1493 Returns the skewness coefficient of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1495 @opencatbox{Categories:}
1496 @category{Package distrib}
1502 @anchor{kurtosis_lognormal}
1503 @deffn {Function} kurtosis_lognormal (@var{m},@var{s})
1504 Returns the kurtosis coefficient of a @math{Lognormal(m,s)} random variable, with @math{s>0}. To make use of this function, write first @code{load("distrib")}.
1506 @opencatbox{Categories:}
1507 @category{Package distrib}
1513 @anchor{random_lognormal}
1514 @deffn {Function} random_lognormal (@var{m},@var{s}) @
1515 @fname{random_lognormal} (@var{m},@var{s},@var{n})
1517 Returns a @math{Lognormal(m,s)} random variate, with @math{s>0}. Calling @code{random_lognormal} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
1519 Log-normal variates are simulated by means of random normal variates. See @code{random_normal} for details.
1521 To make use of this function, write first @code{load("distrib")}.
1523 @opencatbox{Categories:}
1524 @category{Package distrib}
1525 @category{Random numbers}
1532 @deffn {Function} pdf_gamma (@var{x},@var{a},@var{b})
1533 Returns the value at @var{x} of the density function of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1535 @opencatbox{Categories:}
1536 @category{Package distrib}
1543 @deffn {Function} cdf_gamma (@var{x},@var{a},@var{b})
1544 Returns the value at @var{x} of the distribution function of a @math{Gamma(a,b)} random variable, with @math{a,b>0}.
1547 @c load ("distrib")$
1548 @c cdf_gamma(3,5,21);
1552 (%i1) load ("distrib")$
1553 (%i2) cdf_gamma(3,5,21);
1555 (%o2) 1 - gamma_incomplete_regularized(5, -)
1558 (%o3) 4.402663157376807E-7
1561 @opencatbox{Categories:}
1562 @category{Package distrib}
1568 @anchor{quantile_gamma}
1569 @deffn {Function} quantile_gamma (@var{q},@var{a},@var{b})
1570 Returns the @var{q}-quantile of a @math{Gamma(a,b)} random variable, with @math{a,b>0}; in other words, this is the inverse of @code{cdf_gamma}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
1572 @opencatbox{Categories:}
1573 @category{Package distrib}
1580 @deffn {Function} mean_gamma (@var{a},@var{b})
1581 Returns the mean of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1583 @opencatbox{Categories:}
1584 @category{Package distrib}
1591 @deffn {Function} var_gamma (@var{a},@var{b})
1592 Returns the variance of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1594 @opencatbox{Categories:}
1595 @category{Package distrib}
1601 @deffn {Function} std_gamma (@var{a},@var{b})
1602 Returns the standard deviation of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1604 @opencatbox{Categories:}
1605 @category{Package distrib}
1611 @anchor{skewness_gamma}
1612 @deffn {Function} skewness_gamma (@var{a},@var{b})
1613 Returns the skewness coefficient of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1615 @opencatbox{Categories:}
1616 @category{Package distrib}
1622 @anchor{kurtosis_gamma}
1623 @deffn {Function} kurtosis_gamma (@var{a},@var{b})
1624 Returns the kurtosis coefficient of a @math{Gamma(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1626 @opencatbox{Categories:}
1627 @category{Package distrib}
1633 @anchor{random_gamma}
1634 @deffn {Function} random_gamma (@var{a},@var{b}) @
1635 @fname{random_gamma} (@var{a},@var{b},@var{n})
1637 Returns a @math{Gamma(a,b)} random variate, with @math{a,b>0}. Calling @code{random_gamma} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
1639 The implemented algorithm is a combination of two procedures, depending on the value of parameter @var{a}:
1641 For @math{a>=1}, Cheng, R.C.H. and Feast, G.M. (1979). @var{Some simple gamma variate generators}. Appl. Stat., 28, 3, 290-295.
1643 For @math{0<a<1}, Ahrens, J.H. and Dieter, U. (1974). @var{Computer methods for sampling from gamma, beta, poisson and binomial cdf_tributions}. Computing, 12, 223-246.
1645 To make use of this function, write first @code{load("distrib")}.
1647 @opencatbox{Categories:}
1648 @category{Package distrib}
1649 @category{Random numbers}
1656 @deffn {Function} pdf_beta (@var{x},@var{a},@var{b})
1657 Returns the value at @var{x} of the density function of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1659 @opencatbox{Categories:}
1660 @category{Package distrib}
1668 @deffn {Function} cdf_beta (@var{x},@var{a},@var{b})
1669 Returns the value at @var{x} of the distribution function of a @math{Beta(a,b)} random variable, with @math{a,b>0}.
1672 @c load ("distrib")$
1673 @c cdf_beta(1/3,15,2);
1677 (%i1) load ("distrib")$
1678 (%i2) cdf_beta(1/3,15,2);
1683 (%o3) 7.666089131388195E-7
1686 @opencatbox{Categories:}
1687 @category{Package distrib}
1693 @anchor{quantile_beta}
1694 @deffn {Function} quantile_beta (@var{q},@var{a},@var{b})
1695 Returns the @var{q}-quantile of a @math{Beta(a,b)} random variable, with @math{a,b>0}; in other words, this is the inverse of @code{cdf_beta}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
1697 @opencatbox{Categories:}
1698 @category{Package distrib}
1705 @deffn {Function} mean_beta (@var{a},@var{b})
1706 Returns the mean of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1708 @opencatbox{Categories:}
1709 @category{Package distrib}
1716 @deffn {Function} var_beta (@var{a},@var{b})
1717 Returns the variance of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1719 @opencatbox{Categories:}
1720 @category{Package distrib}
1726 @deffn {Function} std_beta (@var{a},@var{b})
1727 Returns the standard deviation of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1729 @opencatbox{Categories:}
1730 @category{Package distrib}
1736 @anchor{skewness_beta}
1737 @deffn {Function} skewness_beta (@var{a},@var{b})
1738 Returns the skewness coefficient of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1740 @opencatbox{Categories:}
1741 @category{Package distrib}
1747 @anchor{kurtosis_beta}
1748 @deffn {Function} kurtosis_beta (@var{a},@var{b})
1749 Returns the kurtosis coefficient of a @math{Beta(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1751 @opencatbox{Categories:}
1752 @category{Package distrib}
1758 @anchor{random_beta}
1759 @deffn {Function} random_beta (@var{a},@var{b}) @
1760 @fname{random_beta} (@var{a},@var{b},@var{n})
1762 Returns a @math{Beta(a,b)} random variate, with @math{a,b>0}. Calling @code{random_beta} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
1764 The implemented algorithm is defined in Cheng, R.C.H. (1978). @var{Generating Beta Variates with Nonintegral Shape Parameters}. Communications of the ACM, 21:317-322
1766 To make use of this function, write first @code{load("distrib")}.
1768 @opencatbox{Categories:}
1769 @category{Package distrib}
1770 @category{Random numbers}
1775 @anchor{pdf_continuous_uniform}
1776 @deffn {Function} pdf_continuous_uniform (@var{x},@var{a},@var{b})
1777 Returns the value at @var{x} of the density function of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1779 @opencatbox{Categories:}
1780 @category{Package distrib}
1786 @anchor{cdf_continuous_uniform}
1787 @deffn {Function} cdf_continuous_uniform (@var{x},@var{a},@var{b})
1788 Returns the value at @var{x} of the distribution function of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1790 @opencatbox{Categories:}
1791 @category{Package distrib}
1797 @anchor{quantile_continuous_uniform}
1798 @deffn {Function} quantile_continuous_uniform (@var{q},@var{a},@var{b})
1799 Returns the @var{q}-quantile of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}; in other words, this is the inverse of @code{cdf_continuous_uniform}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
1801 @opencatbox{Categories:}
1802 @category{Package distrib}
1808 @anchor{mean_continuous_uniform}
1809 @deffn {Function} mean_continuous_uniform (@var{a},@var{b})
1810 Returns the mean of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1812 @opencatbox{Categories:}
1813 @category{Package distrib}
1819 @anchor{var_continuous_uniform}
1820 @deffn {Function} var_continuous_uniform (@var{a},@var{b})
1821 Returns the variance of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1823 @opencatbox{Categories:}
1824 @category{Package distrib}
1829 @anchor{std_continuous_uniform}
1830 @deffn {Function} std_continuous_uniform (@var{a},@var{b})
1831 Returns the standard deviation of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1833 @opencatbox{Categories:}
1834 @category{Package distrib}
1840 @anchor{skewness_continuous_uniform}
1841 @deffn {Function} skewness_continuous_uniform (@var{a},@var{b})
1842 Returns the skewness coefficient of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1844 @opencatbox{Categories:}
1845 @category{Package distrib}
1851 @anchor{kurtosis_continuous_uniform}
1852 @deffn {Function} kurtosis_continuous_uniform (@var{a},@var{b})
1853 Returns the kurtosis coefficient of a @math{Continuous Uniform(a,b)} random variable, with @math{a<b}. To make use of this function, write first @code{load("distrib")}.
1855 @opencatbox{Categories:}
1856 @category{Package distrib}
1862 @anchor{random_continuous_uniform}
1863 @deffn {Function} random_continuous_uniform (@var{a},@var{b}) @
1864 @fname{random_continuous_uniform} (@var{a},@var{b},@var{n})
1866 Returns a @math{Continuous Uniform(a,b)} random variate, with @math{a<b}. Calling @code{random_continuous_uniform} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
1868 This is a direct application of the @code{random} built-in Maxima function.
1870 See also @mrefdot{random} To make use of this function, write first @code{load("distrib")}.
1872 @opencatbox{Categories:}
1873 @category{Package distrib}
1874 @category{Random numbers}
1880 @anchor{pdf_logistic}
1881 @deffn {Function} pdf_logistic (@var{x},@var{a},@var{b})
1882 Returns the value at @var{x} of the density function of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1884 @opencatbox{Categories:}
1885 @category{Package distrib}
1891 @anchor{cdf_logistic}
1892 @deffn {Function} cdf_logistic (@var{x},@var{a},@var{b})
1893 Returns the value at @var{x} of the distribution function of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1895 @opencatbox{Categories:}
1896 @category{Package distrib}
1902 @anchor{quantile_logistic}
1903 @deffn {Function} quantile_logistic (@var{q},@var{a},@var{b})
1904 Returns the @var{q}-quantile of a @math{Logistic(a,b)} random variable , with @math{b>0}; in other words, this is the inverse of @code{cdf_logistic}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
1906 @opencatbox{Categories:}
1907 @category{Package distrib}
1913 @anchor{mean_logistic}
1914 @deffn {Function} mean_logistic (@var{a},@var{b})
1915 Returns the mean of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1917 @opencatbox{Categories:}
1918 @category{Package distrib}
1924 @anchor{var_logistic}
1925 @deffn {Function} var_logistic (@var{a},@var{b})
1926 Returns the variance of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1928 @opencatbox{Categories:}
1929 @category{Package distrib}
1935 @anchor{std_logistic}
1936 @deffn {Function} std_logistic (@var{a},@var{b})
1937 Returns the standard deviation of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1939 @opencatbox{Categories:}
1940 @category{Package distrib}
1946 @anchor{skewness_logistic}
1947 @deffn {Function} skewness_logistic (@var{a},@var{b})
1948 Returns the skewness coefficient of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1950 @opencatbox{Categories:}
1951 @category{Package distrib}
1957 @anchor{kurtosis_logistic}
1958 @deffn {Function} kurtosis_logistic (@var{a},@var{b})
1959 Returns the kurtosis coefficient of a @math{Logistic(a,b)} random variable , with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
1961 @opencatbox{Categories:}
1962 @category{Package distrib}
1968 @anchor{random_logistic}
1969 @deffn {Function} random_logistic (@var{a},@var{b}) @
1970 @fname{random_logistic} (@var{a},@var{b},@var{n})
1972 Returns a @math{Logistic(a,b)} random variate, with @math{b>0}. Calling @code{random_logistic} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
1974 The implemented algorithm is based on the general inverse method.
1976 To make use of this function, write first @code{load("distrib")}.
1978 @opencatbox{Categories:}
1979 @category{Package distrib}
1980 @category{Random numbers}
1987 @deffn {Function} pdf_pareto (@var{x},@var{a},@var{b})
1988 Returns the value at @var{x} of the density function of a @math{Pareto(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
1990 @opencatbox{Categories:}
1991 @category{Package distrib}
1998 @deffn {Function} cdf_pareto (@var{x},@var{a},@var{b})
1999 Returns the value at @var{x} of the distribution function of a @math{Pareto(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2001 @opencatbox{Categories:}
2002 @category{Package distrib}
2008 @anchor{quantile_pareto}
2009 @deffn {Function} quantile_pareto (@var{q},@var{a},@var{b})
2010 Returns the @var{q}-quantile of a @math{Pareto(a,b)} random variable, with @math{a,b>0}; in other words, this is the inverse of @code{cdf_pareto}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2012 @opencatbox{Categories:}
2013 @category{Package distrib}
2019 @anchor{mean_pareto}
2020 @deffn {Function} mean_pareto (@var{a},@var{b})
2021 Returns the mean of a @math{Pareto(a,b)} random variable, with @math{a>1,b>0}. To make use of this function, write first @code{load("distrib")}.
2023 @opencatbox{Categories:}
2024 @category{Package distrib}
2031 @deffn {Function} var_pareto (@var{a},@var{b})
2032 Returns the variance of a @math{Pareto(a,b)} random variable, with @math{a>2,b>0}. To make use of this function, write first @code{load("distrib")}.
2034 @opencatbox{Categories:}
2035 @category{Package distrib}
2041 @deffn {Function} std_pareto (@var{a},@var{b})
2042 Returns the standard deviation of a @math{Pareto(a,b)} random variable, with @math{a>2,b>0}. To make use of this function, write first @code{load("distrib")}.
2044 @opencatbox{Categories:}
2045 @category{Package distrib}
2052 @anchor{skewness_pareto}
2053 @deffn {Function} skewness_pareto (@var{a},@var{b})
2054 Returns the skewness coefficient of a @math{Pareto(a,b)} random variable, with @math{a>3,b>0}. To make use of this function, write first @code{load("distrib")}.
2056 @opencatbox{Categories:}
2057 @category{Package distrib}
2063 @anchor{kurtosis_pareto}
2064 @deffn {Function} kurtosis_pareto (@var{a},@var{b})
2065 Returns the kurtosis coefficient of a @math{Pareto(a,b)} random variable, with @math{a>4,b>0}. To make use of this function, write first @code{load("distrib")}.
2067 @opencatbox{Categories:}
2068 @category{Package distrib}
2074 @anchor{random_pareto}
2075 @deffn {Function} random_pareto (@var{a},@var{b}) @
2076 @fname{random_pareto} (@var{a},@var{b},@var{n})
2078 Returns a @math{Pareto(a,b)} random variate, with @math{a>0,b>0}. Calling @code{random_pareto} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
2080 The implemented algorithm is based on the general inverse method.
2082 To make use of this function, write first @code{load("distrib")}.
2084 @opencatbox{Categories:}
2085 @category{Package distrib}
2086 @category{Random numbers}
2092 @anchor{pdf_weibull}
2093 @deffn {Function} pdf_weibull (@var{x},@var{a},@var{b})
2094 Returns the value at @var{x} of the density function of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2096 @opencatbox{Categories:}
2097 @category{Package distrib}
2103 @anchor{cdf_weibull}
2104 @deffn {Function} cdf_weibull (@var{x},@var{a},@var{b})
2105 Returns the value at @var{x} of the distribution function of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2107 @opencatbox{Categories:}
2108 @category{Package distrib}
2114 @anchor{quantile_weibull}
2115 @deffn {Function} quantile_weibull (@var{q},@var{a},@var{b})
2116 Returns the @var{q}-quantile of a @math{Weibull(a,b)} random variable, with @math{a,b>0}; in other words, this is the inverse of @code{cdf_weibull}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2118 @opencatbox{Categories:}
2119 @category{Package distrib}
2125 @anchor{mean_weibull}
2126 @deffn {Function} mean_weibull (@var{a},@var{b})
2127 Returns the mean of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2129 @opencatbox{Categories:}
2130 @category{Package distrib}
2136 @anchor{var_weibull}
2137 @deffn {Function} var_weibull (@var{a},@var{b})
2138 Returns the variance of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2140 @opencatbox{Categories:}
2141 @category{Package distrib}
2146 @anchor{std_weibull}
2147 @deffn {Function} std_weibull (@var{a},@var{b})
2148 Returns the standard deviation of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2150 @opencatbox{Categories:}
2151 @category{Package distrib}
2158 @anchor{skewness_weibull}
2159 @deffn {Function} skewness_weibull (@var{a},@var{b})
2160 Returns the skewness coefficient of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2162 @opencatbox{Categories:}
2163 @category{Package distrib}
2169 @anchor{kurtosis_weibull}
2170 @deffn {Function} kurtosis_weibull (@var{a},@var{b})
2171 Returns the kurtosis coefficient of a @math{Weibull(a,b)} random variable, with @math{a,b>0}. To make use of this function, write first @code{load("distrib")}.
2173 @opencatbox{Categories:}
2174 @category{Package distrib}
2180 @anchor{random_weibull}
2181 @deffn {Function} random_weibull (@var{a},@var{b}) @
2182 @fname{random_weibull} (@var{a},@var{b},@var{n})
2184 Returns a @math{Weibull(a,b)} random variate, with @math{a,b>0}. Calling @code{random_weibull} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
2186 The implemented algorithm is based on the general inverse method.
2188 To make use of this function, write first @code{load("distrib")}.
2190 @opencatbox{Categories:}
2191 @category{Package distrib}
2192 @category{Random numbers}
2199 @anchor{pdf_rayleigh}
2200 @deffn {Function} pdf_rayleigh (@var{x},@var{b})
2201 Returns the value at @var{x} of the density function of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2203 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2206 @c load ("distrib")$
2207 @c pdf_rayleigh(x,b);
2210 (%i1) load ("distrib")$
2211 (%i2) pdf_rayleigh(x,b);
2217 @opencatbox{Categories:}
2218 @category{Package distrib}
2224 @anchor{cdf_rayleigh}
2225 @deffn {Function} cdf_rayleigh (@var{x},@var{b})
2226 Returns the value at @var{x} of the distribution function of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2228 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2231 @c load ("distrib")$
2232 @c cdf_rayleigh(x,b);
2235 (%i1) load ("distrib")$
2236 (%i2) cdf_rayleigh(x,b);
2242 @opencatbox{Categories:}
2243 @category{Package distrib}
2249 @anchor{quantile_rayleigh}
2250 @deffn {Function} quantile_rayleigh (@var{q},@var{b})
2251 Returns the @var{q}-quantile of a @math{Rayleigh(b)} random variable, with @math{b>0}; in other words, this is the inverse of @code{cdf_rayleigh}. Argument @var{q} must be an element of @math{[0,1]}.
2253 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2256 @c load ("distrib")$
2257 @c quantile_rayleigh(0.99,b);
2260 (%i1) load ("distrib")$
2261 (%i2) quantile_rayleigh(0.99,b);
2263 (%o2) -----------------
2267 @opencatbox{Categories:}
2268 @category{Package distrib}
2274 @anchor{mean_rayleigh}
2275 @deffn {Function} mean_rayleigh (@var{b})
2276 Returns the mean of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2278 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2281 @c load ("distrib")$
2282 @c mean_rayleigh(b);
2285 (%i1) load ("distrib")$
2286 (%i2) mean_rayleigh(b);
2292 @opencatbox{Categories:}
2293 @category{Package distrib}
2299 @anchor{var_rayleigh}
2300 @deffn {Function} var_rayleigh (@var{b})
2301 Returns the variance of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2303 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2306 @c load ("distrib")$
2310 (%i1) load ("distrib")$
2311 (%i2) var_rayleigh(b);
2320 @opencatbox{Categories:}
2321 @category{Package distrib}
2327 @anchor{std_rayleigh}
2328 @deffn {Function} std_rayleigh (@var{b})
2329 Returns the standard deviation of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2331 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2334 @c load ("distrib")$
2338 (%i1) load ("distrib")$
2339 (%i2) std_rayleigh(b);
2347 @opencatbox{Categories:}
2348 @category{Package distrib}
2354 @anchor{skewness_rayleigh}
2355 @deffn {Function} skewness_rayleigh (@var{b})
2356 Returns the skewness coefficient of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2358 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2361 @c load ("distrib")$
2362 @c skewness_rayleigh(b);
2365 (%i1) load ("distrib")$
2366 (%i2) skewness_rayleigh(b);
2369 ------ - -----------
2371 (%o2) --------------------
2377 @opencatbox{Categories:}
2378 @category{Package distrib}
2384 @anchor{kurtosis_rayleigh}
2385 @deffn {Function} kurtosis_rayleigh (@var{b})
2386 Returns the kurtosis coefficient of a @math{Rayleigh(b)} random variable, with @math{b>0}.
2388 The @math{Rayleigh(b)} random variable is equivalent to the @math{Weibull(2,1/b)}.
2391 @c load ("distrib")$
2392 @c kurtosis_rayleigh(b);
2395 (%i1) load ("distrib")$
2396 (%i2) kurtosis_rayleigh(b);
2401 (%o2) ---------- - 3
2407 @opencatbox{Categories:}
2408 @category{Package distrib}
2414 @anchor{random_rayleigh}
2415 @deffn {Function} random_rayleigh (@var{b}) @
2416 @fname{random_rayleigh} (@var{b},@var{n})
2418 Returns a @math{Rayleigh(b)} random variate, with @math{b>0}. Calling @code{random_rayleigh} with a second argument @var{n}, a random sample of size @var{n} will be simulated.
2420 The implemented algorithm is based on the general inverse method.
2422 To make use of this function, write first @code{load("distrib")}.
2424 @opencatbox{Categories:}
2425 @category{Package distrib}
2426 @category{Random numbers}
2433 @anchor{pdf_laplace}
2434 @deffn {Function} pdf_laplace (@var{x},@var{a},@var{b})
2435 Returns the value at @var{x} of the density function of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2437 @opencatbox{Categories:}
2438 @category{Package distrib}
2444 @anchor{cdf_laplace}
2445 @deffn {Function} cdf_laplace (@var{x},@var{a},@var{b})
2446 Returns the value at @var{x} of the distribution function of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2448 @opencatbox{Categories:}
2449 @category{Package distrib}
2455 @anchor{quantile_laplace}
2456 @deffn {Function} quantile_laplace (@var{q},@var{a},@var{b})
2457 Returns the @var{q}-quantile of a @math{Laplace(a,b)} random variable, with @math{b>0}; in other words, this is the inverse of @code{cdf_laplace}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2459 @opencatbox{Categories:}
2460 @category{Package distrib}
2466 @anchor{mean_laplace}
2467 @deffn {Function} mean_laplace (@var{a},@var{b})
2468 Returns the mean of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2470 @opencatbox{Categories:}
2471 @category{Package distrib}
2477 @anchor{var_laplace}
2478 @deffn {Function} var_laplace (@var{a},@var{b})
2479 Returns the variance of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2481 @opencatbox{Categories:}
2482 @category{Package distrib}
2488 @anchor{std_laplace}
2489 @deffn {Function} std_laplace (@var{a},@var{b})
2490 Returns the standard deviation of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2492 @opencatbox{Categories:}
2493 @category{Package distrib}
2499 @anchor{skewness_laplace}
2500 @deffn {Function} skewness_laplace (@var{a},@var{b})
2501 Returns the skewness coefficient of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2503 @opencatbox{Categories:}
2504 @category{Package distrib}
2510 @anchor{kurtosis_laplace}
2511 @deffn {Function} kurtosis_laplace (@var{a},@var{b})
2512 Returns the kurtosis coefficient of a @math{Laplace(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2514 @opencatbox{Categories:}
2515 @category{Package distrib}
2521 @anchor{random_laplace}
2522 @deffn {Function} random_laplace (@var{a},@var{b}) @
2523 @fname{random_laplace} (@var{a},@var{b},@var{n})
2525 Returns a @math{Laplace(a,b)} random variate, with @math{b>0}. Calling @code{random_laplace} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
2527 The implemented algorithm is based on the general inverse method.
2529 To make use of this function, write first @code{load("distrib")}.
2531 @opencatbox{Categories:}
2532 @category{Package distrib}
2533 @category{Random numbers}
2541 @deffn {Function} pdf_cauchy (@var{x},@var{a},@var{b})
2542 Returns the value at @var{x} of the density function of a @math{Cauchy(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2544 @opencatbox{Categories:}
2545 @category{Package distrib}
2552 @deffn {Function} cdf_cauchy (@var{x},@var{a},@var{b})
2553 Returns the value at @var{x} of the distribution function of a @math{Cauchy(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2555 @opencatbox{Categories:}
2556 @category{Package distrib}
2562 @anchor{quantile_cauchy}
2563 @deffn {Function} quantile_cauchy (@var{q},@var{a},@var{b})
2564 Returns the @var{q}-quantile of a @math{Cauchy(a,b)} random variable, with @math{b>0}; in other words, this is the inverse of @code{cdf_cauchy}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2566 @opencatbox{Categories:}
2567 @category{Package distrib}
2573 @anchor{random_cauchy}
2574 @deffn {Function} random_cauchy (@var{a},@var{b}) @
2575 @fname{random_cauchy} (@var{a},@var{b},@var{n})
2577 Returns a @math{Cauchy(a,b)} random variate, with @math{b>0}. Calling @code{random_cauchy} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
2579 The implemented algorithm is based on the general inverse method.
2581 To make use of this function, write first @code{load("distrib")}.
2583 @opencatbox{Categories:}
2584 @category{Package distrib}
2585 @category{Random numbers}
2593 @deffn {Function} pdf_gumbel (@var{x},@var{a},@var{b})
2594 Returns the value at @var{x} of the density function of a @math{Gumbel(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2596 @opencatbox{Categories:}
2597 @category{Package distrib}
2604 @deffn {Function} cdf_gumbel (@var{x},@var{a},@var{b})
2605 Returns the value at @var{x} of the distribution function of a @math{Gumbel(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2607 @opencatbox{Categories:}
2608 @category{Package distrib}
2614 @anchor{quantile_gumbel}
2615 @deffn {Function} quantile_gumbel (@var{q},@var{a},@var{b})
2616 Returns the @var{q}-quantile of a @math{Gumbel(a,b)} random variable, with @math{b>0}; in other words, this is the inverse of @code{cdf_gumbel}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2618 @opencatbox{Categories:}
2619 @category{Package distrib}
2625 @anchor{mean_gumbel}
2626 @deffn {Function} mean_gumbel (@var{a},@var{b})
2627 Returns the mean of a @math{Gumbel(a,b)} random variable, with @math{b>0}.
2630 @c load ("distrib")$
2631 @c mean_gumbel(a,b);
2634 (%i1) load ("distrib")$
2635 (%i2) mean_gumbel(a,b);
2638 where symbol @code{%gamma} stands for the Euler-Mascheroni constant. See also @mrefdot{%gamma}
2640 @opencatbox{Categories:}
2641 @category{Package distrib}
2648 @deffn {Function} var_gumbel (@var{a},@var{b})
2649 Returns the variance of a @math{Gumbel(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2651 @opencatbox{Categories:}
2652 @category{Package distrib}
2659 @deffn {Function} std_gumbel (@var{a},@var{b})
2660 Returns the standard deviation of a @math{Gumbel(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2662 @opencatbox{Categories:}
2663 @category{Package distrib}
2669 @anchor{skewness_gumbel}
2670 @deffn {Function} skewness_gumbel (@var{a},@var{b})
2671 Returns the skewness coefficient of a @math{Gumbel(a,b)} random variable, with @math{b>0}.
2674 @c load ("distrib")$
2675 @c skewness_gumbel(a,b);
2678 (%i1) load ("distrib")$
2679 (%i2) skewness_gumbel(a,b);
2682 (%o2) --------------
2686 where @code{zeta} stands for the Riemann's zeta function.
2688 @opencatbox{Categories:}
2689 @category{Package distrib}
2695 @anchor{kurtosis_gumbel}
2696 @deffn {Function} kurtosis_gumbel (@var{a},@var{b})
2697 Returns the kurtosis coefficient of a @math{Gumbel(a,b)} random variable, with @math{b>0}. To make use of this function, write first @code{load("distrib")}.
2699 @opencatbox{Categories:}
2700 @category{Package distrib}
2701 @category{Package distrib}
2707 @anchor{random_gumbel}
2708 @deffn {Function} random_gumbel (@var{a},@var{b}) @
2709 @fname{random_gumbel} (@var{a},@var{b},@var{n})
2711 Returns a @math{Gumbel(a,b)} random variate, with @math{b>0}. Calling @code{random_gumbel} with a third argument @var{n}, a random sample of size @var{n} will be simulated.
2713 The implemented algorithm is based on the general inverse method.
2715 To make use of this function, write first @code{load("distrib")}.
2717 @opencatbox{Categories:}
2718 @category{Package distrib}
2719 @category{Random numbers}
2725 @node Functions and Variables for discrete distributions, , Functions and Variables for continuous distributions, distrib-pkg
2726 @section Functions and Variables for discrete distributions
2729 @anchor{pdf_general_finite_discrete}
2730 @deffn {Function} pdf_general_finite_discrete (@var{x},@var{v})
2731 Returns the value at @var{x} of the probability function of a general finite discrete random variable, with vector probabilities @math{v}, such that @code{Pr(X=i) = v_i}. Vector @math{v} can be a list of nonnegative expressions, whose components will be normalized to get a vector of probabilities. To make use of this function, write first @code{load("distrib")}.
2734 @c load ("distrib")$
2735 @c pdf_general_finite_discrete(2, [1/7, 4/7, 2/7]);
2736 @c pdf_general_finite_discrete(2, [1, 4, 2]);
2739 (%i1) load ("distrib")$
2740 (%i2) pdf_general_finite_discrete(2, [1/7, 4/7, 2/7]);
2744 (%i3) pdf_general_finite_discrete(2, [1, 4, 2]);
2750 @opencatbox{Categories:}
2751 @category{Package distrib}
2757 @anchor{cdf_general_finite_discrete}
2758 @deffn {Function} cdf_general_finite_discrete (@var{x},@var{v})
2759 Returns the value at @var{x} of the distribution function of a general finite discrete random variable, with vector probabilities @math{v}.
2761 See @code{pdf_general_finite_discrete} for more details.
2764 @c load ("distrib")$
2765 @c cdf_general_finite_discrete(2, [1/7, 4/7, 2/7]);
2766 @c cdf_general_finite_discrete(2, [1, 4, 2]);
2767 @c cdf_general_finite_discrete(2+1/2, [1, 4, 2]);
2770 (%i1) load ("distrib")$
2771 (%i2) cdf_general_finite_discrete(2, [1/7, 4/7, 2/7]);
2775 (%i3) cdf_general_finite_discrete(2, [1, 4, 2]);
2779 (%i4) cdf_general_finite_discrete(2+1/2, [1, 4, 2]);
2785 @opencatbox{Categories:}
2786 @category{Package distrib}
2792 @anchor{quantile_general_finite_discrete}
2793 @deffn {Function} quantile_general_finite_discrete (@var{q},@var{v})
2794 Returns the @var{q}-quantile of a general finite discrete random variable, with vector probabilities @math{v}.
2796 See @code{pdf_general_finite_discrete} for more details.
2798 @opencatbox{Categories:}
2799 @category{Package distrib}
2805 @anchor{mean_general_finite_discrete}
2806 @deffn {Function} mean_general_finite_discrete (@var{v})
2807 Returns the mean of a general finite discrete random variable, with vector probabilities @math{v}.
2809 See @code{pdf_general_finite_discrete} for more details.
2811 @opencatbox{Categories:}
2812 @category{Package distrib}
2818 @anchor{var_general_finite_discrete}
2819 @deffn {Function} var_general_finite_discrete (@var{v})
2820 Returns the variance of a general finite discrete random variable, with vector probabilities @math{v}.
2822 See @code{pdf_general_finite_discrete} for more details.
2824 @opencatbox{Categories:}
2825 @category{Package distrib}
2831 @anchor{std_general_finite_discrete}
2832 @deffn {Function} std_general_finite_discrete (@var{v})
2833 Returns the standard deviation of a general finite discrete random variable, with vector probabilities @math{v}.
2835 See @code{pdf_general_finite_discrete} for more details.
2837 @opencatbox{Categories:}
2838 @category{Package distrib}
2844 @anchor{skewness_general_finite_discrete}
2845 @deffn {Function} skewness_general_finite_discrete (@var{v})
2846 Returns the skewness coefficient of a general finite discrete random variable, with vector probabilities @math{v}.
2848 See @code{pdf_general_finite_discrete} for more details.
2850 @opencatbox{Categories:}
2851 @category{Package distrib}
2857 @anchor{kurtosis_general_finite_discrete}
2858 @deffn {Function} kurtosis_general_finite_discrete (@var{v})
2859 Returns the kurtosis coefficient of a general finite discrete random variable, with vector probabilities @math{v}.
2861 See @code{pdf_general_finite_discrete} for more details.
2863 @opencatbox{Categories:}
2864 @category{Package distrib}
2870 @anchor{random_general_finite_discrete}
2871 @deffn {Function} random_general_finite_discrete (@var{v}) @
2872 @fname{random_general_finite_discrete} (@var{v},@var{m})
2874 Returns a general finite discrete random variate, with vector probabilities @math{v}. Calling @code{random_general_finite_discrete} with a second argument @var{m}, a random sample of size @var{m} will be simulated.
2876 See @code{pdf_general_finite_discrete} for more details.
2879 @c load ("distrib")$
2880 @c random_general_finite_discrete([1,3,1,5]);
2881 @c random_general_finite_discrete([1,3,1,5], 10);
2884 (%i1) load ("distrib")$
2885 (%i2) random_general_finite_discrete([1,3,1,5]);
2887 (%i3) random_general_finite_discrete([1,3,1,5], 10);
2888 (%o3) [4, 2, 2, 3, 2, 4, 4, 1, 2, 2]
2891 @opencatbox{Categories:}
2892 @category{Package distrib}
2893 @category{Random numbers}
2899 @anchor{pdf_binomial}
2900 @deffn {Function} pdf_binomial (@var{x},@var{n},@var{p})
2901 Returns the value at @var{x} of the probability function of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2903 @opencatbox{Categories:}
2904 @category{Package distrib}
2910 @anchor{cdf_binomial}
2911 @deffn {Function} cdf_binomial (@var{x},@var{n},@var{p})
2912 Returns the value at @var{x} of the distribution function of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer.
2915 @c load ("distrib")$
2916 @c cdf_binomial(5,7,1/6);
2920 (%i1) load ("distrib")$
2921 (%i2) cdf_binomial(5,7,1/6);
2926 (%o3) .9998713991769548
2929 @opencatbox{Categories:}
2930 @category{Package distrib}
2936 @anchor{quantile_binomial}
2937 @deffn {Function} quantile_binomial (@var{q},@var{n},@var{p})
2938 Returns the @var{q}-quantile of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer; in other words, this is the inverse of @code{cdf_binomial}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
2940 @opencatbox{Categories:}
2941 @category{Package distrib}
2947 @anchor{mean_binomial}
2948 @deffn {Function} mean_binomial (@var{n},@var{p})
2949 Returns the mean of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2951 @opencatbox{Categories:}
2952 @category{Package distrib}
2958 @anchor{var_binomial}
2959 @deffn {Function} var_binomial (@var{n},@var{p})
2960 Returns the variance of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2962 @opencatbox{Categories:}
2963 @category{Package distrib}
2969 @anchor{std_binomial}
2970 @deffn {Function} std_binomial (@var{n},@var{p})
2971 Returns the standard deviation of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2973 @opencatbox{Categories:}
2974 @category{Package distrib}
2980 @anchor{skewness_binomial}
2981 @deffn {Function} skewness_binomial (@var{n},@var{p})
2982 Returns the skewness coefficient of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2984 @opencatbox{Categories:}
2985 @category{Package distrib}
2991 @anchor{kurtosis_binomial}
2992 @deffn {Function} kurtosis_binomial (@var{n},@var{p})
2993 Returns the kurtosis coefficient of a @math{Binomial(n,p)} random variable, with @math{0 \leq p \leq 1} and @math{n} a positive integer. To make use of this function, write first @code{load("distrib")}.
2995 @opencatbox{Categories:}
2996 @category{Package distrib}
3002 @anchor{random_binomial}
3003 @deffn {Function} random_binomial (@var{n},@var{p}) @
3004 @fname{random_binomial} (@var{n},@var{p},@var{m})
3006 Returns a @math{Binomial(n,p)} random variate, with @math{0 \leq p \leq 1} and @math{n} a positive integer. Calling @code{random_binomial} with a third argument @var{m}, a random sample of size @var{m} will be simulated.
3008 The implemented algorithm is based on the one described in Kachitvichyanukul, V. and Schmeiser, B.W. (1988) @var{Binomial Random Variate Generation}. Communications of the ACM, 31, Feb., 216.
3010 To make use of this function, write first @code{load("distrib")}.
3012 @opencatbox{Categories:}
3013 @category{Package distrib}
3014 @category{Random numbers}
3020 @anchor{pdf_poisson}
3021 @deffn {Function} pdf_poisson (@var{x},@var{m})
3022 Returns the value at @var{x} of the probability function of a @math{Poisson(m)} random variable, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3024 @opencatbox{Categories:}
3025 @category{Package distrib}
3031 @anchor{cdf_poisson}
3032 @deffn {Function} cdf_poisson (@var{x},@var{m})
3033 Returns the value at @var{x} of the distribution function of a @math{Poisson(m)} random variable, with @math{m>0}.
3036 @c load ("distrib")$
3037 @c cdf_poisson(3,5);
3041 (%i1) load ("distrib")$
3042 (%i2) cdf_poisson(3,5);
3043 (%o2) gamma_incomplete_regularized(4, 5)
3045 (%o3) .2650259152973623
3048 @opencatbox{Categories:}
3049 @category{Package distrib}
3055 @anchor{quantile_poisson}
3056 @deffn {Function} quantile_poisson (@var{q},@var{m})
3057 Returns the @var{q}-quantile of a @math{Poisson(m)} random variable, with @math{m>0}; in other words, this is the inverse of @code{cdf_poisson}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
3059 @opencatbox{Categories:}
3060 @category{Package distrib}
3066 @anchor{mean_poisson}
3067 @deffn {Function} mean_poisson (@var{m})
3068 Returns the mean of a @math{Poisson(m)} random variable, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3070 @opencatbox{Categories:}
3071 @category{Package distrib}
3077 @anchor{var_poisson}
3078 @deffn {Function} var_poisson (@var{m})
3079 Returns the variance of a @math{Poisson(m)} random variable, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3081 @opencatbox{Categories:}
3082 @category{Package distrib}
3088 @anchor{std_poisson}
3089 @deffn {Function} std_poisson (@var{m})
3090 Returns the standard deviation of a @math{Poisson(m)} random variable, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3092 @opencatbox{Categories:}
3093 @category{Package distrib}
3099 @anchor{skewness_poisson}
3100 @deffn {Function} skewness_poisson (@var{m})
3101 Returns the skewness coefficient of a @math{Poisson(m)} random variable, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3103 @opencatbox{Categories:}
3104 @category{Package distrib}
3110 @anchor{kurtosis_poisson}
3111 @deffn {Function} kurtosis_poisson (@var{m})
3112 Returns the kurtosis coefficient of a Poisson random variable @math{Poi(m)}, with @math{m>0}. To make use of this function, write first @code{load("distrib")}.
3114 @opencatbox{Categories:}
3115 @category{Package distrib}
3121 @anchor{random_poisson}
3122 @deffn {Function} random_poisson (@var{m}) @
3123 @fname{random_poisson} (@var{m},@var{n})
3125 Returns a @math{Poisson(m)} random variate, with @math{m>0}. Calling @code{random_poisson} with a second argument @var{n}, a random sample of size @var{n} will be simulated.
3127 The implemented algorithm is the one described in Ahrens, J.H. and Dieter, U. (1982) @var{Computer Generation of Poisson Deviates From Modified Normal Distributions}. ACM Trans. Math. Software, 8, 2, June,163-179.
3129 To make use of this function, write first @code{load("distrib")}.
3131 @opencatbox{Categories:}
3132 @category{Package distrib}
3133 @category{Random numbers}
3139 @anchor{pdf_bernoulli}
3140 @deffn {Function} pdf_bernoulli (@var{x},@var{p})
3141 Returns the value at @var{x} of the probability function of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3143 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3146 @c load ("distrib")$
3147 @c pdf_bernoulli(1,p);
3150 (%i1) load ("distrib")$
3151 (%i2) pdf_bernoulli(1,p);
3155 @opencatbox{Categories:}
3156 @category{Package distrib}
3162 @anchor{cdf_bernoulli}
3163 @deffn {Function} cdf_bernoulli (@var{x},@var{p})
3164 Returns the value at @var{x} of the distribution function of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}. To make use of this function, write first @code{load("distrib")}.
3166 @opencatbox{Categories:}
3167 @category{Package distrib}
3173 @anchor{quantile_bernoulli}
3174 @deffn {Function} quantile_bernoulli (@var{q},@var{p})
3175 Returns the @var{q}-quantile of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}; in other words, this is the inverse of @code{cdf_bernoulli}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
3177 @opencatbox{Categories:}
3178 @category{Package distrib}
3184 @anchor{mean_bernoulli}
3185 @deffn {Function} mean_bernoulli (@var{p})
3186 Returns the mean of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3188 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3191 @c load ("distrib")$
3192 @c mean_bernoulli(p);
3195 (%i1) load ("distrib")$
3196 (%i2) mean_bernoulli(p);
3200 @opencatbox{Categories:}
3201 @category{Package distrib}
3207 @anchor{var_bernoulli}
3208 @deffn {Function} var_bernoulli (@var{p})
3209 Returns the variance of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3211 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3214 @c load ("distrib")$
3215 @c var_bernoulli(p);
3218 (%i1) load ("distrib")$
3219 (%i2) var_bernoulli(p);
3223 @opencatbox{Categories:}
3224 @category{Package distrib}
3230 @anchor{std_bernoulli}
3231 @deffn {Function} std_bernoulli (@var{p})
3232 Returns the standard deviation of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3234 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3237 @c load ("distrib")$
3238 @c std_bernoulli(p);
3241 (%i1) load ("distrib")$
3242 (%i2) std_bernoulli(p);
3243 (%o2) sqrt((1 - p) p)
3246 @opencatbox{Categories:}
3247 @category{Package distrib}
3253 @anchor{skewness_bernoulli}
3254 @deffn {Function} skewness_bernoulli (@var{p})
3255 Returns the skewness coefficient of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3257 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3260 @c load ("distrib")$
3261 @c skewness_bernoulli(p);
3264 (%i1) load ("distrib")$
3265 (%i2) skewness_bernoulli(p);
3267 (%o2) ---------------
3271 @opencatbox{Categories:}
3272 @category{Package distrib}
3278 @anchor{kurtosis_bernoulli}
3279 @deffn {Function} kurtosis_bernoulli (@var{p})
3280 Returns the kurtosis coefficient of a @math{Bernoulli(p)} random variable, with @math{0 \leq p \leq 1}.
3282 The @math{Bernoulli(p)} random variable is equivalent to the @math{Binomial(1,p)}.
3285 @c load ("distrib")$
3286 @c kurtosis_bernoulli(p);
3289 (%i1) load ("distrib")$
3290 (%i2) kurtosis_bernoulli(p);
3292 (%o2) ---------------
3296 @opencatbox{Categories:}
3297 @category{Package distrib}
3303 @anchor{random_bernoulli}
3304 @deffn {Function} random_bernoulli (@var{p}) @
3305 @fname{random_bernoulli} (@var{p},@var{n})
3307 Returns a @math{Bernoulli(p)} random variate, with @math{0 \leq p \leq 1}. Calling @code{random_bernoulli} with a second argument @var{n}, a random sample of size @var{n} will be simulated.
3309 This is a direct application of the @code{random} built-in Maxima function.
3311 See also @mrefdot{random} To make use of this function, write first @code{load("distrib")}.
3313 @opencatbox{Categories:}
3314 @category{Package distrib}
3315 @category{Random numbers}
3320 @anchor{pdf_geometric}
3321 @deffn {Function} pdf_geometric (@var{x},@var{p})
3322 Returns the value at @var{x} of the probability function of a @math{Geometric(p)} random variable, with
3327 @math{0 < p \leq 1}.
3330 The probability function is defined as @math{p (1 - p)^x}.
3331 This is interpreted as the probability of @math{x} failures before the first success.
3333 @code{load("distrib")} loads this function.
3335 @opencatbox{Categories:}
3336 @category{Package distrib}
3342 @anchor{cdf_geometric}
3343 @deffn {Function} cdf_geometric (@var{x},@var{p})
3344 Returns the value at @var{x} of the distribution function of a @math{Geometric(p)} random variable, with
3349 @math{0 < p \leq 1}.
3352 The probability from which the distribution function is derived is defined as @math{p (1 - p)^x}.
3353 This is interpreted as the probability of @math{x} failures before the first success.
3355 @code{load("distrib")} loads this function.
3357 @opencatbox{Categories:}
3358 @category{Package distrib}
3364 @anchor{quantile_geometric}
3365 @deffn {Function} quantile_geometric (@var{q},@var{p})
3366 Returns the @var{q}-quantile of a @math{Geometric(p)} random variable, with
3371 @math{0 < p \leq 1};
3373 in other words, this is the inverse of @code{cdf_geometric}.
3374 Argument @var{q} must be an element of @math{[0,1]}.
3376 The probability from which the quantile is derived is defined as @math{p (1 - p)^x}.
3377 This is interpreted as the probability of @math{x} failures before the first success.
3379 @code{load("distrib")} loads this function.
3381 @opencatbox{Categories:}
3382 @category{Package distrib}
3388 @anchor{mean_geometric}
3389 @deffn {Function} mean_geometric (@var{p})
3390 Returns the mean of a @math{Geometric(p)} random variable, with
3395 @math{0 < p \leq 1}.
3398 The probability from which the mean is derived is defined as @math{p (1 - p)^x}.
3399 This is interpreted as the probability of @math{x} failures before the first success.
3401 @code{load("distrib")} loads this function.
3403 @opencatbox{Categories:}
3404 @category{Package distrib}
3410 @anchor{var_geometric}
3411 @deffn {Function} var_geometric (@var{p})
3412 Returns the variance of a @math{Geometric(p)} random variable, with
3417 @math{0 < p \leq 1}.
3420 The probability from which the variance is derived is defined as @math{p (1 - p)^x}.
3421 This is interpreted as the probability of @math{x} failures before the first success.
3423 @code{load("distrib")} loads this function.
3425 @opencatbox{Categories:}
3426 @category{Package distrib}
3432 @anchor{std_geometric}
3433 @deffn {Function} std_geometric (@var{p})
3434 Returns the standard deviation of a @math{Geometric(p)} random variable, with
3439 @math{0 < p \leq 1}.
3442 The probability from which the standard deviation is derived is defined as @math{p (1 - p)^x}.
3443 This is interpreted as the probability of @math{x} failures before the first success.
3445 @code{load("distrib")} loads this function.
3447 @opencatbox{Categories:}
3448 @category{Package distrib}
3454 @anchor{skewness_geometric}
3455 @deffn {Function} skewness_geometric (@var{p})
3456 Returns the skewness coefficient of a @math{Geometric(p)} random variable, with
3461 @math{0 < p \leq 1}.
3464 The probability from which the skewness is derived is defined as @math{p (1 - p)^x}.
3465 This is interpreted as the probability of @math{x} failures before the first success.
3467 @code{load("distrib")} loads this function.
3469 @opencatbox{Categories:}
3470 @category{Package distrib}
3476 @anchor{kurtosis_geometric}
3477 @deffn {Function} kurtosis_geometric (@var{p})
3478 Returns the kurtosis coefficient of a geometric random variable @math{Geometric(p)}, with
3483 @math{0 < p \leq 1}.
3486 The probability from which the kurtosis is derived is defined as @math{p (1 - p)^x}.
3487 This is interpreted as the probability of @math{x} failures before the first success.
3489 @code{load("distrib")} loads this function.
3491 @opencatbox{Categories:}
3492 @category{Package distrib}
3498 @anchor{random_geometric}
3499 @deffn {Function} random_geometric (@var{p}) @
3500 @fname{random_geometric} (@var{p},@var{n})
3502 @code{random_geometric(@var{p})} returns one random sample from a @math{Geometric(p)} distribution, with
3507 @math{0 < p \leq 1}.
3510 @code{random_geometric(@var{p}, @var{n})} returns a list of @var{n} random samples.
3512 The algorithm is based on simulation of Bernoulli trials.
3514 The probability from which the random sample is derived is defined as @math{p (1 - p)^x}.
3515 This is interpreted as the probability of @math{x} failures before the first success.
3517 @code{load("distrib")} loads this function.
3520 @opencatbox{Categories:}
3521 @category{Package distrib}
3522 @category{Random numbers}
3528 @anchor{pdf_discrete_uniform}
3529 @deffn {Function} pdf_discrete_uniform (@var{x},@var{n})
3530 Returns the value at @var{x} of the probability function of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3532 @opencatbox{Categories:}
3533 @category{Package distrib}
3539 @anchor{cdf_discrete_uniform}
3540 @deffn {Function} cdf_discrete_uniform (@var{x},@var{n})
3541 Returns the value at @var{x} of the distribution function of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3543 @opencatbox{Categories:}
3544 @category{Package distrib}
3550 @anchor{quantile_discrete_uniform}
3551 @deffn {Function} quantile_discrete_uniform (@var{q},@var{n})
3552 Returns the @var{q}-quantile of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer; in other words, this is the inverse of @code{cdf_discrete_uniform}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
3554 @opencatbox{Categories:}
3555 @category{Package distrib}
3561 @anchor{mean_discrete_uniform}
3562 @deffn {Function} mean_discrete_uniform (@var{n})
3563 Returns the mean of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3565 @opencatbox{Categories:}
3566 @category{Package distrib}
3572 @anchor{var_discrete_uniform}
3573 @deffn {Function} var_discrete_uniform (@var{n})
3574 Returns the variance of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3576 @opencatbox{Categories:}
3577 @category{Package distrib}
3583 @anchor{std_discrete_uniform}
3584 @deffn {Function} std_discrete_uniform (@var{n})
3585 Returns the standard deviation of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3587 @opencatbox{Categories:}
3588 @category{Package distrib}
3594 @anchor{skewness_discrete_uniform}
3595 @deffn {Function} skewness_discrete_uniform (@var{n})
3596 Returns the skewness coefficient of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3598 @opencatbox{Categories:}
3599 @category{Package distrib}
3605 @anchor{kurtosis_discrete_uniform}
3606 @deffn {Function} kurtosis_discrete_uniform (@var{n})
3607 Returns the kurtosis coefficient of a @math{Discrete Uniform(n)} random variable, with @math{n} a strictly positive integer. To make use of this function, write first @code{load("distrib")}.
3609 @opencatbox{Categories:}
3610 @category{Package distrib}
3616 @anchor{random_discrete_uniform}
3617 @deffn {Function} random_discrete_uniform (@var{n}) @
3618 @fname{random_discrete_uniform} (@var{n},@var{m})
3620 Returns a @math{Discrete Uniform(n)} random variate, with @math{n} a strictly positive integer. Calling @code{random_discrete_uniform} with a second argument @var{m}, a random sample of size @var{m} will be simulated.
3622 This is a direct application of the @code{random} built-in Maxima function.
3624 See also @mrefdot{random} To make use of this function, write first @code{load("distrib")}.
3626 @opencatbox{Categories:}
3627 @category{Package distrib}
3628 @category{Random numbers}
3634 @anchor{pdf_hypergeometric}
3635 @deffn {Function} pdf_hypergeometric (@var{x},@var{n1},@var{n2},@var{n})
3636 Returns the value at @var{x} of the probability function of a @math{Hypergeometric(n1,n2,n)}
3637 random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}.
3638 Being @var{n1} the number of objects of class A, @var{n2} the number of objects of class B, and
3639 @var{n} the size of the sample without replacement, this function returns the probability of
3640 event "exactly @var{x} objects are of class A".
3642 To make use of this function, write first @code{load("distrib")}.
3644 @opencatbox{Categories:}
3645 @category{Package distrib}
3651 @anchor{cdf_hypergeometric}
3652 @deffn {Function} cdf_hypergeometric (@var{x},@var{n1},@var{n2},@var{n})
3653 Returns the value at @var{x} of the distribution function of a @math{Hypergeometric(n1,n2,n)}
3654 random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}.
3655 See @code{pdf_hypergeometric} for a more complete description.
3657 To make use of this function, write first @code{load("distrib")}.
3659 @opencatbox{Categories:}
3660 @category{Package distrib}
3666 @anchor{quantile_hypergeometric}
3667 @deffn {Function} quantile_hypergeometric (@var{q},@var{n1},@var{n2},@var{n})
3668 Returns the @var{q}-quantile of a @math{Hypergeometric(n1,n2,n)} random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}; in other words, this is the inverse of @code{cdf_hypergeometric}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
3670 @opencatbox{Categories:}
3671 @category{Package distrib}
3677 @anchor{mean_hypergeometric}
3678 @deffn {Function} mean_hypergeometric (@var{n1},@var{n2},@var{n})
3679 Returns the mean of a discrete uniform random variable @math{Hyp(n1,n2,n)}, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. To make use of this function, write first @code{load("distrib")}.
3681 @opencatbox{Categories:}
3682 @category{Package distrib}
3688 @anchor{var_hypergeometric}
3689 @deffn {Function} var_hypergeometric (@var{n1},@var{n2},@var{n})
3690 Returns the variance of a hypergeometric random variable @math{Hyp(n1,n2,n)}, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. To make use of this function, write first @code{load("distrib")}.
3692 @opencatbox{Categories:}
3693 @category{Package distrib}
3699 @anchor{std_hypergeometric}
3700 @deffn {Function} std_hypergeometric (@var{n1},@var{n2},@var{n})
3701 Returns the standard deviation of a @math{Hypergeometric(n1,n2,n)} random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. To make use of this function, write first @code{load("distrib")}.
3703 @opencatbox{Categories:}
3704 @category{Package distrib}
3710 @anchor{skewness_hypergeometric}
3711 @deffn {Function} skewness_hypergeometric (@var{n1},@var{n2},@var{n})
3712 Returns the skewness coefficient of a @math{Hypergeometric(n1,n2,n)} random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. To make use of this function, write first @code{load("distrib")}.
3714 @opencatbox{Categories:}
3715 @category{Package distrib}
3721 @anchor{kurtosis_hypergeometric}
3722 @deffn {Function} kurtosis_hypergeometric (@var{n1},@var{n2},@var{n})
3723 Returns the kurtosis coefficient of a @math{Hypergeometric(n1,n2,n)} random variable, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. To make use of this function, write first @code{load("distrib")}.
3725 @opencatbox{Categories:}
3726 @category{Package distrib}
3732 @anchor{random_hypergeometric}
3733 @deffn {Function} random_hypergeometric (@var{n1},@var{n2},@var{n}) @
3734 @fname{random_hypergeometric} (@var{n1},@var{n2},@var{n},@var{m})
3736 Returns a @math{Hypergeometric(n1,n2,n)} random variate, with @var{n1}, @var{n2} and @var{n} non negative integers and @math{n<=n1+n2}. Calling @code{random_hypergeometric} with a fourth argument @var{m}, a random sample of size @var{m} will be simulated.
3738 Algorithm described in Kachitvichyanukul, V., Schmeiser, B.W. (1985) @var{Computer generation of hypergeometric random variates.} Journal of Statistical Computation and Simulation 22, 127-145.
3740 To make use of this function, write first @code{load("distrib")}.
3742 @opencatbox{Categories:}
3743 @category{Package distrib}
3744 @category{Random numbers}
3750 @anchor{pdf_negative_binomial}
3751 @deffn {Function} pdf_negative_binomial (@var{x},@var{n},@var{p})
3752 Returns the value at @var{x} of the probability function of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3754 @opencatbox{Categories:}
3755 @category{Package distrib}
3761 @anchor{cdf_negative_binomial}
3762 @deffn {Function} cdf_negative_binomial (@var{x},@var{n},@var{p})
3763 Returns the value at @var{x} of the distribution function of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number.
3766 @c load ("distrib")$
3767 @c cdf_negative_binomial(3,4,1/8);
3770 (%i1) load ("distrib")$
3771 (%i2) cdf_negative_binomial(3,4,1/8);
3777 @opencatbox{Categories:}
3778 @category{Package distrib}
3784 @anchor{quantile_negative_binomial}
3785 @deffn {Function} quantile_negative_binomial (@var{q},@var{n},@var{p})
3786 Returns the @var{q}-quantile of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number; in other words, this is the inverse of @code{cdf_negative_binomial}. Argument @var{q} must be an element of @math{[0,1]}. To make use of this function, write first @code{load("distrib")}.
3788 @opencatbox{Categories:}
3789 @category{Package distrib}
3795 @anchor{mean_negative_binomial}
3796 @deffn {Function} mean_negative_binomial (@var{n},@var{p})
3797 Returns the mean of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3799 @opencatbox{Categories:}
3800 @category{Package distrib}
3806 @anchor{var_negative_binomial}
3807 @deffn {Function} var_negative_binomial (@var{n},@var{p})
3808 Returns the variance of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3810 @opencatbox{Categories:}
3811 @category{Package distrib}
3817 @anchor{std_negative_binomial}
3818 @deffn {Function} std_negative_binomial (@var{n},@var{p})
3819 Returns the standard deviation of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3821 @opencatbox{Categories:}
3822 @category{Package distrib}
3828 @anchor{skewness_negative_binomial}
3829 @deffn {Function} skewness_negative_binomial (@var{n},@var{p})
3830 Returns the skewness coefficient of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3832 @opencatbox{Categories:}
3833 @category{Package distrib}
3839 @anchor{kurtosis_negative_binomial}
3840 @deffn {Function} kurtosis_negative_binomial (@var{n},@var{p})
3841 Returns the kurtosis coefficient of a @math{Negative Binomial(n,p)} random variable, with @math{0 < p \leq 1} and @math{n} a positive number. To make use of this function, write first @code{load("distrib")}.
3843 @opencatbox{Categories:}
3844 @category{Package distrib}
3850 @anchor{random_negative_binomial}
3851 @deffn {Function} random_negative_binomial (@var{n},@var{p}) @
3852 @fname{random_negative_binomial} (@var{n},@var{p},@var{m})
3854 Returns a @math{Negative Binomial(n,p)} random variate, with @math{0 < p \leq 1} and @math{n} a positive number. Calling @code{random_negative_binomial} with a third argument @var{m}, a random sample of size @var{m} will be simulated.
3856 Algorithm described in Devroye, L. (1986) @var{Non-Uniform Random Variate Generation}. Springer Verlag, p. 480.
3858 To make use of this function, write first @code{load("distrib")}.
3860 @opencatbox{Categories:}
3861 @category{Package distrib}
3862 @category{Random numbers}