Computed maximum marginal likelihood score for given penalty parameters using mgcv
.
mgcv_lambda(penalties, XXblocks,Y, model=NULL, printscore=TRUE, pairing=NULL, sigmasq = 1,
opt.sigma=ifelse(model=="linear",TRUE, FALSE))
Numeric vector.
List of nxn
matrices. Usually output of createXXblocks
.
Response vector: numeric, binary, factor or survival
.
Character. Any of c("linear", "logistic", "cox")
. Is inferred from
Y
when NULL
.
Boolean. Should the score be printed?
Numerical vector of length 3 or NULL
when pairs are absent. Represents the indices (in XXblocks
) of the two data blocks involved in pairing, plus the index of the paired block.
Default error variance.
Boolean. Should the error variance be optimized as well? Only relevant for model="linear"
.
Numeric, marginal likelihood score for given penalties
See gam
for details on how the marginal likelihood is computed.
Wood, S. N. (2011), Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models, J. Roy. Statist. Soc., B 73(1), 3-36.
CVscore
for cross-validation alternative. A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4