coef.cv.savvyPR: Extract Coefficients From a Cross-Validated Parity Regression...

View source: R/coef.cv.savvyPR.R

coef.cv.savvyPRR Documentation

Extract Coefficients From a Cross-Validated Parity Regression Model Object

Description

Extracts the estimated coefficients corresponding to the optimal tuning parameters from a fitted cross-validated parity regression model object. It seamlessly handles models optimized using either the "budget" or "target" parameterization method.

Usage

## S3 method for class 'cv.savvyPR'
coef(object, ...)

Arguments

object

A fitted model object of class cv.savvyPR.

...

Additional arguments passed to the predict.cv.savvyPR method.

Details

Extract Coefficients From a Cross-Validated Parity Regression Model Object

This function is an S3 method for the generic coef function. It extracts the coefficients of the optimal model identified during the cross-validation procedure. The extraction is internally delegated to the predict.cv.savvyPR method with type = "coefficients".

Value

A named numeric vector of the estimated coefficients from the optimally tuned model. If the model was fitted with an intercept, it will be included as the first element.

Author(s)

Ziwei Chen, Vali Asimit and Pietro Millossovich
Maintainer: Ziwei Chen <ziwei.chen.3@citystgeorges.ac.uk>

See Also

cv.savvyPR, predict.cv.savvyPR

Examples


# Generate synthetic data
set.seed(123)
x <- matrix(rnorm(100 * 10), 100, 10)
y <- rnorm(100)

# Example 1: Extract coefficients from a Budget-based CV model
cv_model_budget <- cv.savvyPR(x, y, method = "budget", model_type = "PR3")
coef(cv_model_budget)

# Example 2: Extract coefficients from a Target-based CV model
cv_model_target <- cv.savvyPR(x, y, method = "target", model_type = "PR1")
coef(cv_model_target)



savvyPR documentation built on April 7, 2026, 5:08 p.m.