MGLMtune {MGLM} | R Documentation |
Choose the tuning parameter value in sparse regression
Description
Finds the tuning parameter value that yields the smallest BIC.
Usage
MGLMtune(
formula,
data,
dist,
penalty,
lambdas,
ngridpt,
warm.start = TRUE,
keep.path = FALSE,
display = FALSE,
init,
weight,
penidx,
ridgedelta,
maxiters = 150,
epsilon = 1e-05,
regBeta = FALSE,
overdisp
)
Arguments
formula |
an object of class |
data |
an optional data frame, list or environment (or object coercible by |
dist |
a description of the distribution to fit. See |
penalty |
penalty type for the regularization term. Can be chosen from |
lambdas |
an optional vector of the penalty values to tune. If missing, the vector of penalty values will be set inside the function. |
ngridpt |
an optional numeric variable specifying the number of grid points to tune. If |
warm.start |
an optional logical variable to specify whether to give warm start at each tuning grid point. If |
keep.path |
an optional logical variable controling whether to output the whole solution path. The default is |
display |
an optional logical variable to specify whether to show each tuning step. |
init |
an optional matrix of initial value of the parameter estimates. Should have the compatible dimension with the data. See |
weight |
an optional vector of weights assigned to each row of the data. Should be |
penidx |
a logical vector indicating the variables to be penalized. The default value is |
ridgedelta |
an optional numeric controlling the behavior of the Nesterov's accelerated proximal gradient method. The default value is |
maxiters |
an optional numeric controlling the maximum number of iterations. The default value is |
epsilon |
an optional numeric controlling the stopping criterion. The algorithm terminates when the relative change in the objective values of two successive iterates is less then |
regBeta |
an optional logical variable used when running negative multinomial regression ( |
overdisp |
an optional numerical variable used only when fitting sparse negative multinomial model and |
Value
select
the final sparse regression result, using the optimal tuning parameter.path
a data frame with degrees of freedom and BICs at each lambda.
Author(s)
Yiwen Zhang and Hua Zhou
See Also
Examples
set.seed(118)
n <- 50
p <- 10
d <- 5
m <- rbinom(n, 100, 0.8)
X <- matrix(rnorm(n * p), n, p)
alpha <- matrix(0, p, d)
alpha[c(1, 3, 5), ] <- 1
Alpha <- exp(X %*% alpha)
Y <- rdirmn(size=m, alpha=Alpha)
sweep <- MGLMtune(Y ~ 0 + X, dist="DM", penalty="sweep", ngridpt=10)
show(sweep)