Documentation Center

  • Trial Software
  • Product Updates

var

Class: prob.ParametricTruncatableDistribution
Package: prob

Variance of probability distribution object

Syntax

v = var(pd)

Description

v = var(pd) returns the variance v of the probability distribution pd.

Input Arguments

expand all

pd — Probability distributionprobability distribution object

Probability distribution, specified as a probability distribution object. Create a probability distribution object with specified parameter values using makedist.

Output Arguments

expand all

v — Variancenonnegative scalar value

Variance of the probability distribution, returned as a nonnegative scalar value.

Examples

Variance of a Triangular Distribution

Create a triangular distribution object.

pd = makedist('Triangular','a',-3,'b',1,'c',3)
pd = 

  TriangularDistribution

A = -3, B = 1, C = 3

Compute the variance of the distribution.

v = var(pd)
v =

    1.5556

See Also

Was this topic helpful?