optLambdas_mgcvWrap {multiridge} | R Documentation |
Find optimal ridge penalties with sequential optimization.
Description
Sequentially optimizes a marginal likelihood score w.r.t. ridge penalties for multiple data blocks.
Usage
optLambdas_mgcvWrap(penaltiesinit=NULL, XXblocks,Y, pairing=NULL, model=NULL, reltol=1e-4,
optmethod1= "SANN", optmethod2 =ifelse(length(penaltiesinit)==1,"Brent", "Nelder-Mead"),
maxItropt1=10,maxItropt2=25,tracescore=TRUE,fixedseed =TRUE, pref=NULL, fixedpen=NULL,
sigmasq = 1, opt.sigma=ifelse(model=="linear",TRUE, FALSE))
Arguments
penaltiesinit |
Numeric vector. Initial values for penaltyparameters. May be obtained from |
XXblocks |
List of |
Y |
Response vector: numeric, binary, factor or |
pairing |
Numerical vector of length 3 or |
model |
Character. Any of |
reltol |
Scalar. Relative tolerance for optimization methods. |
optmethod1 |
Character. First, global search method. Any of the methods |
optmethod2 |
Character. Second, local search method. Any of the methods |
maxItropt1 |
Integer. Maximum number of iterations for |
maxItropt2 |
Integer. Maximum number of iterations for |
tracescore |
Boolean. Should the output of the scores be traced? |
fixedseed |
Boolean. Should the initialization be fixed? For reproducibility. |
pref |
Integer vector or |
fixedpen |
Integer vector or |
sigmasq |
Default error variance. |
opt.sigma |
Boolean. Should the error variance be optimized as well? Only relevant for |
Details
As opposed to optLambdas_mgcv
this function first searches globally, then locally.
Hence, more time-consuming, but better guarded against multiple local optima.
See gam
for details on how the marginal likelihood is computed.
Value
List, with components:
res |
Outputs of all optimizers used |
lambdas |
List of penalties found by the optimizers |
optpen |
Numerical vector with final, optimal penalties |
References
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.
See Also
optLambdas_mgcv
for one-pass optimization. A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4