Paul J. Ossenbruggen, PhD, Civil engineer,

Eric M. Laflamme, PhD, Statistician,

Paul C. Ossenbruggen, Computer programmer,

An Open-Source Project

Users are encouraged to freely use any of the material used to create this package. Click on the following links to access information about cartools:

  1. Code: This ‘GitHub’ repository contains the cartools functions and data sets.

  2. Website: This ‘GitHub Pages’ website: (a) provides instruction for using the cartools code and its various algorithms for solving a variety of transportation problems; and (b) gives justification, a detailed in depth look at basic principles, for using the code to help answer the fundamental questions. Real-world problems are investigated.

People familiar with R and RStudio may download, use and share this material as they see fit. Feedback is welcomed.


The primary purpose of this website deals with transportation engineering, operations and management. I would remiss in not drawing attention to the major advances made in computer science and statistics that enhance learning.

Animation and interactive graphics bring new perspectives into understanding both old and new ideas. Take a brief look at gapminder showing an animated scatter plot of life expectancy over the last 200 years and shiny showing an interactive bus route map. At the time of this writing, the animated and interactive features have not been initiated. These features have been implemented on my local computer and will be made available soon.


Now lets turn attention to transportation issues.

“In many industrialized nations today, highways present engineers and governments with formidable challenges relating to safety, sustainability, environmental impacts, congestion mitigation, and deteriorating infrastructure. As a result, highways are often viewed from a perspective of the many challenges as they present as opposed to the benefits that they provide. (Mannering and Washburn 2017)

Focus: The cartools package and this website focus on traffic congestion mitigation. We pose a most perplexing question:

How can we mitigate traffic congestion when a traffic breakdown event is so difficult to predict?

A roadway can operate normally on one day and on the next day, be congested. Obviously, traffic conditions change from day-to-day, They also change on a finer time-scale from second-to-second. In cartools, we treat these uncertainties or chance events with probability. The trick is to identity those factors that can reliably predict a traffic breakdown event, an event when the average speed will falls below some pre-defined level.

The list of factors that explains a traffic breakdown event is long. In due time, we explore these factors. But for now, consider one of these factors, driver behavior. Drivers are described as safe, aggressive (speeders, tailgaters), reckless (text while driving), inattentive and so on. We will see that under ideal conditions, drivers, who are determined to maintain a specified speed, are unable to do so. Human frailty is part of the driver behavior mix.

Obviously, solving the traffic breakdown puzzle requires a comprehensive knowledge of the individual elements of the driver behavior mix and those factors that influence driver behavior and traffic demand: traffic management, law enforcement, roadway design, monetary (out-of-pocket) and human costs (crash risk), transport mode competition and technology.

In cartools, the strategy is to break this puzzle into more manageable parts, explore each part, and then reassemble the parts in a meaningful way. Fundamental principles of transportation, probability, statistics and visual imagery, graphics, are the principle means of exploring a part or an assembly of parts with cartools. The website contains the following menu items, which we call the manageable parts:

  1. Drivers: Self Optimizers. Meeting the challenges.
  2. Noise: Traffic noise or volatility. Exploratory data analysis of a congested freeway bottleneck.
  3. Ring-Road: Driver behavior and safety. A “controlled” car-following experiment on a single lane road.
  4. Bottleneck: Determinstic models. Traffic merging at a bottleneck where two-lanes combine to form one lane.
  5. Zipper Merge: Wishful thinking. An “ideal” merge" at a bottleneck.
  6. Breakdown: Modeling reality. A stochastic traffic breakdown model.
  7. Capacity: Highway performance. Measuring performance as a capacity.
  8. Crossover Lane changing. The potential for queue formation due to weaving.
  9. Smart Mobility: Intelligent Transportation Systems. Moving forward with innovative technology.
  10. Summary: cartools package highlights.

The principal aim of the cartools package is to explain highway performance as simply as possible. These topics are introduced in a step-by-step manner. The cartools package is derived and developed from a diverse set of resources:


Agresti, Alan. 1990. Categorical Data Analysis. John Wiley & Sons.

Banks, James A. 1998. Introduction to Transportation Engineering. McGraw-Hill.

Daganzo, Carlos F. 1997. Fundamentals of Transportation and Traffic Operations. Permagon.

Elefteriadou, Lily. 2014. An Introduction to Traffic Flow Theory. New York, New York: Springer.

Hosmer, David W., and Stanley Lemeshow. 1989. Applied Logistic Regression. John Wiley & Sons.

Iacus, Stefano. 2008. Simulation and Inference for Stochastic Differential Equations: With R Examples. Springer-Verlag.

Iacus, Stefano Maria. 2016. Simulation and Inference for Stochastic Differential Equations.

Mannering, Fred L, and Scott S Washburn. 2017. Highway Engineering and Traffic Analysis. Sixth Edition. New York, New York: John Wiley & Sons.

Ossenbruggen, Paul J. 2017. “A Diffusion Model to Explain and Forecast Freeway Breakdown and Delay.” In 5th IEEE International Conference on Models and Technologies for Intelligent Transportation Systems. Naples, Italy: IEEE.

R Core Team. 2014. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing.

RStudio, Inc. 2014. Shiny: Easy Web Applications in R.

Sugiyama, Yuki, Minoru Fukui, Macoto Kikuchi, Katsuya Hasebe, Akihiro Nakayama, Katsuhiro Nishinari, Shin-ichi Tadaki, and Satoshi Yukawa. 2008. “Traffic Jams Without Bottlenecks—Experimental Evidence for the Physical Mechanism of the Formation of a Jam.” New Journal of Physics 10 (3):033001.

Trieber, Martin, and Arne Kesting. 2013. Traffic Flow Dynamics: Data, Models and Simulation. Springer.

Vandeale, Walter. 1983. Applied Time Series and Box-Jenkins Models. Academic Press.

Wickham, Hadley. 2016. Elegant Graphics for Data Analysis. Springer-Verlag New York.