7
$\begingroup$

I am trying to get all Discrete Univariate Distributions with symbolic arguments from any place in Wolfram Language system. For example this guide:

http://reference.wolfram.com/language/guide/DiscreteUnivariateDistributions.html

or maybe some information in WolframLanguageData. The final form of output should be a list

{ZipfDistribution[ρ], ZipfDistribution[n,ρ], LogSeriesDistribution[θ], ...etc.}

giving complete set of all Discrete Univariate Distributions. Perhaps this might be useful, but this mixes in continuous distributions which I do not need and it also does not give symbolic arguments:

EntityList[
    EntityClass["WolframLanguageSymbol",
    {"FunctionalityAreas"->EqualTo[{"StatisticalDistributionSymbols"}]}]]

This might be useful too:

Entity["WolframLanguageSymbol", "ZipfDistribution"]["PlaintextUsage"]
Entity["WolframLanguageSymbol", "ZipfDistribution"]["TypesetUsage"]
  • ZipfDistribution[ρ] represents a zeta distribution with parameter ρ.
  • ZipfDistribution[n, ρ] represents a Zipf distribution with range n.
$\endgroup$
2
  • $\begingroup$ Probably DistributionDomain will help. DistributionDomain[ZipfDistribution[\[Rho]]] results in 1 ;; \[Infinity] and DistributionDomain[NormalDistribution[]] results in Interval[{-\[Infinity], \[Infinity]}]. $\endgroup$
    – JimB
    Commented Apr 23, 2023 at 21:48
  • $\begingroup$ Related: mathematica.stackexchange.com/questions/46309/…. A list of the library functions (?StatisticsLibrary*) finds a function named DiscreteDistributionQ` but I can't get it to work. (Nor can I get the previous text to format properly.) $\endgroup$
    – JimB
    Commented Apr 24, 2023 at 23:03

1 Answer 1

4
$\begingroup$

Generating a list of the discrete univariate distributions in Mathematica is difficult for me not only because after all these years I'm still not great at Mathematica programming but because there are "issues" with defining what constitutes a discrete univariate distribution.

For example, there is the CompoundPoisson distribution which can be discrete or continuous depending on whether the user-selected "jump size" distribution is discrete or continuous. There are also an additional assortment of "helper" distribution functions which can work on discrete or continuous distributions with the result being a distribution but not necessarily having a recognized name: CensoredDistribution, MarginalDistribution, MixtureDistribution, OrderDistribution, ParameterMixtureDistribution, SplicedDistribution, and TransformedDistribution.

Fortunately, there is a function that will return True or False for if a distribution is (always) a discrete univariate distribution. For example:

Statistics`Library`DiscreteUnivariateDistributionQ[PoissonDistribution[μ]]
(* True *)

(See Determining the dimension of a probability distribution for more details.)

Using the listing code provided by @VitaliyKaurov the following will produce a list of the (always) discrete univariate distributions:

(* Get the list of StatisticalDistributionSymbols *)
sds = EntityList[
   EntityClass[
    "WolframLanguageSymbol", {"FunctionalityAreas" -> 
      EqualTo[{"StatisticalDistributionSymbols"}]}]];

(* Now extract the name of the distributions along with some "default"/standard parameter symbols
   which are essential *)
distributions = EntityValue[#, "PlaintextUsage"] & /@ sds;
distributions = StringTake[#, StringPosition[#, "]"][[1, 1]]] & /@ distributions

(* Now the list of discrete univariate distributions *)
(discreteUnivariateDistributions = Select[distributions,
  Statistics`Library`DiscreteUnivariateDistributionQ[ToExpression[#]] &])//Tableform

List of always discrete univariate distributions

$\endgroup$
1
  • $\begingroup$ Neat thank you for relentless effort :-) $\endgroup$ Commented Apr 25, 2023 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.