The functions glmsmurf
and glmsmurf.fit
return objects of the S3 class 'glmsmurf
'
which partially inherits from the 'glm
' and 'lm
' classes.
An object of class 'glmsmurf
' is a list with at least following components:
Coefficients of the estimated model.
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 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.
Numeric rank of the estimated model, i.e. the number of unique non-zero coefficients.
The used family
object.
Linear fit of the estimated model on the link scale \((\eta_1, \ldots, \eta_n)\).
Deviance of the estimated model: minus twice the log-likelihood, up to a constant.
Akaike Information Criterion of the estimated model: \(-2\times L + 2\times rank\) with \(L\) the log-likelihood.
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.
Generalized Cross-Validation score of the estimated model: \(deviance / (n^* \times (1 - rank / n^*)^2).\)
Deviance of the null model, i.e. the model with only an intercept and offset.
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.
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.
Value of the objective function of the estimated model: minus the regularized scaled log-likelihood of the estimated model.
The prior weights that were initially supplied.
Note that they are called prior.weights
in the output of glm
.
The used offset vector.
The used penalty parameter: initially supplied by the user, or selected in-sample, out-of-sample or using cross-validation.
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\)
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\).
The number of iterations that are performed to fit the model.
An integer code indicating whether the algorithm converged successfully:
Successful convergence.
Maximum number of iterations reached.
Two subsequent restarts were performed.
Low step size (i.e. below 1e-14).
Final step size used in the algorithm.
List with number of parameters to estimate per predictor (covariate).
List with penalty type per predictor (covariate).
List with group of each predictor (covariate) for Group Lasso where 0 means no group.
List with number of the reference category in the original order of the levels of each predictor (covariate) where 0 indicates no reference category.
The used control list, see glmsmurf.control
.
The model matrix, only returned when the argument x.return
in glmsmurf
or glmsmurf.fit
is TRUE
.
The response vector, only returned when the argument y.return
in glmsmurf
or glmsmurf.fit
is TRUE
.
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
.
Output from the call to speedglm
or glm
to fit the re-estimated model.
Coefficients of the re-estimated model.
Working residuals of the re-estimated model.
Fitted mean values of the re-estimated model.
Numeric rank of the re-estimated model, i.e. the number of unique non-zero re-estimated coefficients.
Linear fit of the re-estimated model on the link scale.
Deviance of the re-estimated model.
AIC of the re-estimated model.
BIC of the re-estimated model.
GCV score of the re-estimated model.
Residual degrees of freedom of the re-estimated model.
Value of the objective function of the re-estimated model: minus the regularized scaled log-likelihood of the re-estimated model.
The model matrix used in the re-estimation, only returned when the argument x.return
in glmsmurf
or glmsmurf.fit
is TRUE
.
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.
Vector of lambda
values that were considered in the selection process.
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).
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.
The matched call.
The supplied formula.
The terms
object used.
The contrasts used (when relevant).
The levels of the factors used in fitting (when relevant).
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).
# NOT RUN {
## See example(glmsmurf) for examples
# }
Run the code above in your browser using DataLab