Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mean

Class: prob.ToolboxFittableParametricDistribution
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

Probability distribution, specified as a probability distribution object. Create a probability distribution object with specified parameter values using makedist. Alternatively, create a probability distribution object by fitting it to data using fitdist or the Distribution Fitter app.

Output Arguments

expand all

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

Examples

expand all

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

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

Create a normal distribution object by fitting it to the data.

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

  NormalDistribution

  Normal distribution
       mu = 75.0083   [73.4321, 76.5846]
    sigma =  8.7202   [7.7391, 9.98843]

Compute the mean of the fitted distribution.

m = mean(pd)
m =

   75.0083

The mean of the normal distribution is equal to the parameter mu.

Create a Weibull probability distribution object.

pd = makedist('Weibull','a',5,'b',2)
pd = 

  WeibullDistribution

  Weibull distribution
    A = 5
    B = 2

Compute the mean of the distribution.

mean = mean(pd)
mean =

    4.4311

Was this topic helpful?