coef.coxkl_ridge: Extract Coefficients from a 'coxkl_ridge' Object

View source: R/coef.R

coef.coxkl_ridgeR Documentation

Extract Coefficients from a coxkl_ridge Object

Description

Extracts the estimated regression coefficients (beta) from a fitted coxkl_ridge object. Optionally, one or more lambda values can be supplied. If requested lambda values are not in the fitted sequence, linear interpolation is performed between nearest neighbors; out-of-range requests error.

Usage

## S3 method for class 'coxkl_ridge'
coef(object, lambda = NULL, ...)

Arguments

object

An object of class "coxkl_ridge", typically the result of coxkl_ridge.

lambda

Optional numeric value or vector specifying the regularization parameter(s) for which to extract (or interpolate) coefficients. If NULL, all estimated coefficients are returned.

...

Additional arguments (currently ignored).

Value

A numeric matrix of regression coefficients. Each column corresponds to one value of lambda, sorted in descending order.

Examples

data(ExampleData_highdim) 

train_dat_highdim <- ExampleData_highdim$train
beta_external_highdim <- ExampleData_highdim$beta_external

model_ridge <- coxkl_ridge(z = train_dat_highdim$z,
                           delta = train_dat_highdim$status,
                           time = train_dat_highdim$time,
                           beta = beta_external_highdim,
                           eta = 1)
coef(model_ridge)[1:5, 1:10]


survkl documentation built on April 22, 2026, 1:08 a.m.