Why can't the MSE of lasso() match the theoretical value?

2 Ansichten (letzte 30 Tage)
SC
SC am 10 Feb. 2019
Hi,
I have below MSE1 and MSE2, which I got 13.27 and 5.87. Why don't they match?
clear
%set seed
rng(123);
X=10*rand([30,5]);
y=10*rand([30,1]);
[B,fitinfo]=lasso(X,y,'lambda',0);
MSE1=norm(y-X*B-ones([30,1])*fitinfo.Intercept)
MSE2=fitinfo.MSE
Thanks!

Antworten (0)

Kategorien

Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by