> set.seed(987) > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=10)->out1 K (num. of folds)= 5 Num. of reps)= 10 Fraction from CV= 0.7272727 number nonzero= 16 mse= 48.36116 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x15 x17 x18 and a second call to show that the results don't change much. > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=10)->out2 K (num. of folds)= 5 Num. of reps)= 10 Fraction from CV= 0.7373737 number nonzero= 16 mse= 48.08779 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x15 x17 x18 However, the default lars call has rep=1. Here are 4 replications showing the variation. > set.seed(345) > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=1)->out3 K (num. of folds)= 5 Num. of reps)= 1 Fraction from CV= 0.5555556 number nonzero= 11 mse= 52.12135 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x9 x11 x15 x17 > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=1)->out4 K (num. of folds)= 5 Num. of reps)= 1 Fraction from CV= 0.7676768 number nonzero= 16 mse= 47.34128 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x15 x17 x18 > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=1)->out5 K (num. of folds)= 5 Num. of reps)= 1 Fraction from CV= 0.5050505 number nonzero= 11 mse= 55.45815 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x9 x11 x15 x17 > lasso.dr1(x=ncaa2[,1:19],y=ncaa2$y,rep=1)->out6 K (num. of folds)= 5 Num. of reps)= 1 Fraction from CV= 0.6060606 number nonzero= 14 mse= 51.41852 Variables Selected = x1 x2 x3 x4 x5 x6 x7 x9 x10 x11 x13 x15 x17 x18Here is an illustration of the effect of the modification to cv.lars.
Without modification on the wing data set:
> lasso.dr(x=wing[,1:37],y=wing$y,rep=10)->out K (num. of folds)= 5 Num. of reps)= 10 Fraction from CV= 0.6666667 number nonzero= 34 mse= 1.768729e-05 Variables Selected = x1 x2 x3 x4 x5 x7 x9 x10 x11 x12 x13 x14 x15 x16 x17 x23 x27 x30 x31 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x48With the modification:
> lasso.dr1(x=wing[,1:37],y=wing$y,rep=10)->out K (num. of folds)= 5 Num. of reps)= 10 Fraction from CV= 0.5050505 number nonzero= 26 mse= 2.004648e-05 Variables Selected = x1 x4 x5 x7 x10 x11 x12 x13 x14 x15 x16 x17 x23 x27 x30 x34 x35 x38 x40 x41 x42 x43 x44 x45 x46 x48