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, ...)

Arguments

object

An output of traveltimeCLT, of class traveltimeCLT.

newdata

A data frame of new trips and their road level travel information, formatted as trips, see trips or data(trips); View(trips).

level

Significance levels.

...

For passing extra parameters, for example, time bin rules to be passed to rules2timebins, see rules2timebins in the trip-specific method.

Value

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.

Details

Both the trip-specific and population prediction intervals are Gaussian-based.

Examples

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)
}