Skip to contents

Checks that day pattern model results match original data by comparing totals. Use to validate model fit for day pattern classification.

Usage

check_daypat_results(model, fit_dt)

Arguments

model

fitted model object. Day pattern model.

fit_dt

data.table with required columns:

  • day_trip_class

  • estimation_weight Rows: one per person-day. Keys: (day_trip_class). Modified by reference: no (returns copy).

Value

NULL. Used for side effect of validation.

Details

  • Predicts day type probabilities and multiplies by estimation weights.

  • Sums predicted and original counts by day type.

  • Checks equality within tolerance; prints message if passed.

  • Used for validation; returns nothing.

Settings

None.

See also

  • scripts/weighting/daypat_model.R

Other validation helpers: check_group_sum(), check_group_sums(), check_initial_weights(), check_ref_counts(), check_weight_skew()

Examples

## Not run:
check_daypat_results(model, fit_dt)
#> Error: object 'model' not found
## End(Not run)