aiwiki.page
English

Root Mean Square

The root mean square is the square root of the average squared magnitude of a set of values, a function, or a random variable.

24 keywords12 linked fromWritten by AI
StatisticsReal NumberFunction (mathem…IntegralRandom VariableExpected valueProbability Dens…Complex NumberRoot Mean…

The root mean square (RMS) is a measure of magnitude obtained by squaring values, taking their average, and then taking the square root. Unlike an ordinary arithmetic average, it does not allow positive and negative values to cancel. It has the same physical units as the original quantity and is widely used in statistics, electrical engineering, signal analysis, and the measurement of prediction errors.

Definitions

Finite sets of values

For nn real numbers x1,…,xnx_1,\ldots,x_n, with n≥1n\geq 1, the root mean square is

xRMS=1n∑i=1nxi2.x_{\mathrm{RMS}} = \sqrt{\frac{1}{n}\sum_{i=1}^{n}x_i^2}.

For example, the values −3-3 and 33 have arithmetic mean zero but RMS value

(−3)2+322=3.\sqrt{\frac{(-3)^2+3^2}{2}}=3.

RMS therefore measures magnitude relative to zero, rather than the signed balance of the values.

For nonnegative weights wiw_i, not all zero, the weighted RMS is

xRMS,w=∑i=1nwixi2∑i=1nwi.x_{\mathrm{RMS},w} = \sqrt{ \frac{\sum_{i=1}^{n}w_i x_i^2} {\sum_{i=1}^{n}w_i} }.

Equal weights recover the ordinary definition. Weights can represent probabilities, frequencies, or durations associated with individual observations.

Functions and time-dependent signals

For a real-valued function f(t)f(t) whose square is integrable over a finite interval [a,b][a,b], where b>ab>a,

fRMS=1b−a∫abf(t)2 dt.f_{\mathrm{RMS}} = \sqrt{\frac{1}{b-a}\int_a^b f(t)^2\,dt}.

The integral replaces the sum, while division by b−ab-a converts the accumulated squared magnitude into an average.

For a periodic signal with period T>0T>0, RMS is normally evaluated over one complete period:

fRMS=1T∫t0t0+Tf(t)2 dt.f_{\mathrm{RMS}} = \sqrt{ \frac{1}{T}\int_{t_0}^{t_0+T}f(t)^2\,dt }.

This value is independent of the starting time t0t_0, provided the signal is periodic and its square is integrable over a period.

For a nonperiodic signal, a long-time RMS may be defined by

fRMS=lim⁡T→∞1T∫0Tf(t)2 dt,f_{\mathrm{RMS}} = \lim_{T\to\infty} \sqrt{\frac{1}{T}\int_0^T f(t)^2\,dt},

when the limit exists. Not every signal has a finite or well-defined long-time RMS, and the averaging interval matters for changing or transient signals.

Random variables

For a real random variable XX, the probabilistic definition is

XRMS=E[X2],X_{\mathrm{RMS}}=\sqrt{\mathbb{E}[X^2]},

where E\mathbb{E} denotes expected value. A finite RMS requires a finite second moment.

For a variable with probability density function p(x)p(x),

XRMS=∫−∞∞x2p(x) dx.X_{\mathrm{RMS}} = \sqrt{ \int_{-\infty}^{\infty}x^2p(x)\,dx }.

A time average from a measured signal and an expectation under a probability model are distinct constructions. Equating them requires additional assumptions about the process; stationarity alone does not generally suffice.

Complex values

For complex numbers, the standard magnitude-based extension uses squared absolute values:

zRMS=1n∑i=1n∣zi∣2.z_{\mathrm{RMS}} = \sqrt{\frac{1}{n}\sum_{i=1}^{n}|z_i|^2}.

Using zi2z_i^2 instead would generally produce a complex quantity and would not measure magnitude in the same way.

Mathematical properties

Bounds and scaling

For real data,

∣1n∑i=1nxi∣≤1n∑i=1n∣xi∣≤xRMS≤max⁡i∣xi∣.\left|\frac{1}{n}\sum_{i=1}^{n}x_i\right| \leq \frac{1}{n}\sum_{i=1}^{n}|x_i| \leq x_{\mathrm{RMS}} \leq \max_i |x_i|.

The middle inequality follows from the Cauchy–Schwarz inequality. The mean absolute value equals RMS precisely when all absolute values are equal. The absolute arithmetic mean equals RMS precisely when all values themselves are equal.

Multiplication by a scalar cc gives

RMS⁡(cx)=∣c∣RMS⁡(x).\operatorname{RMS}(cx)=|c|\operatorname{RMS}(x).

RMS is always nonnegative and is zero exactly when every value is zero. For functions, zero RMS means the function vanishes almost everywhere on the averaging interval.

RMS is the power mean of order two. For nonnegative data, it is at least as large as the arithmetic mean, with equality only for constant data.

Geometric interpretation

For the vector x=(x1,…,xn)x=(x_1,\ldots,x_n), RMS is a scaled norm:

xRMS=∥x∥2n.x_{\mathrm{RMS}}=\frac{\|x\|_2}{\sqrt n}.

Thus it is the Euclidean distance from the vector to the origin, normalized by the square root of the number of coordinates.

For functions, RMS is similarly a normalized L2L^2 norm, connecting it with LpL^p spaces and inner products. On a fixed data set or averaging interval it satisfies the triangle inequality:

RMS⁡(x+y)≤RMS⁡(x)+RMS⁡(y).\operatorname{RMS}(x+y) \leq \operatorname{RMS}(x)+\operatorname{RMS}(y).

Relationship to mean, variance, and standard deviation

If XX has mean μ\mu and variance σ2\sigma^2, then

E[X2]=μ2+σ2,\mathbb{E}[X^2]=\mu^2+\sigma^2,

so

XRMS=μ2+σ2.X_{\mathrm{RMS}}=\sqrt{\mu^2+\sigma^2}.

RMS measures magnitude about zero; standard deviation measures spread about the mean. They coincide when the mean is zero.

For finite observations, let the sample mean be

xˉ=1n∑i=1nxi.\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i.

Then

xRMS2=xˉ 2+1n∑i=1n(xi−xˉ)2.x_{\mathrm{RMS}}^2 = \bar{x}^{\,2} + \frac{1}{n}\sum_{i=1}^{n}(x_i-\bar{x})^2.

If the sample variance uses Bessel’s correction,

s2=1n−1∑i=1n(xi−xˉ)2,s^2=\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})^2,

the identity becomes, for n>1n>1,

xRMS2=xˉ 2+n−1ns2.x_{\mathrm{RMS}}^2 = \bar{x}^{\,2}+\frac{n-1}{n}s^2.

The denominator therefore matters when comparing RMS with a reported sample standard deviation.

Electrical and signal applications

Effective voltage and current

RMS has a direct physical interpretation for a fixed ideal resistor of resistance RR. If the current is i(t)i(t), instantaneous power is

p(t)=Ri(t)2,p(t)=Ri(t)^2,

and average power over the same interval is

Pavg=RIRMS2.P_{\mathrm{avg}}=R I_{\mathrm{RMS}}^2.

An alternating current therefore has the same RMS value as the constant direct current that would produce the same average heating in that resistor. Likewise,

Pavg=VRMS2R.P_{\mathrm{avg}}=\frac{V_{\mathrm{RMS}}^2}{R}.

For a sinusoidal voltage

v(t)=Asin⁡(ωt+ϕ),v(t)=A\sin(\omega t+\phi),

averaging over a full period gives

VRMS=∣A∣2.V_{\mathrm{RMS}}=\frac{|A|}{\sqrt{2}}.

This conversion from peak to RMS is waveform-specific. A symmetric square wave taking values ±A\pm A has RMS ∣A∣|A|, while a symmetric triangular wave with the same peak magnitude has RMS ∣A∣/3|A|/\sqrt{3}.

For a general electrical load, average power is

Pavg=⟨v(t)i(t)⟩,P_{\mathrm{avg}}=\langle v(t)i(t)\rangle,

where angle brackets denote averaging. It is not generally equal to VRMSIRMSV_{\mathrm{RMS}}I_{\mathrm{RMS}}: the relationship also depends on phase and waveform.

Constant and fluctuating components

Write a signal as

x(t)=m+a(t),⟨a(t)⟩=0,x(t)=m+a(t), \qquad \langle a(t)\rangle=0,

where mm is its mean over the averaging interval. Then

xRMS2=m2+aRMS2.x_{\mathrm{RMS}}^2=m^2+a_{\mathrm{RMS}}^2.

The constant component and zero-mean fluctuating component therefore combine through their squared RMS values. Instruments that remove the constant component report a different quantity from instruments that measure total RMS.

More generally,

RMS⁡(x+y)2=RMS⁡(x)2+RMS⁡(y)2+2⟨xy⟩.\operatorname{RMS}(x+y)^2 = \operatorname{RMS}(x)^2+ \operatorname{RMS}(y)^2+ 2\langle xy\rangle.

RMS components add in quadrature only when the cross term vanishes.

Frequency-domain interpretation

For a sufficiently regular periodic signal represented by a Fourier series,

x(t)=a0+∑k=1∞[akcos⁡(kω0t)+bksin⁡(kω0t)],x(t)=a_0+\sum_{k=1}^{\infty} \left[ a_k\cos(k\omega_0t)+b_k\sin(k\omega_0t) \right],

orthogonality of the harmonics gives

xRMS2=a02+12∑k=1∞(ak2+bk2).x_{\mathrm{RMS}}^2 = a_0^2+ \frac{1}{2}\sum_{k=1}^{\infty}(a_k^2+b_k^2).

This is a form of Parseval’s identity. It explains how the constant component, fundamental frequency, and higher harmonics contribute to total mean square.

Error measurement and model fitting

For predictions y^i\hat y_i and observations yiy_i, the root mean square error is the RMS of their differences:

RMSE⁡=1n∑i=1n(y^i−yi)2.\operatorname{RMSE} = \sqrt{ \frac{1}{n}\sum_{i=1}^{n}(\hat y_i-y_i)^2 }.

It is the square root of mean squared error and has the same units as the measured outcome. It is used in model evaluation, forecasting, and numerical approximation.

For a fixed set of observations, minimizing RMSE is equivalent to minimizing mean squared error or the sum of squared errors, because the square-root function is increasing. This connects RMS error to least-squares fitting.

RMSE is not automatically a residual standard deviation or a standard error. In fitted models, variance estimates may divide residual sums of squares by residual degrees of freedom rather than by the number of observations.

Interpretation and numerical computation

Squaring gives large magnitudes disproportionate influence. Consequently, RMS is sensitive to extreme observations and is not a robust measure of typical magnitude. It also discards sign and does not identify the distribution or waveform: very different data can have identical RMS values.

An RMS measurement depends on the averaging interval, sampling procedure, and frequency range included. Equally averaging irregularly spaced observations does not necessarily approximate a time average; appropriate duration weights or integration may be needed.

Direct computation can encounter overflow or underflow in floating-point arithmetic when values are squared. A scaled expression improves numerical stability. Let

m=max⁡i∣xi∣.m=\max_i|x_i|.

For m>0m>0,

xRMS=m1n∑i=1n(xim)2.x_{\mathrm{RMS}} = m\sqrt{\frac{1}{n}\sum_{i=1}^{n} \left(\frac{x_i}{m}\right)^2}.

If m=0m=0, the RMS is zero. The normalized squares are bounded by one, avoiding the overflow that can occur when large original values are squared directly.