| linear_regressor | R Documentation |
An R6-class for linear regression that is used within the StabilizedRegression framework.
Currently this is the only regression procedure that has been implemented. In order to extend the StabilizedRegression framework to a different regression procedure a custom R6-class with the same structure as this function can be written and used within StabilizedRegression.
Constructer method initializes a linear regression object
specifying on which subset of variables S to fit the
regression and which type of stability test and prediction score
to compute. The methods fit() and predict() can be
applied to the object to fit and predict, respectively.
estimatorNumeric vector of regression coefficients.
SNumeric vector specifying the subset of variables to perform regression on.
scoresNumeric vector of fitted stability and prediction scores.
parsList specifying the
stability test via test and
prediction score via pred_score.
new()Create a new linear_regression object.
linear_regressor$new(
S = numeric(),
pars = list(test = "mean", pred_score = c("mse", "mse"))
)SSubset of variables.
parsParameters.
A new 'linear_regression' object.
fit()Fit a 'linear_regression' object on data and computes the stability and prediction scores.
linear_regressor$fit(X, Y, A, extra = NA)
XPredictor matrix.
Yresponse vector.
Aenvironemnt indicator.
extranot required (placeholder)
A fitted 'linear_regression' object.
predict()Predict using a fitted 'linear_regression' object.
linear_regressor$predict(X)
XPredictor matrix on which to predict response.
Numeric vector of predicted response.
clone()The objects of this class are cloneable with this method.
linear_regressor$clone(deep = FALSE)
deepWhether to make a deep clone.
Niklas Pfister
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.