{"id":23372912,"url":"https://github.com/urbananalyst/ttcalib","last_synced_at":"2025-08-31T23:33:26.076Z","repository":{"id":77962386,"uuid":"541986821","full_name":"UrbanAnalyst/ttcalib","owner":"UrbanAnalyst","description":"Calibration of travel times to empirical data","archived":false,"fork":false,"pushed_at":"2024-05-27T09:51:47.000Z","size":1069,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T02:49:22.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UrbanAnalyst.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-09-27T08:45:20.000Z","updated_at":"2024-05-27T09:51:51.000Z","dependencies_parsed_at":"2023-09-23T11:13:26.341Z","dependency_job_id":null,"html_url":"https://github.com/UrbanAnalyst/ttcalib","commit_stats":{"total_commits":81,"total_committers":1,"mean_commits":81.0,"dds":0.0,"last_synced_commit":"14fb4ab84cf1364f98797c79b62cb1b769d5b127"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UrbanAnalyst/ttcalib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fttcalib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fttcalib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fttcalib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fttcalib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UrbanAnalyst","download_url":"https://codeload.github.com/UrbanAnalyst/ttcalib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanAnalyst%2Fttcalib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273052850,"owners_count":25037295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T16:51:19.382Z","updated_at":"2025-08-31T23:33:26.026Z","avatar_url":"https://github.com/UrbanAnalyst.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![R build\nstatus](https://github.com/UrbanAnalyst/ttcalib/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/ttcalib/actions?query=workflow%3AR-CMD-check)\n[![Project Status:\nConcept](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)\n\n# ttcalib: Calibration of travel times to empirical data\n\nOne metric used throughout this organisation is travel times relative to\nequivalent times taken by motorcars. This repository documents procedures used\nto calibrate estimates of motorcar travel times to empirical data.\n\n## Empirical Data\n\n### Uber movement data\n\nThe empirical data are from [Uber movement](https://movement.uber.com/), with\nthese analyses calibrating against [data from Santiago,\nChile](https://movement.uber.com/explore/santiago/travel-times?lang=en-US).\nThe data used are the \"All Data\" version for the first quarter of 2020, grouped\nby \"Hour of Day\". The download tab on the website linked to above also includes\na link to the \"Geo Boundaries\", which are also required. Both of these data\nshould be saved to a local directory.\n\n### OSM Network data\n\nThe Uber movement data extend over a far greater boundary than the \"Santiago\"\nboundary returned by Nominatim. The OSM network data were therefore obtained\nhere from the complete Chile `pbf` file downloaded from Geofabrik, and then\nprocessed with `osmium-tools` by:\n\n1. Trimming to bbox of (-71.363,-33.851,-70.377,-33.113)\n2. Constructing separate keyword-filtered subsets with keywords of: \"highway\",\n   \"restriction\", \"access\", \"bicycle\", \"foot\", \"motorcar\", \"motor_vehicle\",\n   \"vehicle\", \"toll\".\n3. Converting all of these single `pbf` files to `osm` (XML) format.\n4. Reading in each via\n   [`osmdata::osmdata_sc()`](https://docs.ropensci.org/osmdata/reference/osmdata_sc.html),\n   and combining all data into single `osmdata_sc` object.\n\n## Calibration\n\nThe calibration proceeds in two steps:\n\n1. Calibration of waiting times both at traffic lights, and to turn across\n   oncoming traffic. The effects of these parameters was examined in [a 2020\n   *Scientific Data* paper, \"*Longitudinal spatial dataset on travel times and\n   distances by different travel modes in Helsinki\n   Region*](https://www.nature.com/articles/s41597-020-0413-y), which\n   implemented a complicated parametrisation of waiting times at various types\n   of intersections \"based on previous research.\"\n2. Calibration of estimated times to measures of network centrality. These\n   effects were examined in [a 2014 *Nature Communications* paper, \"*Predicting\n   commuter flows in spatial networks using a radiation model based on temporal\n   ranges*](https://www.nature.com/articles/ncomms6347), which started with a\n   \"base\" model able to predict observed travel times with an r-squared\n   correlation coefficient of 0.639. This was then increased through inclusion\n   of the effects of centrality, using a simple threshold model, to 0.752. \n\nThese two types of calibration are successively applied here.\n\n### Calibration to waiting times\n\nWaiting times were examined through two parameters:\n\n1. The effective waiting time at traffic lights; and\n2. The effective waiting time to turn across oncoming traffic.\n\nStreet networks were weighted for time-based routing using specific values of\nthese two parameters, and travel times estimated for all 320,666 observed\norigins and destinations in the Uber Movement data. The minimal-error model\ncorresponded to an R-squared correlation of 0.782 for an effective waiting time\nat traffic lights of 8 seconds in morning peak hour traffic (7-10 am), or 9\nseconds in afternoon traffic (3-7 pm). Corresponding effective waiting times to\nturn across oncoming traffic were only 2 or 1 seconds, respectively, although\nthese made very little difference to model results compared with the effects of\ntraffic lights.\n\n### Calibration to network centrality\n\nThe preceding waiting times were then used to calculate time-based metrics of\ncentrality, and to adjust observed travel times by centrality. These\nadjustments made, however, very little difference, and increasing travel times\nalong more central portions of the network increased agreement with observed\nvalues at most by only a few hundredths of a percent or less. The best model\nwas to logarithmically transform centrality, divide by the maximum value, and\nincrease travel times for the upper 30% of the centrality distribution by the\ncorresponding values. Even this, however, only increased resultant r-squared\nvalues by just over 1%.\n\n## Conclusion\n\nThis repository documents and justifies the general procedure pursued here, to\nestimate vehicular travel times through using the following time penalties:\n\n1. Wait at traffic lights = 9 seconds\n2. Wait to turn across oncoming traffic = 1 second\n\nNo additional adjustments for network centrality are implemented. The estimated\ntimes are then slightly faster than the observed times, with a median ratio of\nlog-times of 0.94.\n\n![](man/figures/correlation.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbananalyst%2Fttcalib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbananalyst%2Fttcalib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbananalyst%2Fttcalib/lists"}