residual_variance estimate the sample variance of standardized travel residual for a set of trips.

residual_variance(data, network_parameters, rho = 1L, nsamples = 500L, ...)

Arguments

data

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

network_parameters

An output of link_mean_variance, see ?link_mean_variance.

nsamples

The number of trips to sample for parameter estimation. Default is 500.

...

Extra parameters to be passed to predict.traveltimeCLT.trip_specific.

lag

Maximum lag at which to calculate the autocorrelations. Default is 1 for the first order-autocorrelations.

Value

Returns the sample variance of the standardized residual.

Details

The function predicts 'trip-specific' mean and variance of travel time of a sample of trips, given a set of parameter estimates. With such prediction, it estimates the standardized residual and calculates its sample variance. The trip-specific method is a Gaussian-based model, therefore the estimated residual, theoretically, should be 1. Hence, a residual variance of 1.5 resembles sqrt(1.5)-1 = 0.22 of unexplained variability of the model.

Examples

if (FALSE) {


}