Categories &

Functions List

Class Definition: BirnbaumSaundersDistribution

statistics: BirnbaumSaundersDistribution

Gamma probability distribution object.

A BirnbaumSaundersDistribution object consists of parameters, a model description, and sample data for a gamma probability distribution.

The gamma distribution uses the following parameters.

ParameterDescriptionSupport
aShape parameterα > 0
bScale parameterβ > 0

There are several ways to create a BirnbaumSaundersDistribution object.

  • Fit a distribution to data using the fitdist function.
  • Create a distribution with specified parameter values using the makedist function.
  • Use the constructor BirnbaumSaundersDistribution (a, b) to create a gamma distribution with specified parameter values.
  • Use the static method BirnbaumSaundersDistribution.fit (x, censor, freq, options) to a distribution to data x.

It is highly recommended to use fitdist and makedist functions to create probability distribution objects, instead of the constructor and the aforementioned static method.

A BirnbaumSaundersDistribution object contains the following properties, which can be accessed using dot notation.

DistributionNameDistributionCodeNumParametersParameterNames
ParameterDescriptionParameterValuesParameterValuesParameterCI
ParameterIsFixedTruncationIsTruncatedInputData

A BirnbaumSaundersDistribution object contains the following methods: cdf, icdf, iqr, mean, median, negloglik, paramci, pdf, plot, proflik, random, std, truncate, var.

Further information about the Birnbaum-Saunders distribution can be found at https://en.wikipedia.org/wiki/Birnbaum%E2%80%93Saunders_distribution

See also: fitdist, makedist, bisacdf, bisainv, bisapdf, bisarnd, lognfit, bisalike, bisastat

Source Code: BirnbaumSaundersDistribution

Method: cdf

BirnbaumSaundersDistribution: p = icdf (pd, p)

Compute the cumulative distribution function (CDF).

p = icdf (pd, x) computes the quantile (the inverse of the CDF) of the probability distribution object, pd, evaluated at the values in x.

Method: icdf

BirnbaumSaundersDistribution: p = icdf (pd, p)

Compute the cumulative distribution function (CDF).

p = icdf (pd, x) computes the quantile (the inverse of the CDF) of the probability distribution object, pd, evaluated at the values in x.

Method: iqr

BirnbaumSaundersDistribution: r = iqr (pd)

Compute the interquartile range of a probability distribution.

r = iqr (pd) computes the interquartile range of the probability distribution object, pd.

Method: mean

BirnbaumSaundersDistribution: m = mean (pd)

Compute the mean of a probability distribution.

m = mean (pd) computes the mean of the probability distribution object, pd.

Method: median

BirnbaumSaundersDistribution: m = median (pd)

Compute the median of a probability distribution.

m = median (pd) computes the median of the probability distribution object, pd.

Method: negloglik

BirnbaumSaundersDistribution: nlogL = negloglik (pd)

Compute the negative loglikelihood of a probability distribution.

m = negloglik (pd) computes the negative loglikelihood of the probability distribution object, pd.

Method: paramci

BirnbaumSaundersDistribution: ci = paramci (pd)
BirnbaumSaundersDistribution: ci = paramci (pd, Name, Value)

Compute the confidence intervals for probability distribution parameters.

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 specified by Name-Value pair arguments listed below.

NameValue
"Alpha"A scalar value in the range (0,1) 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 an empty array, [], is returned.

Method: pdf

BirnbaumSaundersDistribution: y = pdf (pd, x)

Compute the probability distribution function (PDF).

y = pdf (pd, x) computes the PDF of the probability distribution object, pd, evaluated at the values in x.

Method: plot

BirnbaumSaundersDistribution: plot (pd)
BirnbaumSaundersDistribution: plot (pd, Name, Value)
BirnbaumSaundersDistribution: h = plot (…)

Plot a probability distribution object.

plot (pd plots a probability density function (PDF) of the probability distribution object pd. If pd contains data, which have been fitted by fitdist, the PDF is superimposed over a histogram of the data.

plot (pd, Name, Value) specifies additional options with the Name-Value pair arguments listed below.

NameValue
"PlotType"A character vector specifying the plot type. "pdf" plots the probability density function (PDF). When pd is fit to data, the PDF is superimposed on a histogram of the data. "cdf" plots the cumulative density function (CDF). When pd is fit to data, the CDF is superimposed over an empirical CDF. "probability" plots a probability plot using a CDF of the data and a CDF of the fitted probability distribution. This option is available only when pd is fitted to data.
"Discrete"A logical scalar to specify whether to plot the PDF or CDF of a discrete distribution object as a line plot or a stem plot, by specifying false or true, respectively. By default, it is true for discrete distributions and false for continuous distributions. When pd is a continuous distribution object, option is ignored.
"Parent"An axes graphics object for plot. If not specified, the plot function plots into the current axes or creates a new axes object if one does not exist.

h = plot (…) returns a graphics handle to the plotted objects.

Method: proflik

BirnbaumSaundersDistribution: [nlogL, param] = proflik (pd, pnum)
BirnbaumSaundersDistribution: [nlogL, param] = proflik (pd, pnum, "Display", display)
BirnbaumSaundersDistribution: [nlogL, param] = proflik (pd, pnum, setparam)
BirnbaumSaundersDistribution: [nlogL, param] = proflik (pd, pnum, setparam, "Display", display)

Profile likelihood function for a probability distribution object.

[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 95% confidence interval and computes 100 equispaced values for the selected parameter. pd must be fitted to data.

[nlogL, param] = proflik (pd, pnum, "Display", "on") also plots the profile likelihood against the default range of the selected parameter.

[nlogL, param] = proflik (pd, pnum, setparam) defines a user-defined range of the selected parameter.

[nlogL, param] = proflik (pd, pnum, setparam, "Display", "on") also plots the profile likelihood against the user-defined range of the selected parameter.

For the gamma distribution, pnum = 1 selects the parameter a and pnum = 2 selects the parameter gamma.

When opted to display the profile likelihood plot, proflik also plots the baseline loglikelihood computed at the lower bound of the 95% confidence interval and estimated maximum likelihood. The latter might not be observable if it is outside of the used-defined range of parameter values.

Method: random

BirnbaumSaundersDistribution: y = random (pd)
BirnbaumSaundersDistribution: y = random (pd, rows)
BirnbaumSaundersDistribution: y = random (pd, rows, cols, …)
BirnbaumSaundersDistribution: y = random (pd, [sz])

Generate random arrays from the probability distribution object.

r = random (pd) returns a random number from the distribution object pd.

When called with a single size argument, betarnd returns a square matrix with the dimension specified. When called with more than one scalar argument, the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The size may also be specified with a row vector of dimensions, sz.

Method: std

BirnbaumSaundersDistribution: s = std (pd)

Compute the standard deviation of a probability distribution.

s = std (pd) computes the standard deviation of the probability distribution object, pd.

Method: truncate

BirnbaumSaundersDistribution: t = truncate (pd, lower, upper)

Truncate a probability distribution.

t = truncate (pd) returns a probability distribution t, which is the probability distribution pd truncated to the specified interval with lower limit, lower, and upper limit, upper. If pd is fitted to data with fitdist, the returned probability distribution t is not fitted, does not contain any data or estimated values, and it is as it has been created with the makedist function, but it includes the truncation interval.

Method: var

BirnbaumSaundersDistribution: v = var (pd)

Compute the variance of a probability distribution.

v = var (pd) computes the standard deviation of the probability distribution object, pd.

Example: 1

 

 ## Generate a data set of 5000 random samples from a Birnbaum-Saunders
 ## distribution with parameters β = 1 and γ = 0.5.  Fit a Birnbaum-Saunders
 ## distribution to this data and plot a PDF of the fitted distribution
 ## superimposed on a histogram of the data

 pd = makedist ("BirnbaumSaunders", "beta", 1, "gamma", 0.5)
 randg ("seed", 21);
 data = random (pd, 5000, 1);
 pd = fitdist (data, "BirnbaumSaunders")
 plot (pd)
 msg = "Fitted Birnbaum-Saunders distribution with a = %0.2f and b = %0.2f";
 title (sprintf (msg, pd.beta, pd.gamma))

pd =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =   1
    gamma = 0.5

pd =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =  1.00908   [0.995523, 1.02282]
    gamma = 0.504102   [0.494318, 0.51408]

                    
plotted figure

Example: 2

 

 ## Plot the PDF of a Birnbaum-Saunders distribution, with parameters beta = 1
 ## and gamma = 0.5, truncated at [0, 2] intervals.  Generate 10000 random
 ## samples from this truncated distribution and superimpose a histogram with
 ## 100 bins scaled accordingly

 pd = makedist ("BirnbaumSaunders", "beta", 1, "gamma", 0.5)
 t = truncate (pd, 0, 2)
 randg ("seed", 21);
 data = random (t, 10000, 1);
 plot (t)
 title ("Birnbaum-Saunders distribution (a = 2, b = 4) truncated at [0.1, 0.8]")
 hold on
 hist (data, 100, 50)
 hold off

pd =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =   1
    gamma = 0.5

t =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =   1
    gamma = 0.5
  Truncated to the interval [0, 2]

                    
plotted figure

Example: 3

 

 ## Generate a data set of 100 random samples from a Birnbaum-Saunders
 ## distribution with parameters β = 1 and γ = 0.5.  Fit a Birnbaum-Saunders
 ## distribution to this data and plot its CDF superimposed over an empirical
 ## CDF of the data

 pd = makedist ("BirnbaumSaunders", "beta", 1, "gamma", 0.5)
 randg ("seed", 21);
 data = random (pd, 100, 1);
 pd = fitdist (data, "BirnbaumSaunders")
 plot (pd, "plottype", "cdf")
 title (sprintf ("Fitted Beta distribution with a = %0.2f and b = %0.2f", ...
                 pd.beta, pd.gamma))
 legend ({"empirical CDF", "fitted CDF"}, "location", "east")

pd =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =   1
    gamma = 0.5

pd =
  BirnbaumSaundersDistribution

  gamma distribution
     beta =  0.95916   [0.868955, 1.05873]
    gamma = 0.521745   [0.454224, 0.599305]

                    
plotted figure