glmsmurf-class {smurf}R Documentation

Class of Multi-Type Regularized GLMs Fitted Using the SMuRF Algorithm

Description

The functions glmsmurf and glmsmurf.fit return objects of the S3 class 'glmsmurf' which partially inherits from the 'glm' and 'lm' classes.

Value

An object of class 'glmsmurf' is a list with at least following components:

coefficients

Coefficients of the estimated model.

residuals

Working residuals of the estimated model, see glm: ((y_1-\mu_1)/(d\mu/d\eta(\eta_1)), \ldots, (y_n-\mu_n)/(d\mu/d\eta(\eta_n))).

fitted.values

Fitted mean values of the estimated model (\mu_1, \ldots, \mu_n)=(g^{-1}(\eta_1), \ldots, g^{-1}(\eta_n)) with g^{-1} the inverse link function.

rank

Numeric rank of the estimated model, i.e. the number of unique non-zero coefficients.

family

The used family object.

linear.predictors

Linear fit of the estimated model on the link scale (\eta_1, \ldots, \eta_n).

deviance

Deviance of the estimated model: minus twice the log-likelihood, up to a constant.

aic

Akaike Information Criterion of the estimated model: -2\times L + 2\times rank with L the log-likelihood.

bic

Bayesian Information Criterion of the estimated model: -2\times L + \ln(n^*)\times rank with n^* the number of observations excluding those with weight 0.

gcv

Generalized Cross-Validation score of the estimated model: deviance / (n^* \times (1 - rank / n^*)^2).

null.deviance

Deviance of the null model, i.e. the model with only an intercept and offset.

df.residual

Residual degrees of freedom of the estimated model, i.e. the number of observations (excluding those with weight 0) minus the rank of the estimated model.

df.null

Residual degrees of freedom for the null model, i.e. the number of observations (excluding those with weight 0) minus the rank of the null model.

obj.fun

Value of the objective function of the estimated model: minus the regularized scaled log-likelihood of the estimated model.

weights

The prior weights that were initially supplied. Note that they are called prior.weights in the output of glm.

offset

The used offset vector.

lambda

The used penalty parameter: initially supplied by the user, or selected in-sample, out-of-sample or using cross-validation.

lambda1

The used penalty parameter for the L_1-penalty in Sparse (Generalized) Fused Lasso or Sparse Graph-Guided Fused Lasso is \lambda \times \lambda_1

lambda2

The used penalty parameter for the L_2-penalty in Group (Generalized) Fused Lasso or Group Graph-Guided Fused Lasso is \lambda \times \lambda_2.

iter

The number of iterations that are performed to fit the model.

converged

An integer code indicating whether the algorithm converged successfully:

0

Successful convergence.

1

Maximum number of iterations reached.

2

Two subsequent restarts were performed.

3

Low step size (i.e. below 1e-14).

final.stepsize

Final step size used in the algorithm.

n.par.cov

List with number of parameters to estimate per predictor (covariate).

pen.cov

List with penalty type per predictor (covariate).

group.cov

List with group of each predictor (covariate) for Group Lasso where 0 means no group.

refcat.cov

List with number of the reference category in the original order of the levels of each predictor (covariate) where 0 indicates no reference category.

control

The used control list, see glmsmurf.control.

Optionally, following elements are also included:

X

The model matrix, only returned when the argument x.return in glmsmurf or glmsmurf.fit is TRUE.

y

The response vector, only returned when the argument y.return in glmsmurf or glmsmurf.fit is TRUE.

pen.weights

List with the vector of penalty weights per predictor (covariate), only returned when the argument pen.weights.return in glmsmurf or glmsmurf.fit is TRUE.

When the model is re-estimated, i.e. reest = TRUE in glmsmurf.control, the following components are also present:

glm.reest

Output from the call to glm to fit the re-estimated model.

coefficients.reest

Coefficients of the re-estimated model.

residuals.reest

Working residuals of the re-estimated model.

fitted.values.reest

Fitted mean values of the re-estimated model.

rank.reest

Numeric rank of the re-estimated model, i.e. the number of unique non-zero re-estimated coefficients.

linear.predictors.reest

Linear fit of the re-estimated model on the link scale.

deviance.reest

Deviance of the re-estimated model.

aic.reest

AIC of the re-estimated model.

bic.reest

BIC of the re-estimated model.

gcv.reest

GCV score of the re-estimated model.

df.residual.reest

Residual degrees of freedom of the re-estimated model.

obj.fun.reest

Value of the objective function of the re-estimated model: minus the regularized scaled log-likelihood of the re-estimated model.

X.reest

The model matrix used in the re-estimation, only returned when the argument x.return in glmsmurf or glmsmurf.fit is TRUE.

When lambda is not given as input but selected in-sample, out-of-sample or using cross-validation, i.e. the lambda argument in glmsmurf or glmsmurf.fit is a string describing the selection method, the following components are also present:

lambda.method

Method (in-sample, out-of-sample or cross-validation (possibly with the one standard error rule)) and measure (AIC, BIC, GCV score, deviance, MSE or DSS) used to select lambda. E.g. "is.bic" indicates in-sample selection of lambda with the BIC as measure.

lambda.vector

Vector of lambda values that were considered in the selection process.

lambda.measures

List with for each of the relevant measures a matrix containing for each considered value of lambda (rows) the measure for the whole data (in-sample), for the validation data (out-of-sample) or per cross-validation fold (cross-validation) (columns).

lambda.coefficients

Matrix containing for each considered value of lambda (rows) the estimated (when lambda.reest = FALSE in glmsmurf.control) or re-estimated (when lambda.reest = TRUE) coefficients when selecting lambda in-sample or out-of-sample (or using cross-validation with one fold); and NULL otherwise.

When the object is output from glmsmurf, following elements are also included:

call

The matched call.

formula

The supplied formula.

terms

The terms object used.

contrasts

The contrasts used (when relevant).

xlevels

The levels of the factors used in fitting (when relevant).

S3 generics

Following S3 generic functions are available for an object of class "glmsmurf":

coef

Extract coefficients of the estimated model.

coef_reest

Extract coefficients of the re-estimated model, when available.

deviance

Extract deviance of the estimated model.

deviance_reest

Extract deviance of the re-estimated model, when available.

family

Extract family object.

fitted

Extract fitted values of the estimated model.

fitted_reest

Extract fitted values of the re-estimated model, when available.

plot

Plot coefficients of the estimated model.

plot_reest

Plot coefficients of the re-estimated model, when available.

plot_lambda

Plot goodness-of-fit statistics or information criteria as a function of lambda, when lambda is selected in-sample, out-of-sample or using cross-validation.

predict

Obtain predictions using the estimated model.

predict_reest

Obtain predictions using the re-estimated model, when available.

residuals

Extract residuals of the estimated model.

residuals_reest

Extract residuals of the re-estimated model, when available.

summary

Print a summary of the estimated model, and of the re-estimated model (when available).

See Also

glmsmurf, glm, lm

Examples

## See example(glmsmurf) for examples


[Package smurf version 1.1.5 Index]