# makedist

Create probability distribution object

## Syntax

• `pd = makedist(distname)` example
• `pd = makedist(distname,Name,Value)` example

## 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.```

## Examples

collapse all

### Create a Normal Distribution Object

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

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```

### Specify Parameters for a Normal Distribution Object

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 ```

### Specify Parameters for a Gamma Distribution Object

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

### `distname` — Distribution namestring

Distribution name, specified as one of the following strings. The distribution specified by `distname` determines the class type of the returned probability distribution object.

Distribution NameDescriptionDistribution Class
`'Beta'`Beta distribution`prob.BetaDistribution`
`'Binomial'`Binomial distribution`prob.BinomialDistribution`
`'BirnbaumSaunders'`Birnbaum-Saunders distribution`prob.BirnbaumSaundersDistribution`
`'Burr'`Burr distribution`prob.BurrDistribution`
`'Exponential'`Exponential distribution`prob.ExponentialDistribution`
`'ExtremeValue'`Extreme Value distribution`prob.ExtremeValueDistribution`
`'Gamma'`Gamma distribution`prob.GammaDistribution`
`'GeneralizedExtremeValue'`Generalized Extreme Value distribution`prob.GeneralizedExtremeValueDistribution`
`'GeneralizedPareto'`Generalized Pareto distribution`prob.GeneralizedParetoDistribution`
`'InverseGaussian'`Inverse Gaussian distribution`prob.InverseGaussianDistribution`
`'Logistic'`Logistic distribution`prob.LogisticDistribution`
`'Loglogistic'`Loglogistic distribution`prob.LoglogisticDistribution`
`'Lognormal'`Lognormal distribution`prob.LognormalDistribution`
`'Multinomial'`Multinomial distribution`prob.MultinomialDistribution`
`'Nakagami'`Nakagami distribution`prob.NakagamiDistribution`
`'NegativeBinomial'`Negative Binomial distribution`prob.NegativeBinomialDistribution`
`'Normal'`Normal distribution`prob.NormalDistribution`
`'PiecewiseLinear'`Piecewise Linear distribution`prob.PiecewiseLinearDistribution`
`'Poisson'`Poisson distribution`prob.PoissonDistribution`
`'Rayleigh'`Rayleigh distribution`prob.RayleighDistribution`
`'Rician'`Rician distribution`prob.RicianDistribution`
`'tLocationScale'`t Location-Scale distribution`prob.tLocationScaleDistribution`
`'Triangular'`Triangular distribution`prob.TriangularDistribution`
`'Uniform'`Uniform distribution`prob.UniformDistribution`
`'Weibull'`Weibull distribution`prob.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 single 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

### `'a'` — First shape parameter`1` (default) | nonnegative scalar value

Example: `'a',3`

Data Types: `single` | `double`

### `'b'` — Second shape parameter`1` (default) | nonnegative scalar value

Example: `'b',5`

Data Types: `single` | `double`

Binomial Distribution

### `'N'` — Number of trials`1` (default) | positive integer value

Example: `'N',25`

Data Types: `single` | `double`

### `'p'` — Probability of success`0.5` (default) | scalar value in the range [0,1]

Example: `'p',0.25`

Data Types: `single` | `double`

Birnbaum-Saunders Distribution

### `'beta'` — Scale parameter`1` (default) | positive scalar value

Example: `'beta',2`

Data Types: `single` | `double`

### `'gamma'` — Shape parameter`1` (default) | nonnegative scalar value

Example: `'gamma',0`

Data Types: `single` | `double`

Burr Distribution

### `'alpha'` — Scale parameter`1` (default) | positive scalar value

Example: `'alpha',2`

Data Types: `single` | `double`

### `'c'` — First shape parameter`1` (default) | positive scalar value

Example: `'c',2`

Data Types: `single` | `double`

### `'k'` — Second shape parameter`1` (default) | positive scalar value

Example: `'k',5`

Data Types: `single` | `double`

Exponential Distribution

### `'mu'` — Mean parameter`1` (default) | positive scalar value

Example: `'mu',5`

Data Types: `single` | `double`

Extreme Value Distribution

### `'mu'` — Location parameter`0` (default) | scalar value

Example: `'mu',-2`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | nonnegative scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

Gamma Distribution

### `'a'` — Shape parameter`1` (default) | positive scalar value

Example: `'a',2`

Data Types: `single` | `double`

### `'b'` — Scale parameter`1` (default) | nonnegative scalar value

Example: `'b',0`

Data Types: `single` | `double`

Generalized Extreme Value Distribution

### `'k'` — Shape parameter`0` (default) | scalar value

Example: `'k',0`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | nonnegative scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

### `'mu'` — Location parameter`0` (default) | scalar value

Example: `'mu',1`

Data Types: `single` | `double`

Generalized Pareto Distribution

### `'k'` — Shape parameter`1` (default) | scalar value

Example: `'k',0`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | nonnegative scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

### `'theta'` — Location parameter`1` (default) | scalar value

Example: `'theta',2`

Data Types: `single` | `double`

Inverse Gaussian Distribution

### `'mu'` — Scale parameter`1` (default) | positive scalar value

Example: `'mu',2`

Data Types: `single` | `double`

### `'lambda'` — Shape parameter`1` (default) | positive scalar value

Example: `'lambda',4`

Data Types: `single` | `double`

Logistic Distribution

### `'mu'` — Mean`0` (default) | scalar value

Example: `'mu',2`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | nonnegative scalar value

Example: `'sigma',4`

Data Types: `single` | `double`

Loglogistic Distribution

### `'mu'` — Log mean`0` (default) | scalar value

Example: `'mu',2`

Data Types: `single` | `double`

### `'sigma'` — Log scale parameter`1` (default) | nonnegative scalar value

Example: `'sigma',4`

Data Types: `single` | `double`

Lognormal Distribution

### `'mu'` — Log mean`0` (default) | scalar value

Example: `'mu',2`

Data Types: `single` | `double`

### `'sigma'` — Log standard deviation`1` (default) | nonnegative scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

Multinomial Distribution

### `'probabilities'` — Outcome probabilities`[0.500 0.500]` (default) | vector of scalar values in the range [0,1]

Example: `'probabilities',[0.1 0.2 0.5 0.2]`

Data Types: `single` | `double`

Nakagami Distribution

### `'mu'` — Shape parameter`1` (default) | positive scalar value

Example: `'mu',5`

Data Types: `single` | `double`

### `'omega'` — Scale parameter`1` (default) | positive scalar value

Example: `'omega',5`

Data Types: `single` | `double`

Negative Binomial Distribution

### `'R'` — Number of successes`1` (default) | positive scalar value

Example: `'R',5`

Data Types: `single` | `double`

### `'p'` — Probability of success`0.5` (default) | scalar value in the range (0,1]

Example: `'p',0.1`

Data Types: `single` | `double`

Normal Distribution

### `'mu'` — Mean`0` (default) | scalar value

Example: `'mu',2`

Data Types: `single` | `double`

### `'sigma'` — Standard deviation`1` (default) | nonnegative scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

Piecewise Linear Distribution

### `'x'` — Data values`1` (default) | vector of scalar values

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

Data Types: `single` | `double`

### `'Fx'` — cdf values`1` (default) | vector of scalar values

Example: `'Fx',[.2 .5 1]`

Data Types: `single` | `double`

Poisson Distribution

### `'lambda'` — Mean`1` (default) | nonnegative scalar value

Example: `'lambda',5`

Data Types: `single` | `double`

Rayleigh Distribution

### `'b'` — Defining parameter`1` (default) | positive scalar value

Example: `'b',3`

Data Types: `single` | `double`

Rician Distribution

### `'s'` — Noncentrality parameter`1` (default) | nonnegative scalar value

Example: `'s',0`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | positive scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

t Location-Scale Distribution

### `'mu'` — Location parameter`0` (default) | scalar value

Example: `'mu',-2`

Data Types: `single` | `double`

### `'sigma'` — Scale parameter`1` (default) | positive scalar value

Example: `'sigma',2`

Data Types: `single` | `double`

### `'nu'` — Degrees of freedom`5` (default) | positive scalar value

Example: `'nu',20`

Data Types: `single` | `double`

Triangular Distribution

### `'a'` — Lower limit`0` (default) | scalar value

Example: `'a',-2`

Data Types: `single` | `double`

### `'b'` — Peak location`0.5` (default) | scalar value greater than or equal to `a`

Example: `'b',1`

Data Types: `single` | `double`

### `'c'` — Upper limit`1` (default) | scalar value greater than or equal to `b`

Example: `'c',5`

Data Types: `single` | `double`

Uniform Distribution

### `'lower'` — Lower parameter`0` (default) | scalar value

Example: `'lower',-4`

Data Types: `single` | `double`

### `'upper'` — Upper parameter`1` (default) | scalar value greater than `lower`

Example: `'upper',2`

Data Types: `single` | `double`

Weibull Distribution

### `'a'` — Scale parameter`1` (default) | positive scalar value

Example: `'a',2`

Data Types: `single` | `double`

### `'b'` — Shape parameter`1` (default) | positive scalar value

Example: `'b',5`

Data Types: `single` | `double`

## Output Arguments

collapse all

### `pd` — Probability distributionprobability distribution object

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

## Alternative Functionality

### App

The Distribution Fitting 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 Fitting app using `dfittool`, or click Distribution Fitting on the Apps tab.