Ridge regression in matlab -
i have doubt ridge regression in matlab. have mentioned @ http://www.mathworks.com/help/stats/ridge.html, ridge regression mean centers , make std equal 1 predictors. however, see doesn't. e.g.
let x be
1 1 2 1 3 5 1 9 12 1 12 50 let y be
1 2 3 4 it doesn't normalization of xs 0 mean , unit variance. clarifications what's going on? mean ridge should normalization of data i.e x 0 mean , unit variance , calculate coefficients. expecting ridge(y,x,0,0) give me result of r=inv(x'*x)*x'y r takes x , y normalized
the output must same, ridge regression makes calculation more stable numerically (less sensitive multicollinearity).
== update ==
now understand better ask :) documentation says:
b = ridge(y,x,k,scaled) uses {0,1}-valued flag scaled determine if coefficient estimates in b restored scale of original data. ridge(y,x,k,0) performs additional transformation.
you've set both third , fourth parameters 0, means ridge parameter zero, , result won't scaled, should same inv(x'*x)*x'y (this ridge regression formula becomes if ridge parameter k set 0).
Comments
Post a Comment