addreg(x, y, lam, nback=20, tol=1e-05, start, cost=1)
x
| Matrix of independent variables |
y
| Vector of independent variables |
lam
| Vector of length P with values of the smoothing parameters. If missing then the parameters are found by generalized cross-validation. |
nback
| Maximum number of iterations for backfitting. |
tol
| Tolerance value for judging convergence of backfitting. |
start
| Matrix of starting values for the function estimates |
cost
| Cost for each degree of freedom in the GCV criterion. |
Here J_i = tr(A_i) -2 where A_i is the smoothing matrix for variable i.
If p=1 and cost =1 this is the usual GCV function. A cost > 1 has the effect of being more conservative in choosing estimates that deviate from a linear function. Note that the effective number of parameters in the total model can be approximated by sum( tr( A_i)).
# Additive model fit to the minitriathon data. A prediction of # run times based on the swim and bike performance. # The smoothing parameters found by GCV with cost=2. cbind( minitri$swim, minitri$bike)-> x addreg( x,minitri$run,cost=2)-> out plot( out) # summary plots of fits list( c(10,25), c(35,55))-> grid.list predict.surface(out, grid.list)-> out.p persp( out.p) # perspective plot of fitted surface