SignalProcessing
RootMeanSquareError
calculate the root mean square error between two signals
RelativeRootMeanSquareError
calculate the relative root mean square error between two signals
Calling Sequence
Parameters
Description
Examples
Compatibility
RootMeanSquareError( X, Y )
RelativeRootMeanSquareError( X, Y )
X, Y
-
rtables or lists of real or complex data.
The RootMeanSquareError command takes two rtables or lists of 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:
RootMeanSquareError⁡X,Y=∑i=1n⁡Xi−Yi2n
The RelativeRootMeanSquareError command takes two rtables or lists of 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:
RelativeRootMeanSquareError⁡X,Y=∑i=1n⁡Xi−Yi2n∑i=1n⁡Yi2n
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.
with⁡SignalProcessing:
Example 1
X≔Vectorrow⁡1,2,3
X≔123
Y≔Vectorcolumn⁡4,5,6
Y≔456
RootMeanSquareError⁡X,Y
3.00000000000000044
Example 2
X≔1.1,1.9,3.1
X≔1.11.93.1
Y≔1,2,3
RelativeRootMeanSquareError⁡X,Y
0.0462910049886276140
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≔0.000030.00004
Q≔0.00001,0.00002
Q≔0.000010.00002
RootMeanSquareError⁡P,Q
0.0000199999999999999982
RelativeRootMeanSquareError⁡P,Q
1.26491106406735154
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≔503604
V≔500,600
V≔500600
RootMeanSquareError⁡U,V
3.53553390593273731
RelativeRootMeanSquareError⁡U,V
0.00640184399664479788
Example 5
Complex data is also supported:
A≔Vector⁡1,2−I,datatype=complex8
A≔1.+0.⁢I2.−I
B≔Vector⁡3,4+I,datatype=complex8
B≔3.+0.⁢I4.+I
RootMeanSquareError⁡A,B
2.44948974278317788
P≔Vector⁡5,6,datatype=float8
P≔5.6.
Q≔Vector⁡10−3⁢I,7,datatype=complex8
Q≔10.−3.⁢I7.+0.⁢I
0.470658036520967271
The SignalProcessing[RootMeanSquareError] and SignalProcessing[RelativeRootMeanSquareError] commands were introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
The SignalProcessing[RootMeanSquareError] and SignalProcessing[RelativeRootMeanSquareError] commands were updated in Maple 2022.
See Also
SignalProcessing[Norm]
SignalProcessing[RootMeanSquare]
Download Help Document