| 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 |
fitted.values |
Fitted mean values of the estimated model |
rank |
Numeric rank of the estimated model, i.e. the number of unique non-zero coefficients. |
family |
The used |
linear.predictors |
Linear fit of the estimated model on the link scale |
deviance |
Deviance of the estimated model: minus twice the log-likelihood, up to a constant. |
aic |
Akaike Information Criterion of the estimated model: |
bic |
Bayesian Information Criterion of the estimated model: |
gcv |
Generalized Cross-Validation score of the estimated model: |
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 |
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 |
lambda2 |
The used penalty parameter for the |
iter |
The number of iterations that are performed to fit the model. |
converged |
An integer code indicating whether the algorithm converged successfully:
|
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 |
Optionally, following elements are also included:
X |
The model matrix, only returned when the argument |
y |
The response vector, only returned when the argument |
pen.weights |
List with the vector of penalty weights per predictor (covariate), only returned when the argument |
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 |
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 |
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.vector |
Vector of |
lambda.measures |
List with for each of the relevant measures a matrix containing for each considered value of |
lambda.coefficients |
Matrix containing for each considered value of |
When the object is output from glmsmurf, following elements are also included:
call |
The matched call. |
formula |
The supplied formula. |
terms |
The |
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":
coefExtract coefficients of the estimated model.
coef_reestExtract coefficients of the re-estimated model, when available.
devianceExtract deviance of the estimated model.
deviance_reestExtract deviance of the re-estimated model, when available.
familyExtract family object.
fittedExtract fitted values of the estimated model.
fitted_reestExtract fitted values of the re-estimated model, when available.
plotPlot coefficients of the estimated model.
plot_reestPlot coefficients of the re-estimated model, when available.
plot_lambdaPlot 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.
predictObtain predictions using the estimated model.
predict_reestObtain predictions using the re-estimated model, when available.
residualsExtract residuals of the estimated model.
residuals_reestExtract residuals of the re-estimated model, when available.
summaryPrint a summary of the estimated model, and of the re-estimated model (when available).
See Also
Examples
## See example(glmsmurf) for examples