| coef.savvyPR | R Documentation |
Extracts the estimated coefficients from a fitted parity regression model object.
It seamlessly handles models fitted using either the "budget" or "target"
parameterization method.
## S3 method for class 'savvyPR'
coef(object, ...)
object |
A fitted model object of class |
... |
Additional arguments passed to the |
Extract Coefficients From a Parity Regression Model Object
This function is an S3 method for the generic coef function. It extracts the
estimated coefficients of the fitted model. The extraction is internally delegated to
the predict.savvyPR method with type = "coefficients".
A named numeric vector of the estimated coefficients from the fitted model. If the model was fitted with an intercept, it will be included as the first element.
Ziwei Chen, Vali Asimit and Pietro Millossovich
Maintainer: Ziwei Chen <ziwei.chen.3@citystgeorges.ac.uk>
savvyPR, predict.savvyPR
# Generate synthetic data
set.seed(123)
x <- matrix(rnorm(100 * 10), 100, 10)
y <- rnorm(100)
# Example 1: Extract coefficients from a Budget-based model
model_budget <- savvyPR(x, y, method = "budget", val = 0.05)
coef(model_budget)
# Example 2: Extract coefficients from a Target-based model
model_target <- savvyPR(x, y, method = "target", val = 1)
coef(model_target)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.