# HistogramDistribution

HistogramDistribution[{x1,x2,}]

represents the probability distribution corresponding to a histogram of the data values xi.

HistogramDistribution[{{x1,y1,},{x2,y2,},}]

represents a multivariate histogram distribution based on data values {xi,yi,}.

HistogramDistribution[,bspec]

represents a histogram distribution with bins specified by bspec.

# Details  • 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 xi, the width according to the yi, 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 [b1,b2),[b2,b3),… Automatic determine bin widths automatically "name" use a named binning method fw apply fw to get an explicit bin specification {b1,b2,…} {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.

# Examples

open all close all

## Basic Examples(2)

Create a histogram distribution of univariate data:

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

 In:= Out= Compute moments and quantiles:

 In:= Out= In:= Out= Create a histogram distribution of bivariate data:

 In:= In:= Visualize the PDF and CDF:

 In:= Out= Compute covariance and general moments:

 In:= Out//MatrixForm= In:= Out= ## Neat Examples(1)

Introduced in 2010
(8.0)
|
Updated in 2016
(10.4)