From: Oleg on
I've got stats.rmse=19.38 from stepwisefit and sqrt(stats.mse)=23.67 from regstats using the same y and the same columns in X. Can you tell me the reason of this and indicate which is right?
From: Tom Lane on
> I've got stats.rmse=19.38 from stepwisefit and sqrt(stats.mse)=23.67 from
> regstats using the same y and the same columns in X. Can you tell me the
> reason of this and indicate which is right?

I just tried this with the data from "load hald". The stepwisefit function
picks columns 1 and 4. If I feed them into regstats, I get results whose
difference is comparable to eps. Can you double-check or elaborate on what
you did?

>> load hald
>> [b,se,pval,in,st] = stepwisefit(ingredients,heat);
>> regstats(heat,ingredients(:,[1 4]))
Variables have been created in the current workspace.
>> st.rmse - sqrt(mse)
ans =
3.1086e-015

-- Tom


From: Oleg on
"Tom Lane" <tlane(a)mathworks.com> wrote in message <hs95ii$dk9$1(a)fred.mathworks.com>...

> I just tried this with the data from "load hald". The stepwisefit function
> picks columns 1 and 4. If I feed them into regstats, I get results whose
> difference is comparable to eps. Can you double-check or elaborate on what
> you did?
>
> >> load hald
> >> [b,se,pval,in,st] = stepwisefit(ingredients,heat);
> >> regstats(heat,ingredients(:,[1 4]))
> Variables have been created in the current workspace.
> >> st.rmse - sqrt(mse)
> ans =
> 3.1086e-015
>
> -- Tom
> Sorry for troubling, it was really my mistake. I supposed
[ans,ans,ans,ans,stepstat] = stepwisefit(traindata,trainact,'inmodel',27,'maxiter',2);
to result in a regression with two independent variables but it has three.
Thanks.