{
  "id": "root-mean-square",
  "title": "Root Mean Square",
  "lang": "en",
  "source_lang": "en",
  "summary": "The root mean square is the square root of the average squared magnitude of a set of values, a function, or a random variable.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "RMS",
    "Quadratic mean",
    "Square mean"
  ],
  "generated_at": "2026-11-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/root-mean-square/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/root-mean-square/",
      "json": "https://aiwiki.page/zh/root-mean-square.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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."
    },
    {
      "heading": "Definitions",
      "text": "Finite sets of values\n\nFor \\(n\\) real numbers \\(x_1,\\ldots,x_n\\), with \\(n\\geq 1\\), the root mean square is\n\n\\[x_{\\mathrm{RMS}} = \\sqrt{\\frac{1}{n}\\sum_{i=1}^{n}x_i^2}.\\]\n\nFor example, the values \\(-3\\) and \\(3\\) have arithmetic mean zero but RMS value\n\n\\[\\sqrt{\\frac{(-3)^2+3^2}{2}}=3.\\]\n\nRMS therefore measures magnitude relative to zero, rather than the signed balance of the values.\n\nFor nonnegative weights \\(w_i\\), not all zero, the weighted RMS is\n\n\\[x_{\\mathrm{RMS},w} = \\sqrt{ \\frac{\\sum_{i=1}^{n}w_i x_i^2} {\\sum_{i=1}^{n}w_i} }.\\]\n\nEqual weights recover the ordinary definition. Weights can represent probabilities, frequencies, or durations associated with individual observations.\n\nFunctions and time-dependent signals\n\nFor a real-valued function \\(f(t)\\) whose square is integrable over a finite interval \\([a,b]\\), where \\(b>a\\),\n\n\\[f_{\\mathrm{RMS}} = \\sqrt{\\frac{1}{b-a}\\int_a^b f(t)^2\\,dt}.\\]\n\nThe integral replaces the sum, while division by \\(b-a\\) converts the accumulated squared magnitude into an average.\n\nFor a periodic signal with period \\(T>0\\), RMS is normally evaluated over one complete period:\n\n\\[f_{\\mathrm{RMS}} = \\sqrt{ \\frac{1}{T}\\int_{t_0}^{t_0+T}f(t)^2\\,dt }.\\]\n\nThis value is independent of the starting time \\(t_0\\), provided the signal is periodic and its square is integrable over a period.\n\nFor a nonperiodic signal, a long-time RMS may be defined by\n\n\\[f_{\\mathrm{RMS}} = \\lim_{T\\to\\infty} \\sqrt{\\frac{1}{T}\\int_0^T f(t)^2\\,dt},\\]\n\nwhen 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.\n\nRandom variables\n\nFor a real random variable \\(X\\), the probabilistic definition is\n\n\\[X_{\\mathrm{RMS}}=\\sqrt{\\mathbb{E}[X^2]},\\]\n\nwhere \\(\\mathbb{E}\\) denotes expected value. A finite RMS requires a finite second moment.\n\nFor a variable with probability density function \\(p(x)\\),\n\n\\[X_{\\mathrm{RMS}} = \\sqrt{ \\int_{-\\infty}^{\\infty}x^2p(x)\\,dx }.\\]\n\nA 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.\n\nComplex values\n\nFor complex numbers, the standard magnitude-based extension uses squared absolute values:\n\n\\[z_{\\mathrm{RMS}} = \\sqrt{\\frac{1}{n}\\sum_{i=1}^{n}|z_i|^2}.\\]\n\nUsing \\(z_i^2\\) instead would generally produce a complex quantity and would not measure magnitude in the same way."
    },
    {
      "heading": "Mathematical properties",
      "text": "Bounds and scaling\n\nFor real data,\n\n\\[\\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|.\\]\n\nThe 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.\n\nMultiplication by a scalar \\(c\\) gives\n\n\\[\\operatorname{RMS}(cx)=|c|\\operatorname{RMS}(x).\\]\n\nRMS 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.\n\nRMS 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.\n\nGeometric interpretation\n\nFor the vector \\(x=(x_1,\\ldots,x_n)\\), RMS is a scaled norm:\n\n\\[x_{\\mathrm{RMS}}=\\frac{\\|x\\|_2}{\\sqrt n}.\\]\n\nThus it is the Euclidean distance from the vector to the origin, normalized by the square root of the number of coordinates.\n\nFor functions, RMS is similarly a normalized \\(L^2\\) norm, connecting it with L^p spaces and inner products. On a fixed data set or averaging interval it satisfies the triangle inequality:\n\n\\[\\operatorname{RMS}(x+y) \\leq \\operatorname{RMS}(x)+\\operatorname{RMS}(y).\\]"
    },
    {
      "heading": "Relationship to mean, variance, and standard deviation",
      "text": "If \\(X\\) has mean \\(\\mu\\) and variance \\(\\sigma^2\\), then\n\n\\[\\mathbb{E}[X^2]=\\mu^2+\\sigma^2,\\]\n\nso\n\n\\[X_{\\mathrm{RMS}}=\\sqrt{\\mu^2+\\sigma^2}.\\]\n\nRMS measures magnitude about zero; standard deviation measures spread about the mean. They coincide when the mean is zero.\n\nFor finite observations, let the sample mean be\n\n\\[\\bar{x}=\\frac{1}{n}\\sum_{i=1}^{n}x_i.\\]\n\nThen\n\n\\[x_{\\mathrm{RMS}}^2 = \\bar{x}^{\\,2} + \\frac{1}{n}\\sum_{i=1}^{n}(x_i-\\bar{x})^2.\\]\n\nIf the sample variance uses Bessel’s correction,\n\n\\[s^2=\\frac{1}{n-1}\\sum_{i=1}^{n}(x_i-\\bar{x})^2,\\]\n\nthe identity becomes, for \\(n>1\\),\n\n\\[x_{\\mathrm{RMS}}^2 = \\bar{x}^{\\,2}+\\frac{n-1}{n}s^2.\\]\n\nThe denominator therefore matters when comparing RMS with a reported sample standard deviation."
    },
    {
      "heading": "Electrical and signal applications",
      "text": "Effective voltage and current\n\nRMS has a direct physical interpretation for a fixed ideal resistor of resistance \\(R\\). If the current is \\(i(t)\\), instantaneous power is\n\n\\[p(t)=Ri(t)^2,\\]\n\nand average power over the same interval is\n\n\\[P_{\\mathrm{avg}}=R I_{\\mathrm{RMS}}^2.\\]\n\nAn alternating current therefore has the same RMS value as the constant direct current that would produce the same average heating in that resistor. Likewise,\n\n\\[P_{\\mathrm{avg}}=\\frac{V_{\\mathrm{RMS}}^2}{R}.\\]\n\nFor a sinusoidal voltage\n\n\\[v(t)=A\\sin(\\omega t+\\phi),\\]\n\naveraging over a full period gives\n\n\\[V_{\\mathrm{RMS}}=\\frac{|A|}{\\sqrt{2}}.\\]\n\nThis conversion from peak to RMS is waveform-specific. A symmetric square wave taking values \\(\\pm A\\) has RMS \\(|A|\\), while a symmetric triangular wave with the same peak magnitude has RMS \\(|A|/\\sqrt{3}\\).\n\nFor a general electrical load, average power is\n\n\\[P_{\\mathrm{avg}}=\\langle v(t)i(t)\\rangle,\\]\n\nwhere angle brackets denote averaging. It is not generally equal to \\(V_{\\mathrm{RMS}}I_{\\mathrm{RMS}}\\): the relationship also depends on phase and waveform.\n\nConstant and fluctuating components\n\nWrite a signal as\n\n\\[x(t)=m+a(t), \\qquad \\langle a(t)\\rangle=0,\\]\n\nwhere \\(m\\) is its mean over the averaging interval. Then\n\n\\[x_{\\mathrm{RMS}}^2=m^2+a_{\\mathrm{RMS}}^2.\\]\n\nThe 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.\n\nMore generally,\n\n\\[\\operatorname{RMS}(x+y)^2 = \\operatorname{RMS}(x)^2+ \\operatorname{RMS}(y)^2+ 2\\langle xy\\rangle.\\]\n\nRMS components add in quadrature only when the cross term vanishes.\n\nFrequency-domain interpretation\n\nFor a sufficiently regular periodic signal represented by a Fourier series,\n\n\\[x(t)=a_0+\\sum_{k=1}^{\\infty} \\left[ a_k\\cos(k\\omega_0t)+b_k\\sin(k\\omega_0t) \\right],\\]\n\northogonality of the harmonics gives\n\n\\[x_{\\mathrm{RMS}}^2 = a_0^2+ \\frac{1}{2}\\sum_{k=1}^{\\infty}(a_k^2+b_k^2).\\]\n\nThis is a form of Parseval’s identity. It explains how the constant component, fundamental frequency, and higher harmonics contribute to total mean square."
    },
    {
      "heading": "Error measurement and model fitting",
      "text": "For predictions \\(\\hat y_i\\) and observations \\(y_i\\), the root mean square error is the RMS of their differences:\n\n\\[\\operatorname{RMSE} = \\sqrt{ \\frac{1}{n}\\sum_{i=1}^{n}(\\hat y_i-y_i)^2 }.\\]\n\nIt 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.\n\nFor 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.\n\nRMSE 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."
    },
    {
      "heading": "Interpretation and numerical computation",
      "text": "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.\n\nAn 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.\n\nDirect computation can encounter overflow or underflow in floating-point arithmetic when values are squared. A scaled expression improves numerical stability. Let\n\n\\[m=\\max_i|x_i|.\\]\n\nFor \\(m>0\\),\n\n\\[x_{\\mathrm{RMS}} = m\\sqrt{\\frac{1}{n}\\sum_{i=1}^{n} \\left(\\frac{x_i}{m}\\right)^2}.\\]\n\nIf \\(m=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."
    }
  ],
  "links": [
    "statistics",
    "real-number",
    "mathematical-function",
    "integral",
    "random-variable",
    "expected-value",
    "probability-density-function",
    "complex-number",
    "cauchy-schwarz-inequality",
    "almost-everywhere",
    "norm-mathematics",
    "euclidean-distance",
    "lp-space",
    "inner-product",
    "triangle-inequality",
    "variance",
    "standard-deviation",
    "sample-mean",
    "bessels-correction",
    "fourier-series",
    "mean-squared-error",
    "least-squares",
    "floating-point-arithmetic",
    "numerical-stability"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}