Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

HistogramDistribution

HistogramDistribution[{x1,x2,}]
represents the probability distribution corresponding to a histogram of the data values .

HistogramDistribution[{{x1,y1,},{x2,y2,},}]
represents a multivariate histogram distribution based on data values .

HistogramDistribution[,bspec]
represents a histogram distribution with bins specified by bspec.

DetailsDetails

• HistogramDistribution returns a DataDistribution object that can be used like any other probability distribution.
• The probability density function for HistogramDistribution for a value is given by where is the number of data points in bin , is the width of bin , are bin delimiters, and is the total number of data points.
• The width of each bin is computed according to the values , the width according to the , etc.
• The following bin specifications bspec can be given:
•  n use n bins {w} use bins of width w {min,max,w} use bins of width w from min to max {{b1,b2,…}} use bins Automatic determine bin widths automatically "name" use a named binning method fw apply fw to get an explicit bin specification {xspec,yspec,…} give different x, y, etc. specifications
• Possible named binning methods include:
•  "FreedmanDiaconis" twice the interquartile range divided by the cube root of sample size "Knuth" balance likelihood and prior probability of a piecewise uniform model "Scott" asymptotically minimize the mean square error "Sturges" compute the number of bins based on the length of data "Wand" one-level recursive approximate Wand binning
• The probability density for value in a histogram distribution is a piecewise constant function.
• HistogramDistribution can be used with such functions as Mean, CDF, and RandomVariate.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Create a histogram distribution of univariate data:

 In[1]:=
 In[2]:=

Use the resulting distribution to perform analysis, including visualizing distribution functions:

 In[3]:=
 Out[3]=

Compute moments and quantiles:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

Create a histogram distribution of bivariate data:

 In[1]:=
 In[2]:=

Visualize the PDF and CDF:

 In[3]:=
 Out[3]=

Compute covariance and general moments:

 In[4]:=
 Out[4]//MatrixForm=
 In[5]:=
 Out[5]=