plot_path: Plot regularization paths for '"prof_*"' classes

View source: R/prof_lambda.R

plot_pathR Documentation

Plot regularization paths for "prof_*" classes

Description

Plot regularization paths and optionally log-likelihood trajectories of objects of class "prof_alpha" and "prof_lambda". Coefficient names are automatically added to the plot.

Usage

plot_path(object, plot_logLik = FALSE, ...)

Arguments

object

object of class "prof_alpha" or "prof_lambda"

plot_logLik

Whether logLik trajectory should be plotted (default: FALSE)

...

additional arguments to plot

Value

None

Author(s)

Lucas Kook

Examples


library("tramnet")
if (require("survival") & require("penalized")) {
  data("nki70", package = "penalized")
  nki70$resp <- with(nki70, Surv(time, event))
  x <- scale(model.matrix( ~ 0 + DIAPH3 + NUSAP1 + TSPYL5 + C20orf46, data = nki70))
  y <- Coxph(resp ~ 1, data = nki70, order = 10, log_first = TRUE)
  fit1 <- tramnet(y, x, lambda = 0, alpha = 1)
  pfl <- prof_lambda(fit1)
  plot_path(pfl)
  fit2 <- tramnet(y, x, lambda = 1, alpha = 1)
  pfa <- prof_alpha(fit2)
  plot_path(pfa)
}


tramnet documentation built on April 1, 2023, 12:20 a.m.