Ex4.4: Reproduce Example 4.4 and Figure 4.3

View source: R/mnet-sim-cor.R

Ex4.4R Documentation

Reproduce Example 4.4 and Figure 4.3

Description

Reproduces Example 4.4 and Figure 4.3 from the book. If you specify any options, your results may look different. Note that this simulation in particular is very time-consuming if run with the full N=100 replications.

Usage

Ex4.4(
  N = 100,
  s = seq(0.1, 1.1, 0.2),
  n = 100,
  p = 500,
  p1 = 12,
  rho = 0.7,
  seed = 1
)

Fig4.3(res, parlist = list(mfrow = c(1, 2), mar = c(4, 4, 2, 0.5)))

Arguments

N

Number of simulated realizations

s

Signal strength (coefficient value for the non-null features)

n

Sample size

p

Number of features

p1

Number of non-null features

rho

Correlation between features (compound symmetric)

seed

Seed for reproducibility

res

Output from Ex4.4

parlist

List of arguments to pass to par()

Examples

res <- Ex4.4(N=2, s=c(0.3, 1))
Fig4.3(res)

pbreheny/hdrm documentation built on Jan. 17, 2024, 8:53 p.m.