
Plot the model-implied departure probability (\(\tau_i\)) and daily travelers
Source:R/plot_departure_tau.R
plot_departure_tau.RdTwo-panel figure for the "spatial" group of
render_MOSAIC_figures: (left, A) a forest plot of the daily
departure probability \(\tau_i\) per location, with optional 95% credible
intervals; (right, B) the implied total daily travelers leaving each origin,
\(N_i \tau_i\).
Usage
plot_departure_tau(tau, N, location_name = names(tau), ci = NULL)Arguments
- tau
Numeric vector of daily departure probabilities (length J), in config order. From
calc_mobility_fluxelement$tau.- N
Numeric vector of origin populations (length J), config order.
- location_name
Character vector of length J giving the labels, config order. Defaults to
names(tau).- ci
Optional data frame of credible intervals with columns
location(matchinglocation_name),lower, andupper(on the \(\tau\) scale). WhenNULL(default), no interval bars are drawn.
Value
Invisibly, the combined cowplot object (or the single forest ggplot2 object if cowplot is unavailable).
Details
The aesthetic matches the published \(\tau_j\) panel of
plot_mobility exactly (theme_minimal(), red dashed mean
line, black shape = 21 points, dodgerblue bars on a
scale_x_sqrt axis, cowplot::plot_grid with A/B labels). Both
panels are ordered by \(\tau_i\) via reorder(iso3, mean) — a keyed
reorder over the data frame, not a positional sort (F3-safe).
\(\tau_i\) is a daily probability (the engine consumes it per-day
in the spatial-hazard step), so \(N_i \tau_i\) is the expected number of
travelers per day. CI bars are drawn only when ci is supplied;
render_MOSAIC_figures passes the posterior 95% interval of
\(\tau_i\) when every location's \(\tau_i\) was sampled, else the optional
mobility_tau_ci.csv run artifact. Otherwise the left panel shows point
estimates only — matching plot_mobility
minus the error bars.