For the estimation of the SCAM smoothing parameters the GCV/UBRE score is optimized outer to the Newton-Raphson procedure of the model fitting. This function returns the value of the GCV/UBRE score and calculates its first derivative with respect to the log smoothing parameter using the method of Wood (2009).
The function is not normally called directly, but rather service routines for bfgs_gcv.ubre
.
gcv.ubre_grad(rho, G, gamma, env, check.analytical=FALSE, del, maxit, maxHalf.fit,
devtol.fit, steptol.fit)
log of the initial values of the smoothing parameters.
a list of items needed to fit a SCAM.
A constant multiplier to inflate the model degrees of freedom in the GCV or UBRE/AIC score.
Get the enviroment for the model coefficients, their derivatives and the smoothing parameter.
If this is TRUE
then finite difference derivatives of GCV/UBRE score will be calculated,
otherwise NULL
.
A positive scalar (default is 1e-4) giving an increment for finite difference approximation when
check.analytical=TRUE
, otherwise NULL
.
Maximum number of IRLS iterations to perform used in scam.fit
.
If a step of the Newton-Raphson optimization method leads
to a worse penalized deviance, then the step length of the model coefficients is halved. This is
the number of halvings to try before giving up used in scam.fit
.
A positive scalar giving the convergence control for the model fitting algorithm in scam.fit
.
A positive scalar giving the tolerance at which the scaled distance between
two successive iterates is considered close enough to zero to terminate the model fitting algorithm in scam.fit
.
A list is returned with the following items:
The value of GCV/UBRE gradient.
The GCV/UBRE score value.
The value of the scale estimate.
The elements of the fitting procedure monogam.fit
for a given value of the smoothing parameter.
If check.analytical=TRUE
this returns the finite-difference approximation of the gradient.
If check.analytical=TRUE
this returns the relative difference (in
and finite differenced derivatives.
Pya, N. and Wood, S.N. (2015) Shape constrained additive models. Statistics and Computing, 25(3), 543-559
Pya, N. (2010) Additive models with shape constraints. PhD thesis. University of Bath. Department of Mathematical Sciences
Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.
Wood, S.N. (2011) Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models. Journal of the Royal Statistical Society: Series B. 73(1): 1--34