Template:Infobox probability distribution/doc: Difference between revisions

Content deleted Content added
m Parameters: General fixes, typo(s) fixed: eg → e.g. (2) using AWB (11376)
Parameters: added likelihood to template
 
(44 intermediate revisions by 23 users not shown)
Line 1:
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{Lua|Module:Infobox3cols|Module:InfoboxImage|Module:Check for unknown parameters}}{{TemplateStyles|Template:Infobox probability distribution/styles.css}}
 
=== UsageExample ===
{{Infobox probability distribution
| name = Normal distribution
| type = density
| pdf_image = Normal Distribution PDF.svg
| pdf_caption = The red curve is the ''standard normal distribution''
| cdf_image = Normal Distribution CDF.svg
| cdf_caption =
| notation = <math>\mathcal{N}(\mu,\sigma^2)</math>
| parameters = <math>\mu\in\R</math> = mean ([[___location parameter|___location]])<br /><math>\sigma^2>0</math> = variance (squared [[scale parameter|scale]])
| support = <math>x\in\R</math>
| pdf = <math>\frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x - \mu}{\sigma}\right)^2}</math>
| cdf = <math>\frac{1}{2}\left[1 + \operatorname{erf}\left( \frac{x-\mu}{\sigma\sqrt{2}}\right)\right] </math>
| quantile = <math>\mu+\sigma\sqrt{2} \operatorname{erf}^{-1}(2p-1)</math>
| mean = <math>\mu</math>
| median = <math>\mu</math>
| mode = <math>\mu</math>
| variance = <math>\sigma^2</math>
| mad = <math>\sigma\sqrt{2}\,\operatorname{erf}^{-1}(1/2)</math>
| aad = <math>\sigma\sqrt{2/\pi}</math>
| skewness = <math>0</math>
| kurtosis = <math>0</math> <!-- DO NOT REPLACE THIS WITH THE OLD-STYLE KURTOSIS WHICH IS 3. -->
| entropy = <math>\frac{1}{2} \log(2\pi e\sigma^2)</math>
| mgf = <math>\exp(\mu t + \sigma^2t^2/2)</math>
| char = <math>\exp(i\mu t - \sigma^2 t^2/2)</math>
| fisher = <math>\mathcal{I}(\mu,\sigma) =\begin {pmatrix} 1/\sigma^2 & 0 \\ 0 & 2/\sigma^2\end{pmatrix}</math>
<math>\mathcal{I}(\mu,\sigma^2) =\begin {pmatrix} 1/\sigma^2 & 0 \\ 0 & 1/(2\sigma^4)\end{pmatrix}</math>
| KLDiv = <math>{ 1 \over 2 } \left\{ \left( \frac{\sigma_0}{\sigma_1} \right)^2 + \frac{(\mu_1 - \mu_0)^2}{\sigma_1^2} - 1 + 2 \ln {\sigma_1 \over \sigma_0} \right\}</math>
}}
== Usage ==
The '''Template:Infobox probability distribution''' generates a right-hand side infobox, based on the specified parameters. To use this template, copy the following code in your article and fill in as appropriate:
<syntaxhighlight lang="wikitext">
<pre>
{{Infobox probability distribution
| name =
Line 15 ⟶ 44:
| pdf =
| cdf =
| quantile =
| mean =
| median =
| mode =
| variance =
| mad =
| aad =
| skewness =
| kurtosis =
| entropy =
| cross_entropy =
| mgf =
| cf =
| pgf =
| fisher =
| moments =
| KLdiv =
| likelihood =
| JSDiv =
}}
</syntaxhighlight>
</pre>
 
==== Parameters ====
* '''{{para|name'''}} — Name at the top of the infobox; should be the name of the distribution without the word "distribution" in it, e.g. "Normal", "Exponential" (optional).
* '''{{para|type'''}} — possible values are “discrete”"discrete" (or “mass”"mass"), “continuous”"continuous" (or “density”"density"), and “multivariate”."multivariate"
* '''{{para|pdf_image'''}} — probability density image-spec plus other text, such as: <code><nowiki>[[Image:xxx.svg|250px]]<br/>text here</nowiki></code> (optional).
* {{para|pdf_caption}} — probability density image captionn
* '''cdf_image''' — cumulative distribution image-spec plus other text, such as: <code><nowiki>[[Image:yyy.svg|250px]]<br/>text here.</nowiki></code> (optional).
* {{para|pdf_image_alt}} — [[WP:ALT|alternative text]] for the image in {{para|pdf_image}}
* '''notation''' — typical designation for this distribution, for example <math>\scriptstyle\mathcal{N}(\mu,\sigma^2)</math>. The notation should include all the distribution parameters explained in the next cell.
* '''parameters'''{{para|cdf_image}}parameters of thecumulative distribution familyimage-spec, (such as: ''μ'' and ''σ''<supcode>2<nowiki>yyy.svg</supnowiki></code> for the normal distribution).
* {{para|cdf_caption}} — cumulative distribution image caption
* '''support''' — the support of the distribution, which may depend on the parameters. Specify this as <code><nowiki><math>x \in some set</math></nowiki></code> for continuous distributions, and as <code><nowiki><math>k \in some set</math></nowiki></code> for discrete distributions.
* {{para|cdf_image_alt}} — [[WP:ALT|alternative text]] for the image in {{para|cdf_image}}
* '''pdf''' — probability density function (or probability mass function), such as: <code><nowiki><math>\frac{\Gamma(r+k)}{k!\,\Gamma(r)}\,p^r\,(1-p)^k \!</math></nowiki></code>. Please exclude the function label, such as “''ƒ''(x;''μ'',''σ''<sup>2</sup>)”.
* '''{{para|notation'''}} — typical designation for this distribution, for example <math>\scriptstyle\mathcal{N}(\mu,\sigma^2)</math>. The notation should include all the distribution parameters explained in the next cell.
* '''cdf''' — cumulative distribution function, e.g.: <code><nowiki><math>I_p(r,k+1)\text{ where }I_p(x,y)</math> is the [[regularized incomplete beta function]]</nowiki></code>.
* '''quantile'''{{para|parameters}}[[quantileparameters function]]of (or inverse cumulativethe distribution function).family If <math>F()</math>such isas the CDF{{mvar|μ}} and {{math|''σ''<mathsup>Q()2</mathsup>}} isfor the quantilenormal function, then <math>Q(F(xdistribution))=x</math>.
* '''{{para|support'''}} — the support of the distribution, which may depend on the parameters. Specify this as <code><nowikisyntaxhighlight lang="tex" inline><math>x \in some set</math></nowiki></codesyntaxhighlight> for continuous distributions, and as <code><nowikisyntaxhighlight lang="tex" inline><math>k \in some set</math></nowiki></codesyntaxhighlight> for discrete distributions.
* '''mean''' — the [[mean]], or [[expected value]].
* '''{{para|pdf'''}} — probability density function (or probability mass function), such as: <code><nowikisyntaxhighlight lang="tex" inline><math>\frac{\Gamma(r+k)}{k!\,\Gamma(r)}\,p^r\,(1-p)^k \!</math></nowiki></codesyntaxhighlight>. Please exclude the function label, such as "{{math|''ƒ''(x;&nbsp;''μ'',''σ''<sup>2</sup>)}}".
* '''median''' — the [[median]], only for univariate distributions.
* '''{{para|cdf'''}} — cumulative distribution function, e.g.: <code><nowiki><math>I_p(r,k+1)\text{ where }I_p(x,y)</math> is the [[regularized incomplete beta function]]</nowiki></code>.
* '''mode''' — the [[mode (statistics)|mode]].
* {{para|quantile}} — [[quantile function]] (or inverse cumulative distribution function). If <math>F()</math> is the CDF and <math>Q()</math> is the quantile function, then <math>Q(F(x))=x</math>
* '''variance''' — [[variance]] of the distribution, or [[covariance matrix]] in multivariate case.
* '''skewness'''{{para|mean}} — the [[skewnessmean]], or [[expected value]].
* '''{{para|median'''}} — the [[median]], only for univariate distributions.
* '''kurtosis''' — the [[kurtosis excess]].
* '''entropy'''{{para|mode}} — the [[informationmode entropy(statistics)|mode]].
* '''{{para|variance'''}} — [[variance]] of the distribution, or [[covariance matrix]] in multivariate case.
* '''mgf''' — the [[moment-generating function]], for example: <code><nowiki><math>\left(\frac{p}{1-(1-p) e^t}\right)^r \!</math></nowiki></code>.
* {{para|mad}} — the [[median absolute deviation]] around the median.
* '''char''' or '''cf''' — the [[Characteristic function (probability theory)|characteristic function]], such as: <code><nowiki><math>\left(\frac{p}{1-(1-p) e^{i\,t}}\right)^r \!</math></nowiki></code>.
* {{para|aad}} — the [[average absolute deviation|mean absolute deviation]] around the mean.
* '''pgf''' - the [[Probability-generating function]].
* '''fisher'''{{para|skewness}} — the [[Fisher information matrixskewness]] for the model.
* '''{{para|kurtosis'''}} — the [[kurtosis excess]].
* {{para|entropy}} — the differential [[information entropy]], preferably expressed in unspecified units using base-unspecific log(.) rather than base-specific ln(.) which yields entropy in units of nats only.
* {{para|cross_entropy}} — the [[cross-entropy]] of the model
* '''{{para|mgf'''}} — the [[moment-generating function]], for example: <code><nowikisyntaxhighlight lang="tex" inline><math>\left(\frac{p}{1-(1-p) e^t}\right)^r \!</math></nowiki></codesyntaxhighlight>.
* '''{{para|char''' or '''}}/{{para|cf'''}} — the [[Characteristic function (probability theory)|characteristic function]], such as: <code><nowikisyntaxhighlight lang="tex" inline><math>\left(\frac{p}{1-(1-p) e^{i\,tit}}\right)^r \!</math></nowiki></codesyntaxhighlight>.
* '''{{para|pgf'''}} - the [[Probabilityprobability-generating function]].
* {{para|fisher}} — the [[Fisher information matrix]] for the model.
* {{para|KLDiv}} — the [[Kullback-Leibler divergence]] of the model
* {{para|likelihood}} — the [[Likelihood function]] of the model
* {{para|JSDiv}} — the [[Jensen-Shannon divergence]] of the model
* {{para|moments}} — formulas to use in [[Method of moments (statistics)|method of moments]] for the model.
* {{para|ES}} — the [[expected shortfall]] or CVaR for the model.
* {{para|bPOE}} — the buffered probability of exceedance for the model.
* '''{{para|intro'''}} — optional message which will be displayed before all other content in the infobox.
* '''{{para|marginleft'''}} — margin space left of infobox (default: 1em).
* '''{{para|box_width'''}} — width of the infobox (default: 325px).
 
{{para|parameters2}}, {{para|support2}}, {{para|pdf2}}, {{para|cdf2}}, {{para|mean2}}, {{para|median2}}, {{para|mode2}}, {{para|variance2}}, {{para|mad}}, {{para|aad}}, {{para|skewness2}}, {{para|kurtosis2}}, {{para|entropy2}}, {{para|mgf2}}, {{para|char2}}/{{para|cf2}}, {{para|moments2}}, {{para|fisher2}} are the same as their counterparts above. They should be used when the distribution needs two sets to describe it, e.g. [[Gamma distribution]].
* '''intro''' — optional message which will be displayed before all other content in the infobox.
* '''marginleft''' — margin space left of infobox (default: 1em).
* '''box_width''' — width of the infobox (default: 325px).
 
=== SeeTracking alsocategory ===
* {{clc|Pages using infobox probability distribution with unknown parameters}}
* [[WP:Infobox]]
* Talk page: [[Template talk:Probability distribution]]
 
<includeonly>{{sandbox other||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Mathematics and abstraction infobox templates|{{PAGENAME}}]]
[[Category:Statistics templates]]
[[Category:Templates that add a tracking category]]
 
}}</includeonly>