ridgePlot {WpProj}R Documentation

Ridge Plots for a Range of Coefficients

Description

[Experimental] This function will plot the distribution of predictions for a range of active coefficients

Usage

ridgePlot(
  fit,
  index = 1,
  minCoef = 1,
  maxCoef = 10,
  scale = 1,
  alpha = 0.5,
  full = NULL,
  transform = function(x) {
     x
 },
  xlab = "Predictions",
  bandwidth = NULL
)

Arguments

fit

A WpProj object or list of WpProj objects

index

The observation number to select. Can be a vector

minCoef

The minimum number of coefficients to use

maxCoef

The maximum number of coefficients to use

scale

How the densities should be scale

alpha

Alpha term from ggplot2 object

full

"True" prediction to compare to

transform

transform for predictions

xlab

x-axis label

bandwidth

Bandwidth for kernel

Value

a ggplot2::ggplot() plot

Examples

if(rlang::is_installed("stats")) {
n <- 128
p <- 10
s <- 99
x <- matrix(stats::rnorm(n*p), nrow = n, ncol = p )
beta <- (1:10)/10
y <- x %*% beta + stats::rnorm(n)
post_beta <- matrix(beta, nrow=p, ncol=s) + matrix(stats::rnorm(p*s, 0, 0.1), p, s)
post_mu <- x %*% post_beta
fit <-  WpProj(X=x, eta=post_mu, 
             power = 2
)
ridgePlot(fit)
}

[Package WpProj version 0.2.1 Index]