主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

var

R2025b

概率分布的方差

描述

v = var(pd) 返回概率分布 pd 的方差 v。

示例

示例

全部折叠

加载样本数据。创建包含学生考试成绩数据第一列的向量。

load examgrades
x = grades(:,1);

对数据进行正态分布对象拟合。

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

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

计算拟合分布的方差。

v = var(pd)
v = 
76.0419

对于正态分布,方差等于参数 sigma 的平方。

创建威布尔概率分布对象。

pd = makedist('Weibull','A',5,'B',2)
pd = 
  WeibullDistribution

  Weibull distribution
    A = 5
    B = 2

计算分布的方差。

v = var(pd)
v = 
5.3650

创建一个三角分布对象。

pd = makedist('Triangular','A',-3,'B',1,'C',3)
pd = 
  TriangularDistribution

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

计算分布的方差。

v = var(pd)
v = 
1.5556

加载样本数据。创建包含学生考试成绩数据的第一列的向量。

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

对数据进行核分布对象拟合。

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

    Kernel = normal
    Bandwidth = 3.61677
    Support = unbounded

计算拟合分布的方差。

v = var(pd)
v = 
88.4893

输入参数

全部折叠

概率分布,指定为下表中的概率分布对象之一。

分布对象用于创建概率分布对象的函数或 App
BetaDistributionmakedist、fitdist、分布拟合器
BinomialDistributionmakedist、fitdist、分布拟合器
BirnbaumSaundersDistributionmakedist、fitdist、分布拟合器
BurrDistributionmakedist、fitdist、分布拟合器
EmpiricalDistributionfitdist
ExponentialDistributionmakedist、fitdist、分布拟合器
ExtremeValueDistributionmakedist、fitdist、分布拟合器
GammaDistributionmakedist、fitdist、分布拟合器
GeneralizedExtremeValueDistributionmakedist、fitdist、分布拟合器
GeneralizedParetoDistributionmakedist、fitdist、分布拟合器
HalfNormalDistributionmakedist、fitdist、分布拟合器
InverseGaussianDistributionmakedist、fitdist、分布拟合器
KernelDistributionfitdist、分布拟合器
LogisticDistributionmakedist、fitdist、分布拟合器
LoglogisticDistributionmakedist、fitdist、分布拟合器
LognormalDistributionmakedist、fitdist、分布拟合器
LoguniformDistributionmakedist
MultinomialDistributionmakedist
NakagamiDistributionmakedist、fitdist、分布拟合器
NegativeBinomialDistributionmakedist、fitdist、分布拟合器
NormalDistributionmakedist、fitdist、分布拟合器
PearsonDistributionmakedist
PiecewiseLinearDistributionmakedist
PoissonDistributionmakedist、fitdist、分布拟合器
RayleighDistributionmakedist、fitdist、分布拟合器
RicianDistributionmakedist、fitdist、分布拟合器
StableDistributionmakedist、fitdist、分布拟合器
tLocationScaleDistributionmakedist、fitdist、分布拟合器
TriangularDistributionmakedist
UniformDistributionmakedist
WeibullDistributionmakedist、fitdist、分布拟合器

输出参量

全部折叠

概率分布的方差,以非负标量值形式返回。

扩展功能

全部展开

版本历史记录

在 R2013a 中推出