# makedist

Create probability distribution object

## Syntax

``pd = makedist(distname)``
``pd = makedist(distname,Name,Value)``
``list = makedist``
``makedist -reset``

## Description

example

````pd = makedist(distname)` creates a probability distribution object for the distribution `distname`, using the default parameter values.```

example

````pd = makedist(distname,Name,Value)` creates a probability distribution object with one or more distribution parameter values specified by name-value pair arguments.```
````list = makedist` returns a cell array `list` containing a list of the probability distributions that `makedist` can create.```
````makedist -reset` resets the list of distributions by searching the path for files contained in a package named `prob` and implementing classes derived from `ProbabilityDistribution`. Use this syntax after you define a custom distribution function. For details, see Define Custom Distributions Using the Distribution Fitter App.```

## Examples

collapse all

Create a normal distribution object using the default parameter values.

`pd = makedist('Normal')`
```pd = NormalDistribution Normal distribution mu = 0 sigma = 1 ```

Compute the interquartile range of the distribution.

`r = iqr(pd)`
```r = 1.3490 ```

Create a gamma distribution object using the default parameter values.

`pd = makedist('Gamma')`
```pd = GammaDistribution Gamma distribution a = 1 b = 1 ```

Compute the mean of the gamma distribution.

`mean = mean(pd)`
```mean = 1 ```

Create a normal distribution object with parameter values `mu = 75` and `sigma = 10`.

`pd = makedist('Normal','mu',75,'sigma',10)`
```pd = NormalDistribution Normal distribution mu = 75 sigma = 10 ```

Create a gamma distribution object with the parameter value `a = 3` and the default value `b = 1`.

`pd = makedist('Gamma','a',3)`
```pd = GammaDistribution Gamma distribution a = 3 b = 1 ```

## Input Arguments

collapse all

Distribution name, specified as one of the following character vectors or string scalars. The distribution specified by `distname` determines the type of the returned probability distribution object.

Distribution NameDescriptionDistribution Object
`'Beta'`Beta distribution`BetaDistribution`
`'Binomial'`Binomial distribution`BinomialDistribution`
`'BirnbaumSaunders'`Birnbaum-Saunders distribution`BirnbaumSaundersDistribution`
`'Burr'`Burr distribution`BurrDistribution`
`'Exponential'`Exponential distribution`ExponentialDistribution`
`'ExtremeValue'`Extreme Value distribution`ExtremeValueDistribution`
`'Gamma'`Gamma distribution`GammaDistribution`
`'GeneralizedExtremeValue'`Generalized Extreme Value distribution`GeneralizedExtremeValueDistribution`
`'GeneralizedPareto'`Generalized Pareto distribution`GeneralizedParetoDistribution`
`'HalfNormal'`Half-normal distribution`HalfNormalDistribution`
`'InverseGaussian'`Inverse Gaussian distribution`InverseGaussianDistribution`
`'Logistic'`Logistic distribution`LogisticDistribution`
`'Loglogistic'`Loglogistic distribution`LoglogisticDistribution`
`'Lognormal'`Lognormal distribution`LognormalDistribution`
`'Multinomial'`Multinomial distribution`MultinomialDistribution`
`'Nakagami'`Nakagami distribution`NakagamiDistribution`
`'NegativeBinomial'`Negative Binomial distribution`NegativeBinomialDistribution`
`'Normal'`Normal distribution`NormalDistribution`
`'PiecewiseLinear'`Piecewise Linear distribution`PiecewiseLinearDistribution`
`'Poisson'`Poisson distribution`PoissonDistribution`
`'Rayleigh'`Rayleigh distribution`RayleighDistribution`
`'Rician'`Rician distribution`RicianDistribution`
`'Stable'`Stable distribution`StableDistribution`
`'tLocationScale'`t Location-Scale distribution`tLocationScaleDistribution`
`'Triangular'`Triangular distribution`TriangularDistribution`
`'Uniform'`Uniform distribution`UniformDistribution`
`'Weibull'`Weibull distribution`WeibullDistribution`

### Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example: `makedist('Normal','mu',10)` specifies a normal distribution with parameter `mu` equal to 10, and parameter `sigma` equal to the default value of 1.

#### Beta Distribution

collapse all

Example: `'a',3`

Data Types: `single` | `double`

Example: `'b',5`

Data Types: `single` | `double`

#### Binomial Distribution

collapse all

Example: `'N',25`

Data Types: `single` | `double`

Example: `'p',0.25`

Data Types: `single` | `double`

#### Birnbaum-Saunders Distribution

collapse all

Example: `'beta',2`

Data Types: `single` | `double`

Example: `'gamma',0`

Data Types: `single` | `double`

#### Burr Distribution

collapse all

Example: `'alpha',2`

Data Types: `single` | `double`

Example: `'c',2`

Data Types: `single` | `double`

Example: `'k',5`

Data Types: `single` | `double`

#### Exponential Distribution

collapse all

Example: `'mu',5`

Data Types: `single` | `double`

#### Extreme Value Distribution

collapse all

Example: `'mu',-2`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

#### Gamma Distribution

collapse all

Example: `'a',2`

Data Types: `single` | `double`

Example: `'b',0`

Data Types: `single` | `double`

#### Generalized Extreme Value Distribution

collapse all

Example: `'k',0`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

Example: `'mu',1`

Data Types: `single` | `double`

#### Generalized Pareto Distribution

collapse all

Example: `'k',0`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

Example: `'theta',2`

Data Types: `single` | `double`

#### Half–Normal Distribution

collapse all

Example: `'mu',1`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

#### Inverse Gaussian Distribution

collapse all

Example: `'mu',2`

Data Types: `single` | `double`

Example: `'lambda',4`

Data Types: `single` | `double`

#### Logistic Distribution

collapse all

Example: `'mu',2`

Data Types: `single` | `double`

Example: `'sigma',4`

Data Types: `single` | `double`

#### Loglogistic Distribution

collapse all

Example: `'mu',2`

Data Types: `single` | `double`

Example: `'sigma',4`

Data Types: `single` | `double`

#### Lognormal Distribution

collapse all

Example: `'mu',2`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

#### Multinomial Distribution

collapse all

Outcome probabilities, specified as a vector of scalar values in the range [0,1]. The probabilities sum to 1 and correspond to outcomes [1, 2, ..., k], where k is the number of elements in the probabilities vector.

Example: `'probabilities',[0.1 0.2 0.5 0.2]` gives the probabilities that the outcome is 1, 2, 3, or 4, respectively.

Data Types: `single` | `double`

#### Nakagami Distribution

collapse all

Example: `'mu',5`

Data Types: `single` | `double`

Example: `'omega',5`

Data Types: `single` | `double`

#### Negative Binomial Distribution

collapse all

Example: `'R',5`

Data Types: `single` | `double`

Example: `'p',0.1`

Data Types: `single` | `double`

#### Normal Distribution

collapse all

Example: `'mu',2`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

#### Piecewise Linear Distribution

collapse all

Example: `'x',[1 2 3]`

Data Types: `single` | `double`

Example: `'Fx',[0.2 0.5 1]`

Data Types: `single` | `double`

#### Poisson Distribution

collapse all

Example: `'lambda',5`

Data Types: `single` | `double`

#### Rayleigh Distribution

collapse all

Example: `'b',3`

Data Types: `single` | `double`

#### Rician Distribution

collapse all

Example: `'s',0`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

#### Stable Distribution

collapse all

Example: `'alpha',1`

Data Types: `single` | `double`

Example: `'beta',0.5`

Data Types: `single` | `double`

Example: `'gam',2`

Data Types: `single` | `double`

Example: `'delta',5`

Data Types: `single` | `double`

#### t Location-Scale Distribution

collapse all

Example: `'mu',-2`

Data Types: `single` | `double`

Example: `'sigma',2`

Data Types: `single` | `double`

Example: `'nu',20`

Data Types: `single` | `double`

#### Triangular Distribution

collapse all

Example: `'a',-2`

Data Types: `single` | `double`

Example: `'b',1`

Data Types: `single` | `double`

Example: `'c',5`

Data Types: `single` | `double`

#### Uniform Distribution

collapse all

Example: `'lower',-4`

Data Types: `single` | `double`

Example: `'upper',2`

Data Types: `single` | `double`

#### Weibull Distribution

collapse all

Example: `'a',2`

Data Types: `single` | `double`

Example: `'b',5`

Data Types: `single` | `double`

## Output Arguments

collapse all

Probability distribution, returned as a probability distribution object of the type specified by `distname`.

List of probability distributions that `makedist` can create, returned as a cell array of character vectors.

## Alternative Functionality

### App

The Distribution Fitter app opens a graphical user interface for you to import data from the workspace and interactively fit a probability distribution to that data. You can then save the distribution to the workspace as a probability distribution object. Open the Distribution Fitter app using `distributionFitter`, or click Distribution Fitter on the Apps tab.