plot.ebnm | R Documentation |
Given one or more fitted ebnm
object(s), produces a plot of
posterior means vs. observations. If desired, a plot of cumulative
distribution functions of fitted prior(s) can also be produced.
## S3 method for class 'ebnm'
plot(
x,
...,
incl_pm = TRUE,
incl_cdf = FALSE,
subset = NULL,
remove_abline = FALSE
)
x |
The fitted |
... |
Additional |
incl_pm |
Plot posterior means vs. observations? |
incl_cdf |
Plot the cumulative distribution functions? |
subset |
The subset of observations to include on the plot of posterior
means vs. observations. Can be a numeric vector corresponding to indices
of observations to plot, or a character vector if observations are named.
If |
remove_abline |
To better illustrate shrinkage effects, the plot of
posterior means vs. observations includes the line |
theta <- c(rep(0, 100), rexp(100))
theta[1:50] <- 0
s <- 1
x <- theta + rnorm(200, 0, s)
pn.res <- ebnm_point_normal(x, s)
plot(pn.res)
pe.res <- ebnm_point_exponential(x, s)
plot(pn.res, pe.res)
# Customize plot:
library(ggplot2)
plot(pn.res, pe.res, remove_abline = TRUE) +
theme_bw() +
labs(x = "Simulated data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.