平均
- العربية
- Betawi
- বাংলা
- Català
- Čeština
- Deutsch
- Ελληνικά
- English
- Esperanto
- Español
- Euskara
- فارسی
- Gaeilge
- Galego
- עברית
- Bahasa Indonesia
- ಕನ್ನಡ
- 한국어
- Македонски
- मराठी
- Norsk nynorsk
- Norsk bokmål
- Polski
- Português
- Русский
- Sicilianu
- Simple English
- Slovenčina
- Slovenščina
- ChiShona
- Sunda
- Svenska
- Kiswahili
- தமிழ்
- ไทย
- Türkçe
- Українська
- اردو
- 吴语
- IsiXhosa
- 中文
- 粵語
平均(へいきん、英: mean, average, 独: Mittelwert, 仏: moyenne)または平均値(へいきんち、英: mean value, average value)とは、数学・統計学において、数の集合やデータの中間的な値を指す。欧米語の原意の中間(値)などと和訳することは少ない。
狭い意味での中間値にとどまらず、算術平均(相加平均)・幾何平均(相乗平均)・調和平均・対数平均など様々な種類で用いられる。一般的には特に算術平均を指し、集合の要素の総和を要素数で割ったものである[1] [2] 。
算術平均を用いる際の注意
[編集 ]科学観測や社会調査から得られるデータでは、算術平均を代表値の一つとして用いる。算術平均が中央値、最頻値、中点値と比べてデータの特徴をよく表すものかどうかを検討する必要がある。正規分布に近い場合は算術平均と標準偏差を用いることは適切だが、そうでない分布の場合は、算術平均値が度数の多い値を示すとはいえない。
例えば、国民(例えば日本人)の所得について考える。このデータでは、一部の高所得者が算術平均値を引き上げてしまい、算術平均値をとる世帯は実際にはほとんどいないということになる。よってこの場合正規分布には従わない。日本の国税庁の民間給与実態統計調査によると、平成29年度の場合、給与所得の算術平均値は423万円だが、最頻値は300万円〜400万円の区分であり、ずれている[3] 。従って、一般的な世帯の所得をとらえるには中央値や最頻値が有効であるが、所得は97%〜99%は所得の対数値が正規分布(対数正規分布)に従っているため[4] 、所得の対数値の算術平均、つまり幾何平均を用いるのが適切な所得の代表値であるともいえる。
分布が左右対称でない時、中央値、最頻値を用いると良い場合もある。また、飛び抜けた値(外れ値)がごく少数の場合には、最大と最小を除外した刈込平均(トリム平均 (英語版))を用いることもある。平均が中央値、最頻値、中点値と乖離している場合は刈込平均を含めた平均以外の使用を考えるとよい[5] 。
統計学
[編集 ]統計学では、平均値とは普通は算術平均(相加平均)のことを指す。これはデータの値から算術的に計算して得られる統計指標値の一つである。
母平均と標本平均
[編集 ]統計学では平均には母平均と標本平均がある。母平均は、母集団の相加平均のこと。標本平均は、抽出した標本(母集団の部分集合)の相加平均のこと。母平均を μ、標本平均を m と書いて区別する場合がある[6] [7] 。
相加平均
[編集 ]算術平均(さんじゅつへいきん、英: arithmetic mean, 独: arithmetisches Mittel, 仏: moyenne arithmétique)とも呼ぶ。
相加平均は
- {\displaystyle \mu ={\frac {1}{n}}\sum _{i=1}^{n}x_{i}={\dfrac {x_{1}+x_{2}+\dotsb +x_{n}}{n}}}
で定義される。式変形して
- {\displaystyle n\mu =\sum _{i=1}^{n}x_{i}=x_{1}+x_{2}+\dotsb +x_{n}}
と表すこともできる。
{\displaystyle x_{1},x_{2},\dots ,x_{n}} の相加平均を {\displaystyle {\bar {x}}} とも表す。
相加平均は、加法とスカラー倍が定義された数(実数、複素数、ベクトル等)に対して定義できる。
一般化平均
[編集 ]相乗平均
[編集 ]相乗平均(そうじょうへいきん)または幾何平均(きかへいきん、英: geometric mean, 独: geometrisches Mittel, 仏: moyenne géométrique)は
- {\displaystyle \mu _{\mathrm {G} }={\sqrt[{n}]{\prod _{i=1}^{n}x_{i}}}={\sqrt[{n}]{x_{1}x_{2}\dotsb x_{n}}}}
で定義される。幾何平均は相乗平均と同義の用語である。
式変形して
- {\displaystyle {\mu _{\mathrm {G} }}^{n}=\prod _{i=1}^{n}x_{i}=x_{1}x_{2}\dotsb x_{n}}
とも表せる。
対数を取ると
- {\displaystyle \mu _{\mathrm {G} }=\exp \left({\frac {1}{n}}\sum _{i=1}^{n}\log x_{i}\right)}
- {\displaystyle n\log \mu _{\mathrm {G} }=\sum _{i=1}^{n}\log x_{i}}
となり、相乗平均は、対数の算術平均の指数関数である。あるいは、相乗平均の対数は対数の算術平均である。
データに1つ以上の 0 があるときは、相乗平均は 0 となる。値全てが実数であっても、積が負の場合は、相乗平均は実数の範囲内では存在しない。また複素数の範囲内では、値全てが実数であって積が正負いずれであっても、相乗平均は一意に定まらない可能性がある。
相乗平均は、積と累乗根が定義された数(実数、複素数)について定義できる。
調和平均
[編集 ]調和平均(ちょうわへいきん、英: harmonic mean)は
- {\displaystyle \mu _{\mathrm {H} }={\frac {n}{\sum _{i=1}^{n}{\frac {1}{x_{i}}}}}={\frac {n}{{\tfrac {1}{x_{1}}}+{\tfrac {1}{x_{2}}}+\cdots +{\tfrac {1}{x_{n}}}}}}
で定義される。あるいは
- {\displaystyle {\frac {n}{\mu _{\mathrm {H} }}}=\sum _{i=1}^{n}{\frac {1}{x_{i}}}={\frac {1}{x_{1}}}+{\frac {1}{x_{2}}}+\cdots +{\frac {1}{x_{n}}}}
とも表せる。
調和平均は、逆数の算術平均の逆数である。あるいは、逆数の算術平均は調和平均の逆数である。
しかし、データに1つ以上の 0 があるとき、調和平均はもとの定義式からは定義できないが、0 への極限を取ると、調和平均は 0 となる({\displaystyle x_{i}\to 0} のとき {\displaystyle \mu _{\mathrm {H} }\to 0})。データに負数があっても調和平均は計算することができる。ただし、正負が混在している場合に逆数の和が 0 になることがあり、その場合の極限は発散する。
一般化平均
[編集 ]算術平均、相乗平均、調和平均は同じ式
- {\displaystyle \mu _{p}=\left({\frac {1}{n}}\sum _{i=1}^{n}{x_{i}}^{p}\right)^{1/p}}
あるいは
- {\displaystyle n{\mu _{p}}^{p}=\sum _{i=1}^{n}{x_{i}}^{p}}
で表せる。この実数 p に対して定義した式の値を p一般化平均と呼ぶ。
p = 1 で算術平均、p = −1 で調和平均となり、p → 0 への極限が相乗平均である。また、p = 2 の場合を二乗平均平方根 (RMS) と呼び、物理学や工学で様々な応用をもつ。p → ∞ への極限は最大値、p → −∞ への極限は最小値である。
一般化平均は、ベクトル {\displaystyle (x_{1},\dots ,x_{n})} の pノルムを {\displaystyle n^{1/p}} で割った結果に一致する。
データの p乗の平均、つまり、一般化平均の p乗
- {\displaystyle {\mu _{p}}^{p}={\frac {1}{n}}\sum _{i=1}^{n}{x_{i}}^{p}}
を p乗平均と呼ぶ。
p乗平均・一般化平均の応用として、例えば統計学では分散と標準偏差がある。偏差(値から相加平均を引いた値)のそれぞれ 2乗平均・2一般化平均として定義されている。
一般化平均はさらに一般化が可能で、全単射な関数 f により
- {\displaystyle \mu _{f}=f^{-1}\left({\frac {1}{n}}\sum _{i=1}^{n}f(x_{i})\right)}
という平均が定義できる。恒等関数 f(x) = x により相加平均が、逆数 f(x) = 1/x により調和平均が、対数関数 f(x) = log x により相乗平均がそれぞれ表されている。
相加平均 | 相乗平均 | 調和平均 | |
---|---|---|---|
{\displaystyle f(x)} | {\displaystyle x} | {\displaystyle \log x} | {\displaystyle x^{-1}} |
{\displaystyle f^{-1}(y)} | {\displaystyle y} | {\displaystyle \exp y} | {\displaystyle y^{-1}} |
{\displaystyle f^{-1}\left({\frac {1}{n}}\sum _{i=1}^{n}f(x_{i})\right)} | {\displaystyle {\frac {1}{n}}\sum _{i=1}^{n}x_{i}} | {\displaystyle \exp \left({\frac {1}{n}}\sum _{i=1}^{n}\log x_{i}\right)} | {\displaystyle \left({\frac {1}{n}}\sum _{i=1}^{n}{x_{i}}^{-1}\right)^{-1}} |
定義域
[編集 ]実数 p に対する p一般化平均は、データの値が全て非負の実数であるときに定義される。これは、一般化平均の式に現れる p乗根(冪函数)が負数に対し定義できないためである。例外は、冪関数を使わずに計算できる算術平均と調和平均 (p = ±1) である。それ以外の p ≠ ±1 の場合、負数が1つでも含まれるデータに対しては、一般化平均の定義式は実数を返さないか、実数を返したとしても結果は解釈が難しい。
p < 0 の場合、0 を含むデータに対しては一般化平均の定義式は使えないが、調和平均同様、0 への極限を取ると一般化平均は 0 となる。幾何平均(0一般化平均)も 0 となるので、p ≤ 0 の場合に一般化平均は 0 と考えることができる。
具体例
[編集 ]- 相乗平均
- 78年の経済成長率20%、79年の経済成長率80%の場合、この2年間の平均成長率は{\displaystyle {\sqrt {1.2\times 1.8}}=1.469693846\cdots }より、約47%
- 調和平均
- 往は時速60 km、復は時速90 kmの場合の往復の平均速度は {\displaystyle {\frac {2}{1/(60~\mathrm {km~h^{-1}} )+1/(90~\mathrm {km~h^{-1}} )}}=72~\mathrm {km~h^{-1}} } である。
- 並列接続された電気抵抗の抵抗値などを考える場合に用いる(直列回路と並列回路)。
関係式
[編集 ]相加平均≧相乗平均≧調和平均
[編集 ]n個の実数が全て正の時、次の大小関係が成り立つ。
- 相加平均 ≥ 相乗平均 ≥ 調和平均
- {\displaystyle {\frac {x_{1}+x_{2}+\cdots +x_{n}}{n}}\geq {\sqrt[{n}]{x_{1}x_{2}\cdots x_{n}}}\geq {\frac {n}{{\frac {1}{x_{1}}}+{\frac {1}{x_{2}}}+\cdots +{\frac {1}{x_{n}}}}}}
等号成立条件は
- {\displaystyle x_{1}=x_{2}=\cdots =x_{n}}
である。
左側の不等式は、両辺に対数をとりlogの凸性(イェンセンの不等式)を適用すれば証明できる(数学的帰納法を使った別証明も知られている)。右側の不等式は、調和平均が逆数の相加平均の逆数という事実を左側の不等式に適用すれば証明できる。
さらに拡張した p一般化平均 {\displaystyle \left({\frac {1}{n}}\sum _{i=1}^{n}{x_{i}}^{p}\right)^{1/p}}(p は実数)について、一般には p の広義増加関数となる。p = 1 のとき相加平均、p = −1 のとき調和平均、p → 0 のとき極限として幾何平均になる(#一般化平均を参照)。
相加平均と調和平均の相乗平均
[編集 ]データの大きさ n が 2 のときの相加平均、相乗平均、調和平均をそれぞれ A, G, H とすると、
- {\displaystyle A={\frac {x_{1}+x_{2}}{2}},\quad G={\sqrt {x_{1}x_{2}}},\quad H={\frac {2x_{1}x_{2}}{x_{1}+x_{2}}}}
なので、
- {\displaystyle G={\sqrt {AH}}}
が成立する。すなわち、データの相乗平均は相加平均と調和平均の相乗平均に等しくなる。
様々な平均
[編集 ]加重平均
[編集 ]データの値それぞれに不均等な重みがある場合は、単に相加平均をとるのでなく重みを考慮した平均をとるべきである。各値 xi に、重み wi がついているときの加重平均(重み付き平均)は
- {\displaystyle {\cfrac {w_{1}x_{1}+\dots +w_{n}x_{n}}{w_{1}+\dots +w_{n}}}}
と定義される。特に全ての重みが等しければ、これは通常の相加平均である。
例えば、重み付き最小二乗法では、誤差の小さなデータに大きな重みを与えた残差の加重平均を最小化[注 1] することで、尤度の最大化を図る。重点サンプリング (英語版)によって期待値をモンテカルロ推定するときは、求めたい期待値に関する確率密度とサンプルの確率密度の比を重みとした加重平均を推定量とする。
相乗平均についての重み付き平均は
- {\displaystyle \left({x_{1}}^{w_{1}}\dotsb {x_{n}}^{w_{n}}\right)^{1/p}}
と定義される。ただし {\displaystyle p=\sum _{i=1}^{n}w_{i}} とする。
連続分布の相加平均
[編集 ]データ x(t) が区間 [a, b] で連続的に分布しているとき、その相加平均は積分
- {\displaystyle {\frac {1}{b-a}}\int _{a}^{b}x(t),円dt}
と定義される。これは離散分布の相加平均に対して、無限個の平均を算出する操作を極限により表したものである。
対数平均
[編集 ]特に x(t) が指数関数である場合、その相加平均は端点での関数の値 x(a), x(b) のみで計算でき、
- {\displaystyle {\frac {x(b)-x(a)}{\ln \left(x(b)\right)-\ln \left(x(a)\right)}}}
となる。これは対数平均と呼ばれ、対数平均温度差などの応用例がある。
ベクトルの平均
[編集 ]相加平均や加重平均はベクトルの場合に定義を拡張することができる。ベクトルの平均は物理学における質点の重心と関係がある。相乗平均や調和平均は定義できない。
相加平均
[編集 ]ベクトル x1, ..., xn に対し、それらの(相加)平均を
- {\displaystyle {\frac {{\boldsymbol {x}}_{1}+\dots +{\boldsymbol {x}}_{n}}{n}}}
で定義する。
n = 3 の場合、x1, x2, x3 の平均は各点が作る三角形の重心である。これはベクトルの数が n の場合にも一般化でき、x1, ..., xn の平均は各点が作る n単体の重心である。
加重平均
[編集 ]加重平均も同様にベクトルに拡張でき、
- {\displaystyle {\frac {w_{1}{\boldsymbol {x}}_{1}+\dots +w_{n}{\boldsymbol {x}}_{n}}{w_{1}+\dots +w_{n}}}}
と定義される。
m乗平均・一般化平均はスカラー
- {\displaystyle {\frac {\|{\boldsymbol {x}}_{1}\|^{m}+\dots +\|{\boldsymbol {x}}_{n}\|^{m}}{n}},\quad {\sqrt[{m}]{\frac {\|{\boldsymbol {x}}_{1}\|^{m}+\dots +\|{\boldsymbol {x}}_{n}\|^{m}}{n}}}}
として定義される。ただしここで ‖ ・ ‖ は、ベクトルのノルムである。m = 2 の場合、‖ x ‖2 は内積 {\displaystyle \langle {\boldsymbol {x}},{\boldsymbol {x}}\rangle } に一致するので、m = 2 の場合の m乗平均や一般化平均が特に重要である。たとえば物理学では速さの平均値(根二乗平均速度)として、m = 2 の場合の一般化平均を使うことがある。
ベクトルの加重平均の概念には、物理的な解釈を与えることができる。質点 P1, ..., Pn がそれぞれ位置 x1, ..., xn にあり、それぞれの質量が m1, ..., mn であるとき、加重平均
- {\displaystyle {\cfrac {m_{1}{\boldsymbol {x}}_{1}+\dots +m_{n}{\boldsymbol {x}}_{n}}{m_{1}+\dots +m_{n}}}}
は系の重心である。
算術幾何平均
[編集 ]a0, b0 を、a0 > b0 を満たす2つの非負実数とする。a1, a2, ...; b1, b2, ... を
- {\displaystyle a_{i+1}={\frac {a_{i}+b_{i}}{2}}}
- {\displaystyle b_{i+1}={\sqrt {a_{i}b_{i}}}}
により定義する。このとき、
- {\displaystyle \lim _{i\to \infty }a_{i}=\lim _{i\to \infty }b_{i}}
を a0 と b0 の算術幾何平均という。
移動平均
[編集 ]系列データ を平滑化する手法である。画像や音声等、デジタル信号処理に留まらず、テクニカル分析などの金融分野、気象、水象を含む計測分野等、広い技術分野で使われている。
注釈
[編集 ]- ^ 最小二乗法において、加重和の最小化と加重平均の最小化は同じことである。
出典
[編集 ]- ^ JIS Z 8101-1 : 1999, 2.13 平均.
- ^ 例えば A, B, C という3人の体重がそれぞれ 55 kg, 60 kg, 80 kg であったとすると、3人の体重の平均値は (55 kg + 60 kg + 80 kg) ÷ 3 = 65 kg である。
- ^ 民間給与実態統計調査結果 - 標本調査結果|国税庁
- ^ Clementi, Fabio; Gallegati, Mauro (2005) "Pareto's law of income distribution: Evidence for Germany, the United Kingdom, and the United States", EconWPA
- ^ 西岡, 刈込平均 p.7.
- ^ 西岡, p.5.
- ^ 伏見, 第II章 確率論 10節 偶然量、平均値 p.70.
参考文献
[編集 ]- 岡田泰栄『平均値の統計』共立出版<数学ワンポイント双書>、1981年。
- 鷲尾泰俊『推定と検定』共立出版<数学ワンポイント双書>、1978年。
- 西岡康夫『数学チュートリアル やさしく語る 確率統計』オーム社、2013年。ISBN 9784274214073。
- 日本数学会『数学辞典』岩波書店、2007年。ISBN 9784000803090。
- JIS Z 8101-1:1999 統計 − 用語と記号 − 第1部:確率及び一般統計用語, 日本規格協会, (1999), http://kikakurui.com/z8/Z8101-1-1999-01.html
- 伏見康治『確率論及統計論』河出書房、1942年。ISBN 9784874720127 。http://ebsa.ism.ac.jp/ebooks/ebook/204 。