predict.traveltimeCLT predicts expected travel time (ETA) and a prediction interval based on the trip-specific and population methods.
# S3 method for traveltimeCLT
predict(object, newdata, level = 0.95, ...)An output of traveltimeCLT, of class traveltimeCLT.
A data frame of new trips and their road level travel information, formatted as trips, see trips or data(trips); View(trips).
Significance levels.
For passing extra parameters, for example, time bin rules to be passed to rules2timebins, see rules2timebins in the trip-specific method.
Returns a data frame that inlcudes the ETA (and optionally the trips variance), with lower and upper prediction bounds (optional), for each trip in the newdata.
Both the trip-specific and population prediction intervals are Gaussian-based.
if (FALSE) {
test_trips = sample_trips(trips, 10)
train = trips[!trips$tripID %in% test_trips,]
test = trips[trips$tripID %in% test_trips,]
fit <- traveltimeCLT(train, lag = 1)
predict(fit, test)
}