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:
mse(Mean Squared Error) inn regstats

Subject: mse(Mean Squared Error) inn regstats

From: Mike

Date: 28 Jul, 2012 03:42:25

Message: 1 of 3

Hi

I am confusing with mse(Mean Squared Error) from regstats
 y=[3 2 8 5 7 6];X=[2 3 8 6 5 4];mse=mean((X-y).^2)

mse =

    1.8333

>> stats = regstats(y,X,'linear',{'beta','covb','mse','yhat','r','rsquare','adjrsquare','tstat'});
stats.mse

ans =

    2.2786

Does anybody know what's the difference?

Mike

Subject: mse(Mean Squared Error) inn regstats

From: Bruno Luong

Date: 28 Jul, 2012 06:52:15

Message: 2 of 3

Mike <SulfateIon@gmail.com> wrote in message <0a8f6fe0-0b2d-4779-bf7d-dbe6a91696c7@googlegroups.com>...
> Hi
>
> I am confusing with mse(Mean Squared Error) from regstats
> y=[3 2 8 5 7 6];X=[2 3 8 6 5 4];mse=mean((X-y).^2)
>
> mse =
>
> 1.8333
>
> >> stats = regstats(y,X,'linear',{'beta','covb','mse','yhat','r','rsquare','adjrsquare','tstat'});
> stats.mse
>
> ans =
>
> 2.2786
>
> Does anybody know what's the difference?

I don't know anything about regstats, but the reason seems too obvious: you do not perform any regression in your mse calculation.

Bruno

Subject: mse(Mean Squared Error) inn regstats

From: Star Strider

Date: 28 Jul, 2012 18:35:17

Message: 3 of 3


Following up on Bruno's observation, a more meaningful comparison would be:

MSE = mean((mean(y)-y).^2)

MSE =

     4.4722e+000

Tags for this Thread

No tags are associated with 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