generate_eta: Generate a Sequence of Tuning Parameters (eta)

View source: R/utils.R

generate_etaR Documentation

Generate a Sequence of Tuning Parameters (eta)

Description

Produces a numeric vector of eta values to be used in Cox–KL model.

Usage

generate_eta(method = "exponential", n = 10, max_eta = 5, min_eta = 0)

Arguments

method

Character string selecting how to generate eta: “linear” or “exponential”. Default is “exponential”. for an exponentially spaced sequence scaled to max_eta. Default is "exponential".

n

Integer, the number of eta values to generate. Default is 10.

max_eta

Numeric, the maximum value of eta in the sequence. Default is 5.

min_eta

Numeric, the minimum value of eta in the sequence. Default is 0.

Details

  • Exponential: values are formed by exponentiating a grid from log(1) to log(100), then linearly rescaling to the interval [0, max_eta]. Thus the smallest value equals 0 and the largest equals max_eta.

  • Linear: the current implementation calls seq(min_eta, max_eta, length.out = n) and therefore assumes a numeric object min_eta exists in the calling environment.

Only the exact strings “linear” and “exponential” are supported; other values for method will result in an error because eta_values is never created.

Value

Numeric vector of length n containing the generated eta values.

Examples

# Generate 10 exponentially spaced eta values up to 5
generate_eta(method = "exponential", n = 10, max_eta = 5)

# Generate 5 linearly spaced eta values up to 3
generate_eta(method = "linear", n = 5, max_eta = 3)


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