prob.StableDistribution
statistics: prob.StableDistribution
Stable probability distribution object.
A prob.StableDistribution object consists of parameters, a model
description, and sample data for a stable probability distribution.
The stable distribution is a continuous probability distribution family
closed under linear combinations, generalizing the normal, Cauchy, and Levy
distributions. It is parameterized, in the Nolan S0
parameterization, by a tail index (first shape parameter) alpha in
, a skewness (second shape parameter) beta in
, a scale parameter gam greater than zero, and a
location parameter delta.
There are several ways to create a prob.StableDistribution object.
fitdist function.
makedist function.
prob.StableDistribution (alpha,
beta, gam, delta) to create a stable distribution with
fixed parameter values alpha, beta, gam, and delta.
prob.StableDistribution.fit (x,
alpha, freq, options) to fit a distribution to the data
in x using the same input arguments as the stblfit function.
It is highly recommended to use fitdist and makedist
functions to create probability distribution objects, instead of the class
constructor or the aforementioned static method.
Fitting is by maximum likelihood. Because the stable density has no closed form, it is evaluated by numerical inversion of the characteristic function, which makes fitting considerably slower than for the closed-form distributions.
Further information about the stable distribution can be found at https://en.wikipedia.org/wiki/Stable_distribution
See also: fitdist, makedist, stblpdf, stblcdf, stblinv, stblrnd, stblfit, stbllike
Source Code: prob.StableDistribution
The prob.StableDistribution class contains the following properties:
A scalar value in the range characterizing the tail
behaviour of the stable distribution. You can access the alpha
property using dot name assignment.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A scalar value in the range characterizing the skewness of
the stable distribution. You can access the beta property using
dot name assignment.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A positive scalar value characterizing the scale of the stable
distribution. You can access the gam property using dot name
assignment.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A scalar value characterizing the location of the stable distribution.
You can access the delta property using dot name assignment.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A character vector specifying the name of the probability distribution object. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A scalar integer value specifying the number of parameters characterizing the probability distribution. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A cell array of character vectors with each element containing the name of a distribution parameter. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A cell array of character vectors with each element containing a short description of a distribution parameter. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A numeric vector containing the values of the distribution
parameters, matching the order in ParameterNames. This property
is read-only; use dot name assignment on the alpha, beta,
gam, and delta properties.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A two-element numeric vector with the truncation interval, if the distribution is truncated. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A logical scalar that is true when the distribution is truncated. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A numeric matrix containing the variance-covariance of the distribution parameters. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A logical vector specifying which parameters are held fixed rather than estimated. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
A structure containing the data used to fit the distribution. It is empty
unless the distribution was fitted with fitdist or the static
fit method. This property is read-only.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
The prob.StableDistribution class offers the following public methods:
prob.StableDistribution: p = cdf (pd, x)
prob.StableDistribution: p = cdf (pd, x, "upper")
p = cdf (pd, x) computes the CDF of the
probability distribution object, pd, evaluated at the values in
x. The optional "upper" flag computes the upper tail
probability.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: x = icdf (pd, p)
x = icdf (pd, p) computes the quantile (the
inverse of the CDF) of the probability distribution object, pd,
evaluated at the values in p.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: r = iqr (pd)
r = iqr (pd) computes the interquartile range of the
probability distribution object, pd.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: m = mean (pd)
m = mean (pd) computes the mean of the probability
distribution object, pd. The mean is NaN for
alpha <= 1, where it is undefined.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: m = median (pd)
m = median (pd) computes the median of the probability
distribution object, pd.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: nlogL = negloglik (pd)
nlogL = negloglik (pd) computes the negative
loglikelihood of the probability distribution object, pd. It
returns an empty value when pd is not fitted to data.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: ci = paramci (pd)
prob.StableDistribution: ci = paramci (pd, Name, Value)
ci = paramci (pd) computes the lower and upper
boundaries of the 95% confidence interval for each parameter of the
probability distribution object, pd.
ci = paramci (pd, Name, Value) computes the
confidence intervals with additional options specified by
Name-Value pair arguments listed below.
| Name | Value |
|---|---|
'Alpha' | A scalar value in the range specifying the significance level for the confidence interval. The default value 0.05 corresponds to a 95% confidence interval. |
'Parameter' | A character vector or a cell array of
character vectors specifying the parameter names for which to compute
confidence intervals. By default, paramci computes confidence
intervals for all distribution parameters. |
paramci is meaningful only when pd is fitted to data,
otherwise the parameter values are returned in both rows.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: y = pdf (pd, x)
y = pdf (pd, x) computes the PDF of the
probability distribution object, pd, evaluated at the values in
x.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: plot (pd)
prob.StableDistribution: plot (pd, Name, Value)
prob.StableDistribution: h = plot (…)
plot (pd) plots the probability density function (PDF) of
the probability distribution object pd. Name-value pair arguments
select the plotted function and its appearance, as documented in
__plot__.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: [nlogL, param] = proflik (pd, pnum)
prob.StableDistribution: [nlogL, param] = proflik (pd, pnum, 'Display', display)
prob.StableDistribution: [nlogL, param] = proflik (pd, pnum, setparam)
prob.StableDistribution: [nlogL, param] = proflik (pd, pnum, setparam, 'Display', display)
prob.StableDistribution: [nlogL, param] = proflik (pd)
prob.StableDistribution: [nlogL, param, other] = proflik (…)
[nlogL, param] = proflik (pd, pnum)
returns a vector nlogL of negative loglikelihood values and a
vector param of corresponding parameter values for the parameter in
the position indicated by pnum. By default, proflik uses
the lower and upper bounds of the 98% confidence interval and computes
101 equispaced values for the selected parameter when it is the only one
being estimated, and 21 values otherwise. pd must be fitted to
data.
[nlogL, param] = proflik (pd, pnum,
also plots the profile likelihood
against the default range of the selected parameter.
'Display', 'on')
[nlogL, param] = proflik (pd, pnum,
setparam) defines a user-defined range of the selected parameter.
[nlogL, param] = proflik (pd, pnum,
setparam, also plots the profile
likelihood against the user-defined range of the selected parameter.
'Display', 'on')
[nlogL, param] = proflik (pd) selects the
first parameter that is not fixed.
[nlogL, param, other] = proflik (…) also
returns a matrix other holding, in each row, the values of the
remaining parameters that maximize the likelihood at the corresponding
value of param. A fixed parameter keeps its own value.
For the stable distribution, pnum = 1 selects the tail index
alpha, pnum = 2 selects the skewness beta,
pnum = 3 selects the scale gam, and
pnum = 4 selects the location delta.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: r = random (pd)
prob.StableDistribution: r = random (pd, rows)
prob.StableDistribution: r = random (pd, rows, cols, …)
prob.StableDistribution: r = random (pd, [sz])
r = random (pd) returns a random number from the
distribution object pd, following the size conventions of
stblrnd.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: s = std (pd)
s = std (pd) computes the standard deviation of the
probability distribution object, pd. It is NaN for
alpha < 2, where the variance is infinite.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: t = truncate (pd, lower, upper)
t = truncate (pd, lower, upper) returns
the probability distribution pd truncated to the interval with
lower limit lower and upper limit upper.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
prob.StableDistribution: v = var (pd)
v = var (pd) computes the variance of the probability
distribution object, pd. It is NaN for alpha <
2, where the variance is infinite.
Create a stable distribution and plot its pdf
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");
pd = makedist ("Stable", "alpha", 1.5, "beta", 0.5, "gam", 1, "delta", 0);
plot (pd);
error: set: "xlim" must not be NaN
title ("Stable distribution, alpha = 1.5, beta = 0.5");