Learn R Programming

sparselink (version 1.0.0)

coef.sparselink: Regression Coefficients

Description

Extracts coefficients from multi-task or transfer learning regression model.

Usage

# S3 method for sparselink
coef(object, ...)

Value

Returns estimated coefficients. The output is a list with two slots: slot alpha with the estimated intercept (vector of length \(q\)), and slot beta with the estimated slopes (matrix with \(p\) rows and \(q\) columns).

Arguments

object

object of class "sparselink" (generated by function sparselink)

...

(not applicable)

References

Armin Rauschenberger, Petr N. Nazarov, and Enrico Glaab (2025). "Estimating sparse regression models in multi-task learning and transfer learning through adaptive penalisation". Under revision. https://hdl.handle.net/10993/63425

See Also

Use sparselink to fit the model and predict to make predictions.

Examples

Run this code
family <- "gaussian"
type <- "multiple" #  try "multiple" or "transfer"
if(type=="multiple"){
 data <- sim_data_multi(family=family)
} else if(type=="transfer"){
 data <- sim_data_trans(family=family)
}
data <- sim_data_trans(family=family,n0=10,p=3)
object <- sparselink(x=data$X_train,y=data$y_train,family=family)
coef <- coef(object=object)

Run the code above in your browser using DataLab