dd_cov: dd_cov

Description Usage Arguments Note

Description

Calculate station-to-station covariance matrix for a given city. Upper diagonal of matrix is between all trips from i and j, so dd_cov()[i, j] holds the covariance between all trips from station i to all other stations and from station j to all other stations. Analogously, the lower diagonal (dd_cov()[j, i]) holds covariances between all trips to i and j.

Usage

1
2
dd_cov(city, lower = 0, upper = 1, osm = TRUE, neutral = FALSE,
  k = NULL)

Arguments

city

City for which covariance matrix is to be extracted

lower

Lower limit (0-1) for distance cutoff used to calculate covariances (see details)

upper

Upper limit (0-1) for distance cutoff used to calculate covariances (see details)

osm

If FALSE, return straight-line distances, otherwise street network distances.

neutral

If TRUE, return a covariance matrix corresponding to a neutral spatial interaction model rather than the observed trip matrix. These neutral covariance matrices can be compared with observed ones to reveal station pairs with higher-than-expected covariances.

k

For neutral covariance matrices, the exponential decay parameter of the spatial interaction model. If not specified, the value is determined by maximising fit between neutral and observed models.

Note

The directory from which trip matrices are loaded can be retrieveed with dd_get_data_dir, and set with dd_set_data_dir. Covariances can be calculated between stations lying within a defined distance range using the lower and upper parameters. For example, to calculate covariances only using the nearest half of all stations, set upper = 0.5.


mpadge/distdecay documentation built on May 24, 2019, 6:08 a.m.