主要内容

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

var

概率分布的方差

说明

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
BetaDistributionmakedistfitdist分布拟合器
BinomialDistributionmakedistfitdist分布拟合器
BirnbaumSaundersDistributionmakedistfitdist分布拟合器
BurrDistributionmakedistfitdist分布拟合器
EmpiricalDistributionfitdist
ExponentialDistributionmakedistfitdist分布拟合器
ExtremeValueDistributionmakedistfitdist分布拟合器
GammaDistributionmakedistfitdist分布拟合器
GeneralizedExtremeValueDistributionmakedistfitdist分布拟合器
GeneralizedParetoDistributionmakedistfitdist分布拟合器
HalfNormalDistributionmakedistfitdist分布拟合器
InverseGaussianDistributionmakedistfitdist分布拟合器
KernelDistributionfitdist分布拟合器
LogisticDistributionmakedistfitdist分布拟合器
LoglogisticDistributionmakedistfitdist分布拟合器
LognormalDistributionmakedistfitdist分布拟合器
LoguniformDistributionmakedist
MultinomialDistributionmakedist
NakagamiDistributionmakedistfitdist分布拟合器
NegativeBinomialDistributionmakedistfitdist分布拟合器
NormalDistributionmakedistfitdist分布拟合器
PearsonDistributionmakedist
PiecewiseLinearDistributionmakedist
PoissonDistributionmakedistfitdist分布拟合器
RayleighDistributionmakedistfitdist分布拟合器
RicianDistributionmakedistfitdist分布拟合器
StableDistributionmakedistfitdist分布拟合器
tLocationScaleDistributionmakedistfitdist分布拟合器
TriangularDistributionmakedist
UniformDistributionmakedist
WeibullDistributionmakedistfitdist分布拟合器

输出参量

全部折叠

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

扩展功能

全部展开

版本历史记录

在 R2013a 中推出