gesso.fit {gesso} | R Documentation |
gesso fit
Description
Fits gesso model over the two dimentional grid of hyperparmeters lambda_1
and lambda_2
, returns estimated coefficients for each pair of hyperparameters.
Usage
gesso.fit(G, E, Y, C = NULL, normalize = TRUE, normalize_response = FALSE,
grid = NULL, grid_size = 20, grid_min_ratio = NULL,
alpha = NULL, family = "gaussian", weights = NULL,
tolerance = 1e-3, max_iterations = 5000,
min_working_set_size = 100,
verbose = FALSE)
Arguments
G |
matrix of main effects of size |
E |
vector of environmental measurments |
Y |
outcome vector. Set |
C |
matrix of confounders of size |
normalize |
|
normalize_response |
|
grid |
grid sequence for tuning hyperparameters, we use the same grid for |
grid_size |
specify |
grid_min_ratio |
parameter to determine |
alpha |
if |
family |
|
tolerance |
tolerance for the dual gap convergence criterion |
max_iterations |
maximum number of iterations |
min_working_set_size |
minimum size of the working set |
weights |
inner fitting parameter |
verbose |
|
Value
A list of estimated coefficients and other model fit metrics for each pair of hyperparameters (lambda_1
, lambda_2
)
beta_0 |
vector of estimated intercept values of size |
beta_e |
vector of estimated environment coefficients of size |
beta_g |
matrix of estimated main effects coefficients organized by rows, size ( |
beta_gxe |
matrix of estimated interactions coefficients organized by rows, size ( |
beta_c |
matrix of estimated confounders coefficients organized by rows, size ( |
num_iterations |
number of iterations until convergence for each fit |
working_set_size |
maximum number of variables in the working set for each fit |
has_converged |
1 if the model converged within given |
objective_value |
objective function (loss) value for each fit |
beta_g_nonzero |
number of estimated non-zero main effects for each fit |
beta_gxe_nonzero |
number of estimated non-zero interactions for each fit |
lambda_1 |
|
lambda_2 |
|
grid |
vector of values used for hyperparameters tuning |
Examples
data = data.gen()
fit = gesso.fit(G=data$G_train, E=data$E_train, Y=data$Y_train, normalize=TRUE)
plot(fit$beta_g_nonzero, pch=19, cex=0.4,
ylab="num of non-zero features", xlab="lambdas path")
points(fit$beta_gxe_nonzero, pch=19, cex=0.4, col="red")