Contents

var

Class: prob.KernelDistribution
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. Fit a probability distribution object to data using fitdist or the Distribution Fitting app.

Output Arguments

expand all

v — Variancenonnegative scalar value

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

Examples

expand all

Variance of a Fitted Distribution

Load the sample data. Create a vector containing the first column of students' exam grade data.

load examgrades;
x = grades(:,1);

Fit a kernel distribution object to the data.

pd = fitdist(x,'Kernel')
pd = 

  KernelDistribution

    Kernel = normal
    Bandwidth = 3.61677
    Support = unbounded

Compute the variance of the fitted distribution.

v = var(pd)
v =

   88.4893

See Also

|

Was this topic helpful?