Skip to contents

For each profiled parameter, draws the profile above the paths of plotPathsMulti(). Requires the package cowplot.

Usage

plotProfilesAndPaths(
  profs,
  whichPar,
  nPars = 5,
  ncol = 3,
  normalizePaths = FALSE,
  modes = c("data", "prior"),
  ...
)

Arguments

profs

A parframe of profiles as returned by profile().

whichPar

Character vector, the profiled parameters to draw.

nPars

Integer, number of colored and named paths. Defaults to 5.

ncol

Number of columns of the plot grid. Defaults to 3.

normalizePaths

Logical. TRUE scales each path to a maximum absolute value of 1. Defaults to FALSE.

modes

Character vector, the contributions to the objective drawn in the profile plot besides the total. Defaults to c("data", "prior").

...

Further arguments passed to cowplot::plot_grid().

Value

A ggplot object, the grid of cowplot::plot_grid().

Examples

pars <- c(a = 1, b = 0.5, c = 2)
obj <- constraintL2(mu = pars, sigma = 0.1)
profs <- profile(obj, pars, whichPar = c("a", "b"), limits = c(-1, 1),
                 cores = 1)
plotProfilesAndPaths(profs, c("a", "b"), nPars = 2, ncol = 2)