RelativeRootMeanSquareError - Maple Help

SignalProcessing

 RootMeanSquareError
 calculate the root mean square error between two signals
 RelativeRootMeanSquareError
 calculate the relative root mean square error between two signals

 Calling Sequence RootMeanSquareError( X, Y ) RelativeRootMeanSquareError( X, Y )

Parameters

 X, Y - rtables or lists of numeric data.

Description

 • The RootMeanSquareError command takes two rtables or lists of numeric data with compatible dimensions, and returns the Root Mean Square Error (RMSE), which is the Root Mean Square (RMS) of the difference of $X$ and $Y$. When $X$ and $Y$ are Vectors with $n$ elements:

$\mathrm{RootMeanSquareError}\left(X,Y\right)=\sqrt{\frac{{\sum }_{i=1}^{n}{\left|{X}_{i}-{Y}_{i}\right|}^{2}}{n}}$

 • The RelativeRootMeanSquareError command takes two rtables or lists of numeric data with compatible dimensions, and returns the Relative Root Mean Square Error (RRMSE), which is the Root Mean Square (RMS) of the difference of $X$ and $Y$, divided by the RMS of $Y$. When $X$ and $Y$ are Vectors with $n$ elements:

$\mathrm{RelativeRootMeanSquareError}\left(X,Y\right)=\mathrm{Typesetting}:-\mathrm{_Hold}\left(\left[\mathrm{%/}\left(\mathrm{sqrt}\left(\frac{\mathrm{Sum}\left({\mathrm{abs}\left({X}_{i}-{Y}_{i}\right)}^{2},i=1..n\right)}{n}\right),\mathrm{sqrt}\left(\frac{\mathrm{Sum}\left({\mathrm{abs}\left({Y}_{i}\right)}^{2},i=1..n\right)}{n}\right)\right)\right]\right)$

 • The advantage of using RRMSE over RMSE to quantify error is that the error is relative to the comparison container, which prevents relatively small errors from appearing large, and relatively large errors from appearing small.
 • The inputs are converted to Arrays of float[8] or complex[8] datatype, and an error will be thrown if this is not possible. For this reason, it is most efficient for the inputs to already be rtables having the appropriate datatypes.
 • The RelativeRootMeanSquareError and RootMeanSquareError commands are not thread safe.
 • As the underlying implementation of the SignalProcessing package is a module, it is also possible to use the forms SignalProcessing:-RootMeanSquareError and SignalProcessing:-RelativeRootMeanSquareError to access the commands from the package. For more information, see Module Members.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$

Example 1

 > $X≔\mathrm{Vector}\left[\mathrm{row}\right]\left(\left[1,2,3\right]\right)$
 ${X}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\end{array}\right]$ (1)
 > $Y≔\mathrm{Vector}\left[\mathrm{column}\right]\left(\left[4,5,6\right]\right)$
 ${Y}{≔}\left[\begin{array}{c}{4}\\ {5}\\ {6}\end{array}\right]$ (2)
 > $\mathrm{RootMeanSquareError}\left(X,Y\right)$
 ${3.00000000000000044}$ (3)

Example 2

 > $X≔⟨1.1,1.9,3.1⟩$
 ${X}{≔}\left[\begin{array}{c}{1.1}\\ {1.9}\\ {3.1}\end{array}\right]$ (4)
 > $Y≔\left[1,2,3\right]$
 ${Y}{≔}\left[{1}{,}{2}{,}{3}\right]$ (5)
 > $\mathrm{RelativeRootMeanSquareError}\left(X,Y\right)$
 ${0.0462910049886276140}$ (6)

Example 3

 • In this example, the RMSE suggests two Vectors are very close (in the absolute sense), but the RRMSE shows that to not be the case (in the relative sense):
 > $P≔⟨0.00003,0.00004⟩$
 ${P}{≔}\left[\begin{array}{c}{0.00003}\\ {0.00004}\end{array}\right]$ (7)
 > $Q≔⟨0.00001,0.00002⟩$
 ${Q}{≔}\left[\begin{array}{c}{0.00001}\\ {0.00002}\end{array}\right]$ (8)
 > $\mathrm{RootMeanSquareError}\left(P,Q\right)$
 ${0.0000199999999999999982}$ (9)
 > $\mathrm{RelativeRootMeanSquareError}\left(P,Q\right)$
 ${1.26491106406735154}$ (10)

Example 4

 • Here, the RMSE suggests two Vectors are not very close (in the absolute sense), but the RRMSE shows the Vectors are in fact pretty close (in the relative sense):
 > $U≔⟨503,604⟩$
 ${U}{≔}\left[\begin{array}{c}{503}\\ {604}\end{array}\right]$ (11)
 > $V≔⟨500,600⟩$
 ${V}{≔}\left[\begin{array}{c}{500}\\ {600}\end{array}\right]$ (12)
 > $\mathrm{RootMeanSquareError}\left(U,V\right)$
 ${3.53553390593273731}$ (13)
 > $\mathrm{RelativeRootMeanSquareError}\left(U,V\right)$
 ${0.00640184399664479788}$ (14)

Compatibility

 • The SignalProcessing[RootMeanSquareError] and SignalProcessing[RelativeRootMeanSquareError] commands were introduced in Maple 2021.