Create probability distribution object
creates
a probability distribution object with one or more distribution parameter
values specified by name-value pair arguments.pd
= makedist(distname
,Name,Value
)
returns
a cell array list
= makedistlist
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.
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
distname
— Distribution nameDistribution 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 Name | Description | Distribution 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 |
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
.
makedist('Normal','mu',10)
specifies
a normal distribution with parameter mu
equal to
10, and parameter sigma
equal to the default value
of 1.'a'
— First shape parameter1
(default) | positive scalar valueExample: 'a',3
Data Types: single
| double
'b'
— Second shape parameter1
(default) | positive scalar valueExample: 'b',5
Data Types: single
| double
'N'
— Number of trials1
(default) | positive integer valueExample: 'N',25
Data Types: single
| double
'p'
— Probability of success0.5
(default) | scalar value in the range [0,1]Example: 'p',0.25
Data Types: single
| double
'beta'
— Scale parameter1
(default) | positive scalar valueExample: 'beta',2
Data Types: single
| double
'gamma'
— Shape parameter1
(default) | nonnegative scalar valueExample: 'gamma',0
Data Types: single
| double
'alpha'
— Scale parameter1
(default) | positive scalar valueExample: 'alpha',2
Data Types: single
| double
'c'
— First shape parameter1
(default) | positive scalar valueExample: 'c',2
Data Types: single
| double
'k'
— Second shape parameter1
(default) | positive scalar valueExample: 'k',5
Data Types: single
| double
'mu'
— Mean parameter1
(default) | positive scalar valueExample: 'mu',5
Data Types: single
| double
'mu'
— Location parameter0
(default) | scalar valueExample: 'mu',-2
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'a'
— Shape parameter1
(default) | positive scalar valueExample: 'a',2
Data Types: single
| double
'b'
— Scale parameter1
(default) | nonnegative scalar valueExample: 'b',0
Data Types: single
| double
'k'
— Shape parameter0
(default) | scalar valueExample: 'k',0
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'mu'
— Location parameter0
(default) | scalar valueExample: 'mu',1
Data Types: single
| double
'k'
— Shape parameter1
(default) | scalar valueExample: 'k',0
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'theta'
— Location parameter1
(default) | scalar valueExample: 'theta',2
Data Types: single
| double
'mu'
— Location parameter0
(default) | scalar valueExample: 'mu',1
Data Types: single
| double
'sigma'
— Shape parameter1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'mu'
— Scale parameter1
(default) | positive scalar valueExample: 'mu',2
Data Types: single
| double
'lambda'
— Shape parameter1
(default) | positive scalar valueExample: 'lambda',4
Data Types: single
| double
'mu'
— Mean0
(default) | scalar valueExample: 'mu',2
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | nonnegative scalar valueExample: 'sigma',4
Data Types: single
| double
'mu'
— Mean of logarithmic values0
(default) | scalar valueExample: 'mu',2
Data Types: single
| double
'sigma'
— Scale parameter of logarithmic values1
(default) | nonnegative scalar valueExample: 'sigma',4
Data Types: single
| double
'mu'
— Mean of logarithmic values0
(default) | scalar valueExample: 'mu',2
Data Types: single
| double
'sigma'
— Standard deviation of logarithmic values1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'probabilities'
— Outcome probabilities[0.500 0.500]
(default) | vector of scalar values in the range [0,1]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
'mu'
— Shape parameter1
(default) | positive scalar valueExample: 'mu',5
Data Types: single
| double
'omega'
— Scale parameter1
(default) | positive scalar valueExample: 'omega',5
Data Types: single
| double
'R'
— Number of successes1
(default) | positive scalar valueExample: 'R',5
Data Types: single
| double
'p'
— Probability of success0.5
(default) | scalar value in the range (0,1]Example: 'p',0.1
Data Types: single
| double
'mu'
— Mean0
(default) | scalar valueExample: 'mu',2
Data Types: single
| double
'sigma'
— Standard deviation1
(default) | nonnegative scalar valueExample: 'sigma',2
Data Types: single
| double
'x'
— Data values1
(default) | monotonically increasing vector of scalar valuesExample: 'x',[1 2 3]
Data Types: single
| double
'Fx'
— cdf values1
(default) | monotonically increasing vector of scalar values that start
at 0 and end at 1Example: 'Fx',[0.2 0.5 1]
Data Types: single
| double
'lambda'
— Mean1
(default) | nonnegative scalar valueExample: 'lambda',5
Data Types: single
| double
'b'
— Defining parameter1
(default) | positive scalar valueExample: 'b',3
Data Types: single
| double
's'
— Noncentrality parameter1
(default) | nonnegative scalar valueExample: 's',0
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | positive scalar valueExample: 'sigma',2
Data Types: single
| double
'alpha'
— First shape parameter2
(default) | scalar value in the range (0,2]Example: 'alpha',1
Data Types: single
| double
'beta'
— Second shape parameter0
(default) | scalar value in the range [-1,1]Example: 'beta',0.5
Data Types: single
| double
'gam'
— Scale parameter1
(default) | scalar value in the range (0,∞)Example: 'gam',2
Data Types: single
| double
'delta'
— Location parameterExample: 'delta',5
Data Types: single
| double
'mu'
— Location parameter0
(default) | scalar valueExample: 'mu',-2
Data Types: single
| double
'sigma'
— Scale parameter1
(default) | positive scalar valueExample: 'sigma',2
Data Types: single
| double
'nu'
— Degrees of freedom5
(default) | positive scalar valueExample: 'nu',20
Data Types: single
| double
'a'
— Lower limit0
(default) | scalar valueExample: 'a',-2
Data Types: single
| double
'b'
— Peak location0.5
(default) | scalar value greater than or equal to a
Example: 'b',1
Data Types: single
| double
'c'
— Upper limit1
(default) | scalar value greater than or equal to b
Example: 'c',5
Data Types: single
| double
'lower'
— Lower parameter0
(default) | scalar valueExample: 'lower',-4
Data Types: single
| double
'upper'
— Upper parameter1
(default) | scalar value greater than lower
Example: 'upper',2
Data Types: single
| double
'a'
— Scale parameter1
(default) | positive scalar valueExample: 'a',2
Data Types: single
| double
'b'
— Shape parameter1
(default) | positive scalar valueExample: 'b',5
Data Types: single
| double
pd
— Probability distributionProbability distribution, returned as a probability distribution
object of the type specified by distname
.
list
— List of probability distributionsList of probability distributions that makedist
can
create, returned as a cell array of character vectors.
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.
A modified version of this example exists on your system. Do you want to open this version instead? (zh_CN)
您点击了调用以下 MATLAB 命令的链接:
Web 浏览器不支持 MATLAB 命令。请在 MATLAB 命令窗口中直接输入该命令以运行它。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.