麻烦啊请问各位,用R做投影寻踪回归时,nterms和max.terms的选取应该以什么为准则呀。就像下面的例子,若把两者的值设得足够大,那么回归后的预测值几乎与实测值一模一样,但我认为这是没必要的。故此请问应该以什么作为选取的原则,或者说该以什么来判断投影寻踪回归模型的好坏?
> www<-read.csv("c://aaa.csv")
> www
y x1 x2 x3 x4 x5
1 1.5163 0.5275 11.5823 0.2637 1.879 0.896
2 2.2657 0.6367 11.7171 0.2763 2.287 1.070
3 3.8245 0.8026 11.8517 0.2814 2.939 1.331
4 5.9230 0.9589 11.9850 0.2862 3.923 1.746
5 8.7551 1.1334 12.1121 0.2904 4.854 2.236
6 12.0875 1.3329 12.2389 0.2937 5.576 2.641
7 12.6895 1.4434 12.3626 0.2992 6.053 2.834
8 22.6494 1.6628 12.4810 0.3040 6.307 2.972
9 31.3238 1.9844 12.5909 0.3089 6.534 3.143
> fit<-ppr(y~.,data=www,nterms=2,max.terms=5)
> fit
Call:
ppr(formula = y ~ ., data = www, nterms = 2, max.terms = 5)
Goodness of fit:
2 terms 3 terms 4 terms 5 terms
1.016327372 0.094314820 0.007168716 0.005324683
> summary(fit)
Call:
ppr(formula = y ~ ., data = www, nterms = 2, max.terms = 5)
Goodness of fit:
2 terms 3 terms 4 terms 5 terms
1.016327372 0.094314820 0.007168716 0.005324683
Projection direction vectors:
term 1 term 2
x1 0.44129985 -0.04529446
x2 -0.17997474 0.16117719
x3 0.87726841 -0.98494957
x4 -0.04764312 -0.02737804
x5 0.03152464 0.03309235
Coefficients of ridge terms:
term 1 term 2
9.2721055 0.8856545


雷达卡





京公网安备 11010802022788号







