# Binomial Distribution

Fit, evaluate, and generate random samples from binomial distribution

Statistics and Machine Learning Toolbox™ offers several ways to work with the binomial distribution.

• Create a probability distribution object `BinomialDistribution` by fitting a probability distribution to sample data or by specifying parameter values. Then, use object functions to evaluate the distribution, generate random numbers, and so on.

• Work with the binomial distribution interactively by using the Distribution Fitter app. You can export an object from the app and use the object functions.

• Use distribution-specific functions with specified distribution parameters. The distribution-specific functions can accept parameters of multiple binomial distributions.

• Use generic distribution functions (`cdf`, `icdf`, `pdf`, `random`) with a specified distribution name (`'Binomial'`) and parameters.

To learn about the binomial distribution, see Binomial Distribution.

## Objects

 `BinomialDistribution` Binomial probability distribution object

## Apps

 Distribution Fitter Fit probability distributions to data Probability Distribution Function Interactive density and distribution plots

## Functions

expand all

#### Create `BinomialDistribution` Object

 `makedist` Create probability distribution object `fitdist` Fit probability distribution object to data

#### Work with `BinomialDistribution` Object

 `cdf` Cumulative distribution function `gather` Gather properties of Statistics and Machine Learning Toolbox object from GPU (Since R2020b) `icdf` Inverse cumulative distribution function `iqr` Interquartile range of probability distribution `mean` Mean of probability distribution `median` Median of probability distribution `negloglik` Negative loglikelihood of probability distribution `paramci` Confidence intervals for probability distribution parameters `pdf` Probability density function `plot` Plot probability distribution object (Since R2022b) `proflik` Profile likelihood function for probability distribution `random` Random numbers `std` Standard deviation of probability distribution `truncate` Truncate probability distribution object `var` Variance of probability distribution
 `binocdf` Binomial cumulative distribution function `binopdf` Binomial probability density function `binoinv` Binomial inverse cumulative distribution function `binostat` Binomial mean and variance `binofit` Binomial parameter estimates `binornd` Random numbers from binomial distribution
 `mle` Maximum likelihood estimates
 `distributionFitter` Open Distribution Fitter app `plot` Plot probability distribution object (Since R2022b) `qqplot` Quantile-quantile plot `randtool` Interactive random number generation

## Topics

• Bernoulli Distribution

The Bernoulli distribution is a discrete probability distribution with only two possible values for the random variable.

• Binomial Distribution

The binomial distribution models the total number of successes in repeated trials from an infinite population under certain conditions.