为什么方差公式要用平方而不用绝对值_标准差和方差

标准差

标准差是数值分散的测量。

标准差的符号是 σ (希腊语字母 西格马,英语 sigma)

公式很简单:方差平方根。那么…… "方差是什么?"

方差

方差的定义是:

离平均的平方距离的平均。

按照以下的步骤来计算方差:

求数值的 平均
从每一个数值减去平均,然后求差的平方
求结果的平均。(为什么要求平方?)

例子

你和朋友们量度了狗狗的身高(毫米)

62af437ff0c47a0382369f8f04938461.png

身高(到肩膀)是:600mm、470mm、170mm、430mm 和 300mm。

求平均、方差和标准差。

第一步是求平均:

答案:

平均 = 600 + 470 + 170 + 430 + 3005 = 19705 = 394

平均身高是 394 mm。我们画在图上:

ef3cbaeab0bba30ec8ca2d8d8f8ab0b0.png

要计算方差,求每个距离的平方,然后求平均:

cfb89164529ce6150e9cfa7f800b7bba.gif

方差是 21,704

标准差是方差的平方根:

标准差σ= √21,704= 147.32……=147(到最近的毫米)

标准差很有用。 我们现在可以显示哪个高度是在离平均一个标准差(147mm)之内:

51469e2b81846353edc8777c291cf6fb.png

标准差是一个甄别数值是正常与否的"标准"。

可是……如果数据是样本数据

以上例子的数据是对象总体的数据(我们的对象就是那 5条狗)。

但如果数据是个样本(只是对象总体的一部分),计算便会有点改变!

1863ce3a41b16d0d98419ce23ad70d39.png

其他的计算步骤不变,包括计算平均在内。

7319efd3882e85d605b71de4747e1888.png

想象这是对样本数据的 "修补"。

公式

这是在 标准差公式 网页里的两个公式(你可以去看看来了解更多):


"对象总体标准差":

8159271f0f66598422deec2d7cfe258d.gif

"样本标准差":

478b66b54b3a69b7e74a932e84648d35.gif

乍看很复杂,但其实只是在计算样本方差时,有个重要的改变:
以除以 N-1 来代替除以 N

脚注:为什么要求差的平方

如果我们只把和平均的差加起来……负值和正值便会互相抵消:

858a8b4c89363f89fc263cb39b00fc64.png

4 + 4 − 4 − 44=0

这不行。我们可以用绝对值吗?

858a8b4c89363f89fc263cb39b00fc64.png

|4| + |4| + |−4| + |−4|4=4 + 4 + 4 + 44=4

不错(这叫 平均差),但看看这个例子:

002ee188390f88b523c53b04cbc884cf.png

|7| + |1| + |−6| + |−2|4=7 + 1 + 6 + 24=4

糟了!数据比较分散,但结果还是 4。

我们来试试求每个差的平方(最后才取平方根):

858a8b4c89363f89fc263cb39b00fc64.png

√(42+ 42+ 42+ 424)=√(644)=4

002ee188390f88b523c53b04cbc884cf.png

√(72+ 12+ 62+ 224)=√(904)=4.74...

好极了!当数据比较分散时,标准差也比较大……正是我们想要的。

其实这个方法和 两点之间的距离 都是基于同一个原理,不过应用不同而已。

同时,用代数来处理平方和平方根比处理绝对值要容易很多,标准差也比较容易被应用在其他数学领域。

本文非原创,本文非原创,本文非原创,原文转载自https://www.shuxuele.com/data/standard-deviation.html

下面几个问题的答案来自专业课教科书解答

Why do we square the deviations?
First, the sum of the squared deviations of any set of observations from their mean is the smallest that the sum of squared deviations from any number can possibly be. This is not true of the unsquared distances. So squared deviations point to the mean as center in a way that distances do not.
Second, the standard deviation turns out to be the natural measure of spread for a particularly important class of symmetric unimodal distributions, the Normal distributions.

Why do we emphasize the standard deviation rather than the variance?
One reason is that s, not s2, is the natural measure of spread for Normal distributions
There is also a more general reason to prefer s to s2. Because the variance involves squaring the deviations, it does not have the same unit of measurement as the original observations. The variance of the metabolic rates, for example, is measured in squared calories. Taking the square root gives us a description of the spread of the distribution in the original measurement units.

Why do we average by dividing by n – 1 rather than n in calculating the variance?
Because the sum of the deviations is always zero, the last deviation can be found once we know the other n − 1. So we are not averaging n unrelated numbers. Only n − 1 of the squared deviations can vary freely, and we average by dividing the total by n − 1.
degrees of freedom
The number n – 1 is called the degrees of freedom of the variance or standard deviation. Many calculators offer a choice between dividing by n and dividing by n − 1, so be sure to use n − 1.

  • 8
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
四分位是指上四分位数与下四分位数之,用来衡量数据的离散程度。它是一种非常简单直观的度量方法,不受极端值的影响,主要用于衡量中位数的代表性。 方是一组数据与其平均值之的平方的平均值,它用来衡量数据的离散程度。方越大,数据越分散;方越小,数据越集中。方是最常用的衡量数据离散程度的方法之一。 标准是方的平方根,它与方具有相同的度量单位,但更易于理解和解释。标准越大,数据的离散程度越大;标准越小,数据的离散程度越小。 平均绝对离是一组数据与其平均值之绝对值的平均值,它衡量数据的离散程度。平均绝对离不受极端值的影响,但相对于方标准,它更容易受到异常值的干扰。 变异系数是标准与平均值之比,主要用于比较不同样本数据的离散程度。变异系数越大,表示数据的离散程度越大;变异系数越小,表示数据的离散程度越小。变异系数是一种无量纲的指标,适用于不同单位或量级的数据进行比较。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [统计学系列——数据分布特征与适用的描述统计量](https://blog.csdn.net/weixin_45665432/article/details/112220875)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [数据分析|数据分布特征的描述](https://blog.csdn.net/qq_31405629/article/details/103019415)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值