plot: Plot method for ordinis fitted objects

Description Usage Arguments Examples

Description

Plot method for ordinis fitted objects

Plot method for fitted two mountains cv objects

Usage

1
2
3
4
5
6
7
## S3 method for class 'ordinis'
plot(x, xvar = c("loglambda", "lambda", "norm"),
  labsize = 0.6, xlab = iname, ylab = NULL, main = x$penalty,
  xlim = NULL, n.print = 10L, ...)

## S3 method for class 'cv.ordinis'
plot(x, sign.lambda = 1, ...)

Arguments

x

fitted "ordinis" model object or fitted "cv.ordinis" model object

xvar

What is on the X-axis. "penalty" plots against the penalty value applied to the coefficients, "lambda" against the log-lambda sequence

labsize

size of labels for variable names. If labsize = 0, then no variable names will be plotted

xlab

label for x-axis

ylab

label for y-axis

main

main title for plot

xlim

numeric vectors of length 2, giving the x and y coordinates ranges.

n.print

scalar integer for the number of times along the regularization path to print the number of nonzero coefficients. If set to a negative value, the number of nonzero coefficients will not be printed.

...

other graphical parameters for the plot

sign.lambda

Either plot against log(lambda) (default) or its negative if sign.lambda = -1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set.seed(123)
n.obs <- 100
n.vars <- 1000

true.beta <- c(runif(5, 0.1, 1) * (2 * rbinom(5, 1, 0.5) - 1), rep(0, n.vars - 5))

x <- matrix(rnorm(n.obs * n.vars), n.obs, n.vars)
y <- rnorm(n.obs, sd = 2) + x %*% true.beta

fit <- ordinis(x = x, y = y, penalty = c("mcp"))

plot(fit)

set.seed(123)
n.obs <- 100
n.vars <- 200

true.beta <- c(runif(15, -0.5, 0.5), rep(0, n.vars - 15))

x <- matrix(rnorm(n.obs * n.vars), n.obs, n.vars)
y <- rnorm(n.obs, sd = 3) + x %*% true.beta

fit <- cv.ordinis(x = x, y = y, gamma = 1.4)

plot(fit)

jaredhuling/ordinis documentation built on May 23, 2019, 4:03 a.m.