Skip to contents

Displays a concise summary of a fitted savvySh_model object, including the original function call, the chosen model class, the number of non-zero coefficients per estimator, and the optimal lambda value (if applicable). Additionally, it prints the coefficients for the specified estimator(s) with user-specified precision.

Usage

# S3 method for class 'savvySh_model'
print(x, digits = max(3, getOption("digits") - 3), estimator = NULL, ...)

Arguments

x

A fitted savvySh_model object returned by savvySh.

digits

An integer specifying the number of significant digits to display when printing coefficients and lambda. Defaults to max(3, getOption("digits") - 3).

estimator

A character vector naming one or more estimators for which coefficients should be printed. Valid names are those present in x$coefficients (e.g., "St", "DSh", "Sh", "SR", "GSR", or "ShrinkageRR"). If NULL, coefficients for all estimators are printed.

...

Additional arguments passed to print (currently unused).

Value

Invisibly returns a data.frame summarizing each selected estimator's name, number of non-zero coefficients, and the final optimal_lambda (if any).

Details

This print method provides a quick diagnostic of the fitted model by showing:

Summary Metrics

A table that includes, for each estimator, the number of non-zero coefficients and the optimal lambda (if applicable).

Coefficients

For each selected estimator, the coefficients are printed with appropriate names: if an intercept is present, it is labeled (Intercept) and the remaining coefficients are labeled according to the predictor names.

If the user does not specify an estimator using the estimator argument, the function prints information for all available estimators stored in the model. If one or more estimators are specified, only those are printed, after verifying that they exist in x$coefficients.

The method invisibly returns a summary data.frame containing key metrics for each estimator.

See also

savvySh for fitting slab and shrinkage linear models, coef.savvySh_model and predict.savvySh_model for extracting coefficients and generating predictions.

Author

Ziwei Chen, Vali Asimit, Marina Anca Cidota, Jennifer Asimit
Maintainer: Ziwei Chen <ziwei.chen.3@citystgeorges.ac.uk>