看了下larfuncs.R
R的确只给出beta
没给出 the optimal parameters.
底下是R给出的Standardized Coefficients
library(lars)
data(diabetes)
attach(diabetes)
object <- lars(x,y,type="lar")
object$beta
> object$beta
age sex bmi map tc
0 0.00000 0.00000 0.00000 0.00000 0.0000
1 0.00000 0.00000 60.11927 0.00000 0.0000
2 0.00000 0.00000 361.89461 0.00000 0.0000
3 0.00000 0.00000 434.75796 79.23645 0.0000
4 0.00000 0.00000 505.65956 191.26988 0.0000
5 0.00000 -74.91651 511.34807 234.15462 0.0000
6 0.00000 -111.97855 512.04409 252.52702 0.0000
7 0.00000 -197.75650 522.26485 297.15974 -103.9462
8 0.00000 -226.13366 526.88547 314.38927 -195.1058
9 0.00000 -227.17580 526.39059 314.95047 -237.3410
10 -10.01220 -239.81909 519.83979 324.39043 -792.1842
ldl hdl tch ltg glu
0 0.00000 0.0000 0.0000 0.0000 0.00000
1 0.00000 0.0000 0.0000 0.0000 0.00000
2 0.00000 0.0000 0.0000 301.7753 0.00000
3 0.00000 0.0000 0.0000 374.9158 0.00000
4 0.00000 -114.1010 0.0000 439.6649 0.00000
5 0.00000 -169.7114 0.0000 450.6674 0.00000
6 0.00000 -196.0454 0.0000 452.3927 12.07815
7 0.00000 -223.9260 0.0000 514.7495 54.76768
8 0.00000 -152.4773 106.3428 529.9160 64.48742
9 33.62827 -134.5994 111.3841 545.4826 64.60667
10 476.74584 101.0446 177.0642 751.2793 67.62539
attr(,"scaled:scale")
[1] 1 1 1 1 1 1 1 1 1 1
而在matlab有个function crossvalidate.m
可以先决定the optimal model position,
再给出the optimal parameters.
0 0 387.848704760852 28.2242051247325 0
0 0 0 327.828155470971 0
|