visualize_IPD_results: Plot a heatmap that shows the distribution of posterior...

View source: R/visualize_IPD_results.R

visualize_IPD_resultsR Documentation

Plot a heatmap that shows the distribution of posterior probability over strategies for each player.

Description

Plot a heatmap that shows the distribution of posterior probability over strategies for each player.

Usage

visualize_IPD_results(
  fit,
  d,
  mode = "optim",
  smart_sort = FALSE,
  color = "#440154FF",
  strategy_set = c("ALLD", "ALLC", "RANDY", "TFT", "TF2T", "GTFT", "WSLS", "TFTA",
    "TF2TA", "GTFTA", "WSLSA", "ATFT"),
  dashes_at = c(0)
)

Arguments

fit

The results returned by either fit_IFD_optim or fit_IFD_mcmc.

d

The data fed into either fit_IFD_optim or fit_IFD_mcmc.

mode

Either 'optim' or 'mcmc'.

smart_sort

Sort to cluster by strategy?

color

The color of the 'hot' end of the heatmap.

strategy_set

The list of strategies in the Stan model. The order here must match the order of strategies in the Stan file.

dashes_at

A list of locations to plot dashed lines.

Value

A ggplot object. Heatmap.


ctross/PrisonR documentation built on July 1, 2024, 11:23 p.m.