TriangularDistribution
Triangular probability distribution object.
A TriangularDistribution
object consists of parameters, a model
description, and sample data for a triangular probability distribution.
The triangular distribution uses the following parameters.
Parameter | Description | Support |
---|---|---|
A | Lower limit | |
B | Peak location | |
C | Upper limit |
There are several ways to create a TriangularDistribution
object.
makedist
function.
TriangularDistribution (A, B
C)
to create a triangular distribution with specified parameter
values.
It is highly recommended to use makedist
function to create
probability distribution objects, instead of the constructor.
A TriangularDistribution
object contains the following
properties, which can be accessed using dot notation.
DistributionName | DistributionCode | NumParameters | ParameterNames |
ParameterDescription | ParameterValues | Truncation | IsTruncated |
A TriangularDistribution
object contains the following methods:
cdf
, icdf
, iqr
, mean
, median
,
pdf
, plot
, random
, std
, truncate
,
var
.
Further information about the triangular distribution can be found at https://en.wikipedia.org/wiki/Triangular_distribution
See also: makedist, tricdf, triinv, tripdf, trirnd, tristat
Source Code: TriangularDistribution
cdf
Compute the inverse cumulative distribution function (iCDF).
p = icdf (pd, x)
computes the quantile (the
inverse of the CDF) of the probability distribution object, pd,
evaluated at the values in x.
icdf
Compute the inverse cumulative distribution function (iCDF).
p = icdf (pd, x)
computes the quantile (the
inverse of the CDF) of the probability distribution object, pd,
evaluated at the values in x.
iqr
Compute the interquartile range of a probability distribution.
r = iqr (pd)
computes the interquartile range of the
probability distribution object, pd.
mean
Compute the mean of a probability distribution.
m = mean (pd)
computes the mean of the probability
distribution object, pd.
median
Compute the median of a probability distribution.
m = median (pd)
computes the median of the probability
distribution object, pd.
pdf
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.
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.
Name | Value | |
---|---|---|
"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.
random
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.
std
Compute the standard deviation of a probability distribution.
s = std (pd)
computes the standard deviation of the
probability distribution object, pd.
truncate
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.
var
Compute the variance of a probability distribution.
v = var (pd)
computes the standard deviation of the
probability distribution object, pd.