This is a thin wrapper around fit_car() that:
1) preprocesses the outcome (log/per-distance options),
2) fits the Gaussian CAR model,
3) returns a traffic-flavored object that can be augmented back onto roads.
fit_traffic(
data,
roads = NULL,
A = NULL,
segment_id_col = "segment_id",
outcome = c("speed", "travel_time"),
outcome_col = NULL,
distance_col = NULL,
per_distance = FALSE,
transform = c("log", "identity"),
X = NULL,
...
)An object of class `traffic_fit` containing the underlying fit and transform metadata.
data.frame with at least `segment_id` and the outcome column.
optional; an sf object or similar that contains adjacency info already used by your `fit_car()` pipeline (depends on your package design).
adjacency matrix or object accepted by `fit_car()` (recommended explicit).
character; column in `data` used to join back to roads.
character; one of "speed" or "travel_time".
optional character; if NULL uses `outcome`.
optional character; used only for travel_time when per_distance=TRUE.
logical; only for travel_time.
character; "log" or "identity".
optional design matrix; if NULL, uses intercept-only.
passed to `fit_car()` (e.g., type="proper"/"icar", rho, priors, n_iter, burn, etc.)