Audit how disparity metrics move over time and across cities
Source:R/fairness_temporal.R
morie_fairness_predpol_temporal_audit.RdFor every (city, period) cell the audit computes the
four disparity metrics, then aggregates per city - reporting the
mean of each metric, the count of periods with DIR > 1
(over-prediction periods), and the DIR temporal range (max - min)
which quantifies how unstable the metric is across the audited
window.
Usage
morie_fairness_predpol_temporal_audit(
period,
city,
y_pred,
group,
privileged = NULL,
favorable = 1
)Arguments
- period
Time-period label per record (e.g.
"2019-03"). Sorted lexically for display, so ISO-style labels order correctly.- city
City label per record.
- y_pred
Decision / assignment per record.
- group
Protected attribute per record.
- privileged
Reference group. If
NULL, inferred globally from pooled data.- favorable
Value of
y_predcounted as favourable (default1).
Value
A morie_fairness_result; headline value is the
largest per-city DIR temporal range - the worst temporal
instability found in the audited window.