plotPosterior: Plot posterior distributions

Description Usage Arguments Value Examples

View source: R/plotting_functions.R

Description

Function to plot the posterior of the model parameters obtained by graper from the variational inference framework.

Usage

1
2
plotPosterior(fit, param2plot, beta0 = NULL, gamma0 = NULL,
  tau0 = NULL, pi0 = NULL, s0 = NULL, jmax = 2, range = NULL)

Arguments

fit

fit as produced by graper

param2plot

which parameter of the graper model to plot (gamma, beta, tau or s)

beta0

true beta (if known)

gamma0

true gamma (if known)

tau0

true tau (if known)

pi0

true pi (if known)

s0

true s (if known)

jmax

maximal number of components per group to plot (for beta and s)

range

plotting range (x-axis)

Value

a ggplot object

Examples

1
2
3
4
5
6
# create data
dat <- makeExampleData()
# fit the graper model
fit <- graper(dat$X, dat$y, dat$annot)
# plot posterior distribution of the gamma parameter
plotPosterior(fit, param2plot="gamma")

graper documentation built on Nov. 8, 2020, 5:45 p.m.