Documentation Center

  • Trial Software
  • Product Updates

Contents

mean

Class: prob.KernelDistribution
Package: prob

Mean of probability distribution object

Syntax

m = mean(pd)

Description

m = mean(pd) returns the mean m 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

m — Meanscalar value

Mean of the probability distribution, returned as a scalar value.

Examples

expand all

Mean of a Kernel Distribution

Load the sample data. Create a probability distribution object by fitting a kernel distribution to the miles per gallon (MPG) data.

load carsmall;
pd = fitdist(MPG,'Kernel')
pd = 

  KernelDistribution

    Kernel = normal
    Bandwidth = 4.11428
    Support = unbounded

Compute the mean of the distribution.

mean(pd)
ans =

   23.7181

See Also

|

Was this topic helpful?