learning ridge regression

#1
Please help in understanding the differnce in ridge expression and why I get the different results using 0.02


gridge1<-lm.ridge(divorce~.,data=divusa,lambda=0.02)
gridge
year unemployed femlab marriage birth military
-0.0315 -0.1182 0.4317 0.1094 -0.1279 -0.02719


and this expression: round(coef(gridge)[2,-1],3)
year unemployed femlab marriage birth military
-0.195 -0.053 0.790 0.148 -0.118 -0.042
 

Dason

Ambassador to the humans
#2
Well you didn't tell us how you fit gridge and I'm not sure if you meant for that first output to be gridge or gridge1. Also please wrap your code in [noparse]
Code:
[/noparse] tags so that indentation is preserved. But mainly if you're going to ask a question like this you need to provide all the relevant details. In this case that means we need to know how you fit the first model.

But it sounds like you need to read up on ridge regression a little more because one shouldn't expect the exact same results if you use a different value for lambda.
 
#3
I started with the model as:
gridge<-lm.ridge(divorce ~., data=divusa, lambda=seq(0,35,0.02))
then found the min$gcv and used in equation:
0.02
2
round(coef(gridge)[2,-1],3)
year unemployed femlab marriage birth military
-0.195 -0.053 0.790 0.148 -0.118 -0.042

so doing a ridge regression using the expression I have named-gridge1 is not the same as the gridge above?