Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
RMS Error question

Subject: RMS Error question

From: Yannos M

Date: 25 Oct, 2012 09:42:08

Message: 1 of 5

Hi,

I have two vectors and I'd like to calculate the RMS error. Thus, I used the function

r=sqrt(sum((data(:)-estimate(:)).^2)/numel(data));

as found here:
http://www.mathworks.com/matlabcentral/fileexchange/21383-rmse

However, I get the RMS error to be greater than the MAX error! Is this possible?

THanks

Subject: RMS Error question

From: Torsten

Date: 25 Oct, 2012 10:31:08

Message: 2 of 5

"Yannos M" wrote in message <k6b1hg$fq1$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have two vectors and I'd like to calculate the RMS error. Thus, I used the function
>
> r=sqrt(sum((data(:)-estimate(:)).^2)/numel(data));
>
> as found here:
> http://www.mathworks.com/matlabcentral/fileexchange/21383-rmse
>
> However, I get the RMS error to be greater than the MAX error! Is this possible?
>
> THanks

No, that's not possible. It always holds that
RMS <= max(abs(data-estimate))

Best wishes
Torsten.

Subject: RMS Error question

From: Yannos M

Date: 29 Oct, 2012 20:04:08

Message: 3 of 5

I think it is possible the RMS error to be greater than the max error.

Eg.

X=[2 3 2 3]
Y=[4 4 4 4]

RMS=1.58
Max error=1


Consider that the RMS error is not normalised. Only if the RMS is normalised with the range (divided with Xmax-Xmin) the max error should be lower than the NRMS (normalised RMS).

http://en.wikipedia.org/wiki/Root-mean-square_deviation


Yannos





"Torsten" wrote in message <k6b4dc$of4$1@newscl01ah.mathworks.com>...
> "Yannos M" wrote in message <k6b1hg$fq1$1@newscl01ah.mathworks.com>...
> > Hi,
> >
> > I have two vectors and I'd like to calculate the RMS error. Thus, I used the function
> >
> > r=sqrt(sum((data(:)-estimate(:)).^2)/numel(data));
> >
> > as found here:
> > http://www.mathworks.com/matlabcentral/fileexchange/21383-rmse
> >
> > However, I get the RMS error to be greater than the MAX error! Is this possible?
> >
> > THanks
>
> No, that's not possible. It always holds that
> RMS <= max(abs(data-estimate))
>
> Best wishes
> Torsten.

Subject: RMS Error question

From: Roger Stafford

Date: 29 Oct, 2012 20:55:08

Message: 4 of 5

"Yannos M" wrote in message <k6mnfo$4di$1@newscl01ah.mathworks.com>...
> I think it is possible the RMS error to be greater than the max error.
>
> Eg.
>
> X=[2 3 2 3]
> Y=[4 4 4 4]
>
> RMS=1.58
> Max error=1
- - - - - - - - - -
  The "maximum error" between two quantities X and Y is always understood to be

 max(abs(X-Y))

and in your example that equals 2, not 1. The minimum error would be 1.

  What Torsten told you is quite true. The RMS error is never greater than the maximum error. In fact it is easy to show that the RMS error can be equal to the maximum error only if all absolute errors are equal. Otherwise it must be smaller.

Roger Stafford

Subject: RMS Error question

From: Yannos M

Date: 30 Oct, 2012 10:20:08

Message: 5 of 5

Rojer,

Yes, that's right. I messed the error with the relative error. With the term Max error I meant Max relative error.

Yannos

"Roger Stafford" wrote in message <k6mqfc$e47$1@newscl01ah.mathworks.com>...
> "Yannos M" wrote in message <k6mnfo$4di$1@newscl01ah.mathworks.com>...
> > I think it is possible the RMS error to be greater than the max error.
> >
> > Eg.
> >
> > X=[2 3 2 3]
> > Y=[4 4 4 4]
> >
> > RMS=1.58
> > Max error=1
> - - - - - - - - - -
> The "maximum error" between two quantities X and Y is always understood to be
>
> max(abs(X-Y))
>
> and in your example that equals 2, not 1. The minimum error would be 1.
>
> What Torsten told you is quite true. The RMS error is never greater than the maximum error. In fact it is easy to show that the RMS error can be equal to the maximum error only if all absolute errors are equal. Otherwise it must be smaller.
>
> Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us