Functions for the palasso
manuscript.
plot_score(X, choice = NULL, ylab = "count")
plot_table(
X,
margin = 2,
labels = TRUE,
colour = TRUE,
las = 1,
cex = 1,
cutoff = NA
)
plot_circle(b, w, cutoff = NULL, group = NULL)
plot_box(
X,
choice = NULL,
ylab = "",
ylim = NULL,
zero = FALSE,
invert = FALSE
)
plot_pairs(x, y = NULL, ...)
plot_diff(x, y, prob = 0.95, ylab = "", xlab = "", ...)
matrix with \(n\) rows and \(p\) columns
numeric between \(1\) and \(p\)
\(0\) (none), \(1\) (rows), or \(2\) (columns)
numeric between \(0\) and \(1\)
between-group correlation: vector of length \(p\)
within-group correlation: matrix with \(p\) rows and \(p\) columns
vector of length \(p\)
vectors of equal length
additional arguments
confidence interval: numeric between \(0\) and \(1\)
to do
The function plot_score
compares a selected column to each of the
other columns. It counts the number of rows where the entry in the selected
column is smaller (blue), equal (white), or larger (red).
Use palasso to fit the paired lasso.
### score ###
n <- 10; p <- 4
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
palasso:::plot_score(X)
### table ###
n <- 5; p <- 3
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
palasso:::plot_table(X,margin=2)
### circle ###
n <- 50; p <- 25
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Z <- matrix(rnorm(n*p),nrow=n,ncol=p)
b <- sapply(seq_len(p),function(i) abs(cor(X[,i],Z[,i])))
w <- pmax(abs(cor(X)),abs(cor(Z)),na.rm=TRUE)
palasso:::plot_circle(b,w,cutoff=0)
### box ###
n <- 10; p <- 5
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
palasso:::plot_box(X,choice=5)
### pairs ###
n <- 10
x <- runif(n)
y <- runif(n)
palasso:::plot_pairs(x,y)
### diff ###
n <- 100
x <- runif(n)
y <- runif(n)
palasso:::plot_diff(x,y)