visual_compare: Visually compare two models

Description Usage Arguments Value Examples

View source: R/plots.R

Description

Visually compare two models

Usage

1
visual_compare(model1, model2, ratio = FALSE)

Arguments

model1

a predictive object

model2

a predictive object

ratio

show ratio rather than comparison (default: FALSE)

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# define two models
data_model <- likelihood(family = "normal", .5, 1)
h0_mod <- prior(family = "point", point = 0)
h1_mod <- prior(family = "normal", mean = 0, sd = 10)
m0 <- extract_predictions(data_model * h0_mod)
m1 <- extract_predictions(data_model * h1_mod)

# visually compare the model
visual_compare(m0, m1)
# plot the ratio of the two model predictions
visual_compare(m0, m1, ratio = TRUE)

bayesplay documentation built on Sept. 9, 2021, 9:09 a.m.