Learn R Programming

NeuralEstimators (version 0.1.2)

plotestimates: Plot estimates vs. true values.

Description

Plot estimates vs. true values.

Usage

plotestimates(
  df,
  estimator_labels = ggplot2::waiver(),
  parameter_labels = NULL
)

Value

a 'ggplot' of the estimates for each parameter against the true value.

Arguments

df

a long form data frame containing fields estimator, parameter, estimate, and truth.

estimator_labels

a named vector containing estimator labels.

parameter_labels

a named vector containing parameter labels.

Examples

Run this code
if (FALSE) {
K <- 50
df <- data.frame(
  estimator = c("Estimator 1", "Estimator 2"), 
  parameter = rep(c("mu", "sigma"), each = K),
  truth = 1:(2*K), 
  estimate = 1:(2*K) + rnorm(4*K)
)
estimator_labels <- c("Estimator 1" = expression(hat(theta)[1]("·")),
                      "Estimator 2" = expression(hat(theta)[2]("·")))
parameter_labels <- c("mu" = expression(mu), "sigma" = expression(sigma))

plotestimates(df,  parameter_labels = parameter_labels, estimator_labels)}

Run the code above in your browser using DataLab