View source: R/MultiLambdaCVfun.R
optLambdas_mgcvWrap | R Documentation |
Sequentially optimizes a marginal likelihood score w.r.t. ridge penalties for multiple data blocks.
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))
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 |
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.
List, with components:
res |
Outputs of all optimizers used |
lambdas |
List of penalties found by the optimizers |
optpen |
Numerical vector with final, optimal penalties |
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.
optLambdas_mgcv
for one-pass optimization. A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.