二乗平均平方根 ( にじょうへいきんへいほうこん 、( 英 : root mean square , RMS )はデータ や確率変数 の二乗 の算術平均 の平方根 である[ 1] 。
RMSはデータ ・確率変数 ・離散信号 ・連続関数 など複数要素からなる対象について、要素を二乗 し、それらの算術平均 を取り、この平均値の平方根 を取ったものである[ 1] (⇒ #定義 )。RMSは単位の維持や直交成分の二乗平均和などの特性をもつ[ 2] (⇒ #特性 )。これらの特性から「強さ」の指標として有用であり[ 3] 、実効値 という名前で広く応用されている[ 4] (⇒ #応用 )。偏差のRMSは平均 や標準偏差 と関連がある(⇒ #平均値および標準偏差との関係 )。
絶対値の平均よりも計算が積和演算であるため高速化が容易である。二乗平均平方根は、一般化平均 において指数 パラメータ を 2 としたものであるとも言える。
RMSは「系列の各要素を2乗し、それらを平均し、平均値の平方根をとったもの」である[ 1] 。
大きさ
n
∈
R
{\displaystyle n\in \mathbb {R} }
のデータ あるいは離散信号
{
x
1
,
x
2
,
.
.
.
,
x
n
}
{\displaystyle \{x_{1},x_{2},...,x_{n}\}}
のRMSは以下で定義される:
RMS
[
x
]
=
1
n
∑
i
=
1
n
x
i
2
=
x
1
2
+
x
2
2
+
⋯
+
x
n
2
n
{\displaystyle \operatorname {RMS} [x]={\sqrt {{\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}{x_{i}}^{2}}}={\sqrt {\frac {{x_{1}}^{2}+{x_{2}}^{2}+\cdots +{x_{n}}^{2}}{n}}}}
連続関数 あるいは連続信号
x
(
t
)
{\displaystyle x(t)}
の区間
[
t
1
,
t
2
]
{\displaystyle [t_{1},t_{2}]}
におけるRMSは以下で定義される:
RMS
[
x
(
t
)
]
=
1
|
t
2
−
t
1
|
∫
t
1
t
2
(
x
(
t
)
)
2
d
t
{\displaystyle \operatorname {RMS} [x(t)]={\sqrt {{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}(x(t))^{2}\,dt}}}
充分小さな Δx′ に対して x ∈ [x' , x + Δx′ ] となる確率 を f (x )Δx′ としたとき、x の二乗平均平方根 RMS[x ] は
RMS
[
x
]
=
∫
−
∞
∞
x
′
2
f
(
x
′
)
d
x
′
{\displaystyle \operatorname {RMS} [x]={\sqrt {\int _{-\infty }^{\infty }x'^{2}f(x')dx'}}}
と定義される。ここで関数 f (x' ) は確率密度関数 と呼ばれる。
RMSの単位は元要素と同じ単位をもつ。
元要素の単位を
k
{\displaystyle k}
としてRMSの各段階での単位変換 を考えると、要素を2乗して
k
2
{\displaystyle k^{2}}
となり、平均は単位に影響しないので
k
2
{\displaystyle k^{2}}
のままであり、最後に0.5乗(=ルート)して
k
{\displaystyle k}
になる。つまり元要素の単位とRMSの単位は一致する。
RMSは「直交成分の二乗平均の和」の平方根と同値である[ 2] 。
対象の信号
x
(
t
)
{\displaystyle x(t)}
が互いに直交する成分
f
(
t
)
{\displaystyle f(t)}
と
g
(
t
)
{\displaystyle g(t)}
に分解できるとする。つまり以下が2つが成立するとする:
x
(
t
)
=
f
(
t
)
+
g
(
t
)
,
∫
f
(
t
)
g
(
t
)
d
t
=
0
{\displaystyle x(t)=f(t)+g(t),\quad \int f(t)g(t)\,dt=0}
ここでRMSの計算途中に2乗が現れることに注目し、二乗平均を
MS
(
⋅
)
{\displaystyle \operatorname {MS} (\cdot )}
とすると、以下のように変形できる:
RMS
(
x
)
=
MS
(
x
)
=
1
|
t
2
−
t
1
|
∫
t
1
t
2
x
2
(
t
)
d
t
=
1
|
t
2
−
t
1
|
∫
t
1
t
2
f
2
(
t
)
+
2
f
(
t
)
g
(
t
)
+
g
2
(
t
)
d
t
=
1
|
t
2
−
t
1
|
∫
t
1
t
2
f
2
(
t
)
+
0
+
g
2
(
t
)
d
t
=
1
|
t
2
−
t
1
|
∫
t
1
t
2
f
2
(
t
)
d
t
+
1
|
t
2
−
t
1
|
∫
t
1
t
2
g
2
(
t
)
d
t
=
MS
(
f
)
+
MS
(
g
)
{\displaystyle {\begin{aligned}\operatorname {RMS} (x)={\sqrt {\operatorname {MS} (x)}}&={\sqrt {{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}x^{2}(t)\,dt}}\\&={\sqrt {{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}f^{2}(t)+2f(t)g(t)+g^{2}(t)\,dt}}\\&={\sqrt {{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}f^{2}(t)+0+g^{2}(t)\,dt}}\\&={\sqrt {{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}f^{2}(t)\,dt+{\frac {1}{|t_{2}-t_{1}|}}\int _{t_{1}}^{t_{2}}g^{2}(t)\,dt}}\\&={\sqrt {\operatorname {MS} (f)+\operatorname {MS} (g)}}\end{aligned}}}
この式は3成分以上でも成立する。つまり「信号全体の二乗平均」の平方根であるRMSは「直交成分の二乗平均の和」の平方根と同値である[ 2] 。
この特性はRMSを「強さ」の指標として応用する上で有用である[ 3] 。例えば関数をフーリエ級数 展開して三角関数の和と捉えたとき、異なる周波数の三角関数が互いに直交するため直交成分の二乗平均和が成立する(参考: パーセヴァルの等式 )。これにより要素波の強ささえ測れれば波全体の強さが測れる[ 3] 。
例えば、データ 1, 1, 2, 3, 5 の二乗平均平方根は次のようになる。
RMS
[
x
]
=
1
5
(
1
2
+
1
2
+
2
2
+
3
2
+
5
2
)
=
8
≈
2.8284271
{\displaystyle {\begin{aligned}\operatorname {RMS} [x]&={\sqrt {{\frac {1}{5}}\left(1^{2}+1^{2}+2^{2}+3^{2}+5^{2}\right)}}\\&={\sqrt {8}}\approx 2.8284271\end{aligned}}}
周期関数 については通常、積分区間を周期の整数 倍に一致させて求める。
たとえば x (t ) = sin(ωt ) については、周期を τ = 2π / ω で表し、
RMS
[
sin
ω
t
]
=
1
τ
∫
0
τ
sin
2
ω
t
d
t
=
1
τ
∫
0
τ
1
−
cos
2
ω
t
2
d
t
=
1
2
{\displaystyle \operatorname {RMS} [\sin \omega t]={\sqrt {{\frac {1}{\tau }}\int _{0}^{\tau }\sin ^{2}\omega t\,dt}}={\sqrt {{\frac {1}{\tau }}\int _{0}^{\tau }{\frac {1-\cos 2\omega t}{2}}\,dt}}={\frac {1}{\sqrt {2}}}}
のようにする。同様に三角関数 の和について、適当な周期を τ として、
RMS
[
∑
n
c
n
sin
ω
n
t
]
=
1
τ
∫
0
τ
(
∑
n
c
n
sin
ω
n
t
)
2
d
t
=
1
τ
∑
m
,
n
∫
0
τ
c
m
c
n
sin
(
ω
m
t
)
sin
(
ω
n
t
)
d
t
=
1
τ
∑
m
,
n
∫
0
τ
c
m
c
n
cos
(
ω
m
t
−
ω
n
t
)
−
cos
(
ω
m
t
+
ω
n
t
)
2
d
t
=
1
2
∑
n
(
c
n
)
2
{\displaystyle {\begin{aligned}\operatorname {RMS} \left[\sum _{n}c_{n}\sin \omega _{n}t\right]&={\sqrt {{\frac {1}{\tau }}\int _{0}^{\tau }\left(\sum _{n}c_{n}\sin \omega _{n}t\right)^{2}\,dt}}\\&={\sqrt {{\frac {1}{\tau }}\sum _{m,n}\int _{0}^{\tau }c_{m}c_{n}\sin(\omega _{m}t)\sin(\omega _{n}t)\,dt}}\\&={\sqrt {{\frac {1}{\tau }}\sum _{m,n}\int _{0}^{\tau }c_{m}c_{n}{\frac {\cos(\omega _{m}t-\omega _{n}t)-\cos(\omega _{m}t+\omega _{n}t)}{2}}\,dt}}\\&={\sqrt {{\frac {1}{2}}\sum _{n}(c_{n})^{2}}}\end{aligned}}}
となる。非対角成分 は積分 すると 0 になる(直交)ので、対角成分の積分だけが残る。
変量 x に対して期待値 ⟨x ⟩ が定まるなら、その量の期待値からの偏差 x − ⟨x ⟩ の二乗平均平方根 RMS[x − ⟨x ⟩] を与えることができる。この偏差の二乗平均平方根は x の標準偏差 σx に等しい。
σ
x
=
1
n
∑
i
=
1
n
(
x
i
−
⟨
x
⟩
)
2
=
RMS
[
x
−
⟨
x
⟩
]
{\displaystyle \sigma _{x}={\sqrt {{\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}\left(x_{i}-\langle x\rangle \right)^{2}}}=\operatorname {RMS} [x-\langle x\rangle ]}
また、二乗偏差 (x − ⟨x ⟩)2 を展開すれば、偏差の二乗平均平方根は次のように書き直せる。
RMS
[
x
−
⟨
x
⟩
]
=
1
n
∑
i
=
1
n
(
x
i
−
⟨
x
⟩
)
2
=
1
n
∑
i
=
1
n
x
i
2
−
2
⟨
x
⟩
1
n
∑
i
=
1
n
x
i
+
⟨
x
⟩
2
=
(
RMS
[
x
]
)
2
−
⟨
x
⟩
2
{\displaystyle {\begin{aligned}\operatorname {RMS} [x-\langle x\rangle ]&={\sqrt {{\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}\left(x_{i}-\langle x\rangle \right)^{2}}}\\&={\sqrt {{\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}{x_{i}}^{2}-2\langle x\rangle {\dfrac {1}{n}}\sum \limits _{i=1}^{n}x_{i}+\langle x\rangle ^{2}}}\\&={\sqrt {\left(\operatorname {RMS} [x]\right)^{2}-\langle x\rangle ^{2}}}\end{aligned}}}
ただし最後に期待値 ⟨x ⟩ が xi の平均値 x に等しいことを使った。
⟨
x
⟩
=
x
¯
=
1
n
∑
i
=
1
n
x
i
{\displaystyle \langle x\rangle ={\bar {x}}={\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}x_{i}}
このとき次の関係が成り立つ。
(
RMS
[
x
]
)
2
=
σ
x
2
+
⟨
x
⟩
2
{\displaystyle \left(\operatorname {RMS} [x]\right)^{2}={\sigma _{x}}^{2}+\langle x\rangle ^{2}}
期待値 ⟨x ⟩ が xi の算術平均 x に等しいことは一般には成り立たない。たとえば xi を x の各回の測定値だとすれば、その標本平均 x は期待値 ⟨x ⟩ からある精度で外れた値になる。実験では真の値は分からないので、期待値 ⟨x ⟩ の代わりに測定値の標本平均 x が用いられ、標準偏差は測定値の平均値からの不偏分散 の平方根によって推定される。不偏でない単純な標本標準偏差は二乗平均平方根の形で表されるが、不偏標本標準偏差 ux はそれとは異なる。
RMS
[
x
−
x
¯
]
=
1
n
∑
i
=
1
n
(
x
−
x
¯
)
2
≠
1
n
−
1
∑
i
=
1
n
(
x
−
x
¯
)
2
=
u
x
{\displaystyle \operatorname {RMS} [x-{\bar {x}}]={\sqrt {{\frac {1}{n}}\textstyle \sum \limits _{i=1}^{n}(x-{\bar {x}})^{2}}}\neq {\sqrt {{\frac {1}{n-1}}\textstyle \sum \limits _{i=1}^{n}(x-{\bar {x}})^{2}}}=u_{x}}
単純な標本標準偏差では分散の重心が期待値ではなく標本平均になっているため、これは真の値からの誤差を評価していない。
これらがほぼ等価であると言えるのは、測定精度に比べて充分多くの回数測定を行った場合だけである。
RMSは「強さ」の指標として有用な特性を備えている[ 3] (⇒ #特性 )。そのため光学 ・電子工学 ・音響学 などに「実効値 [ 4] 」という名称で応用されている。
^ a b c 2 乗して平均したあとで平方根をとる ... 実効値 (Hima 2011 , p. 1)
^ a b c 実効値の計算は ... 各々の正弦波の実効値の 2 乗の和の平方根となり (Hima 2011 , pp. 3–4)
^ a b c d 合成波の実効値も任意の時間信号に含まれる正弦波の振幅だけに依存する量となりますので、信号の大きさ(強さ)を表すのに適している (Hima 2011 , p. 4)
^ a b 実効値は RMS(Root Mean Square)と略記されます (Hima 2011 , p. 6)