
Compute cell-level data-usage status for a Triangle
Source:R/triangle-vis.R
dot-compute_triangle_usage.RdInternal helper that classifies every (group, cohort, dev) cell of a
Triangle into one of four buckets given a fit-data filter
configuration: "used", "holdout", "unused", or "future".
Mask precedence: holdout > used > unused > future.
Usage
.compute_triangle_usage(
x,
recent = NULL,
regime = NULL,
holdout = NULL,
m_k = NULL,
grp_m_k = NULL
)Arguments
- x
A
Triangleobject.- recent
Optional positive integer (calendar-diagonal cut), or
NULL.- regime
Optional cohort cutoff. Accepts the same input forms handled by
.resolve_regime_change_date()(NULL,Date, character, vector, orRegime).- holdout
Optional positive integer. When supplied, the last
holdoutcalendar diagonals are flagged"holdout". Therecentfilter is then evaluated against the post-holdout boundary so the recent wedge sits before the holdout wedge (no overlap), matchingbacktest()semantics – the internal fitter operates on the masked triangle whose own max_cal isoriginal - holdout.- m_k
Optional integer. The maturity switch as a target development index (=
changeof the first stable link). When bothrecentandregimeare provided, the hybrid mask usesm_kas the boundary: cells withdev < m_kapply the cohort cut, cells withdev >= m_kapply the calendar-diagonal cut. WhenNULL, the hybrid logic falls back to applying both filters jointly (cohort cut AND recent cut).