Learn R Programming

shrinkTVP (version 1.0.0)

plot.shrinkTVP_res: Graphical summary of posterior distribution

Description

plot.shrinkTVP_res generates plots visualizing the posterior distribution.

Usage

# S3 method for shrinkTVP_res
plot(x, pars = c("beta"), nplot = 3, ...)

Arguments

x

a shrinkTVP_res object.

pars

a character vector containing the names of the parameters to be visualized. The names have to coincide with the names of the list elements of the shrinkTVP_res object. Throws an error if any element of pars does not fulfill this criterium. The default is c("beta").

nplot

positive integer that indicates the number of tvp plots to display on a single page before a new page is generated. The default value is 3.

...

further arguments to be passed to the respective plotting functions.

Value

Called for its side effects and returns invisibly.

Examples

Run this code
# NOT RUN {
set.seed(123)
sim <- simTVP(theta = c(0.2, 0, 0), beta_mean = c(1.5, -0.3, 0))
data <- sim$data

output <- shrinkTVP(y ~ x1 + x2, data)
plot(output)
# }
# NOT RUN {
## Will produce an error because 'hello' is not a parameter in the model
# }
# NOT RUN {
plot(output, pars = c("beta", "hello"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab