Abstract
This article proposes several advances to sparse nonnegative matrix factorization (SNMF) as a way to identify largescale patterns in urban traffic data. The input to our model is traffic counts organized by time and location. Nonnegative matrix factorization additively decomposes this information, organized as a matrix, into a linear sum of temporal signatures. Penalty terms encourage this factorization to concentrate on only a few temporal signatures, with weights which are not too large. Our interest here is to quantify and compare the regularity of traffic behavior, particularly across different broad temporal windows. In addition to the rank and error, we adapt a measure introduced by Hoyer to quantify sparsity in the representation. Combining these, we construct several curves which quantify error as a function of rank (the number of possible signatures) and sparsity; as rank goes up and sparsity goes down, the approximation can be better and the error should decreases. Plots of several such curves corresponding to different time windows leads to a way to compare disorder/order at different time scalewindows. In this paper, we apply our algorithms and procedures to study a taxi traffic dataset from New York City. In this dataset, we find weekly periodicity in the signatures, which allows us an extra framework for identifying outliers as significant deviations from weekly medians. We then apply our seasonal disorder analysis to the New York City traffic data and seasonal (spring, summer, winter, fall) time windows. We do find seasonal differences in traffic order.
Introduction
Motivation
Traffic management is one of the persistent challenges of the modern industrialized world. It simultaneously reflects both a critical infrastructural necessity and a problem involving a wide range of scales and interactions. Over the past 2 decades, floatingcar data (for example, from GPSequipped taxis and other vehicles) has become an important source of realtime and largescale city traffic information Deri and Moura (2015), Donovan and Work (2015). These data streams can be used to manage traffic signals, influence equilibrium traffic states Ban et al. (2011), Zheng and Liu (2017), Herman and Prigogine (1979), Mahmassani et al. (1984), Geroliminis and Daganzo (2008), Krichene et al. (2016), Deri and Moura (2015), Zhu et al. (2016), Zhan et al. (2014), Guan et al. (2016), AlonsoMora et al. (2017), Ferreira et al. (2013), and optimally route traffic.
Our interest here is in part to quantify and compare regularity of traffic behavior, particularly across different broad temporal windows. Traffic behavior changes as seasons change, and we would like to build a framework for comparing the regularity of these behaviors. With reliable methods which allow us to identify broad trends in traffic behavior, we can understand responses to urban planning decisions and singular events, and hopefully help cities be more responsive.
Problem Statement and Contribution
We would like to find broad citywide patterns which can be used to describe macroscopic behavior of traffic counts; that is, the number of cars on a given link (directed edge) in a road network at a certain time. Twoway roads are, of course, represented as two links. The challenge is to find lowdimensional descriptions of this potentially large dataset, and to quantify disorder as the inability to fully describe traffic behavior in this lowdimensional way.
Our goal here is to decompose traffic counts on different links into different behavioral signatures. The weighted summation of such signatures will represent a lowrank approximation of the traffic behavior. In this additive decomposition method, a given behavioral signature can, for example, represent heavy traffic volumes during the morning rush hour, medium traffic for the rest of the workday, and light traffic in the evening. However, as a signature spans the entire year, this example suggests a segment of the overall pattern which regularly repeats (every workday). Both the behavioral signatures and the weights of links on the signatures should be nonnegative; each signature describes a pattern of a nonnegative number of vehicles on a link (e.g., activity near a public gathering place) and there are a nonnegative number of people behaving according to that pattern; the mathematics of nonnegative matrix factorization will play a key role.
We are interested in the error of this approximation; a large error, roughly, corresponds to disorder in traffic behavior. Our lowrank approximation depends on several parameters. By looking at this error across several seasonal windows and constructing a curve which captures the error of this approximation as it depends on these parameters, we can compare disorder in traffic patterns.
Dataset
Our method uses traffic counts on links, broken up into time increments. In this paper, we will apply our calculations to New York City traffic data given in Donovan et al. (2016). See Section 4 for more information about the dataset (and its limitations). An added component of our analysis is that it fills in some missing values via matrix completion; see [ZWFM], Xu et al. (2012).
Related Works
Nonnegative Matrix (and tensor) Factorization (NMF) has already been used for urban and network traffic analysis Ahmadi et al. (2015), Chen et al. (2019), Yufei and Fabien (2011), Han and Moutarde (2013), Han and Moutarde (2016), Hofleitner et al. (2012), Liu et al. (2017), Ma et al. (2018), Sun and Axhausen (2016), Xu et al. (2015); see also Lv et al. (2015). Furthermore, matrix factorization has also been used in studying train Gong et al. (2018), Ito et al. (2017), bicycle Cazabet et al. (2018), and risk Lee et al. (2016) data. Anomaly detection using related methods can be found in Djenouri et al. (2018), Zhang et al. (2016), Guo et al. (2015), Li et al. (2015), Wang et al. (2019).
More generally, NMF has been applied to a wide range of problems, like text data mining Chagoyen et al. (2006), Pauca et al. (2004), gene expression Brunet et al. (2004), CarmonaSaez et al. (2006), Gao and Church (2005), Kim and Tidor (2003), Maher et al. (2006), microarray comparative genomics hybridization Carrasco et al. (2006), functional characterization of gene lists Pehkonen et al. (2005) and facial images Li et al. (2001), Hoyer (2004).
A focus of our work is sparsity in the matrix factorization. Various extensions of NMF have been made to impose sparsity, either on both factors, as in Dueck et al. (2005), Hoyer (2004), PascualMontano et al. (2006), Pauca et al. (2006), Kim and Park (2007), or on only one Gao and Church (2005), Pauca et al. (2004). There are furthermore ways of measuring sparsity Hoyer (2004) which are different than the algorithmic ways to encourage it; see Sect. 3.1.
Another somewhat novel focus of our work is using low rank factorization to quantify disorder (and in particular compare seasonal disorder); see Sect. 5. We carry out a range of low rank factorizations, finding that there are robust seasonal biases in the error.
Our work follows the ideas of Lee and Seung (2001) and Kim and Park (2007). Matrix factorization can be viewed as an approach to reduce the dimensionality or compress Asif et al. (2013) traffic data. Traffic data dimensionality techniques span more classical techniques building on principal component analysis Li et al. (2007), Yang and Qian (2019), Li et al. (2015), to more recent developments using variational autoencoders Boquet et al. (2020). Exploiting spatiotemporal patterns can both support data reduction and also prediction of future traffic states on the network,Yang and Qian (2019). For a recent review of approaches to exploit structure in traffic data for prediction, we refer to the reviews Ermagun and Levinson (2018), Nagy and Simon (2018), Pavlyuk (2019).
Outline
In Sect. 2, we set up the theory and background for the algorithm we use. In Sect. 3, we describe metrics and tools we use for analyzing error and sparsity associated with the approximation. In Sect. 4, we apply our analysis to the dataset of New York City traffic described in Sect. 1.3. We further analyze the error of our algorithm in relation to the New York City dataset in Sect. 5. We give some conclusions in Sect. 6. The appendix reviews the mathematics behind the iterative algorithm we develop in Sect. 2.3.
The supporting source code for this work is published at [KYA\(^{+}\)].
Setup and Theory
Traffic Counts
We start by organizing traffic counts into a matrix D, where \(D_{t,\ell }\) is the traffic count on link \(\ell\) during time period t. The time index ranges through \({\mathcal{T}}\overset{\text {def}}{=}\{1,2\dots T\}\) and the link index ranges through a finite set \({\mathcal{L}}\overset{\text {def}}{=}\{1,2\dots L\}\) of links. Our interest is seasonal fluctuations, so we assume that T represents a large time horizon. If the traffic count on link \(\ell\) at time t is unknown (i.e., missing), we set \(D_{t,\ell }\overset{\text {def}}{=}\text {NaN}\) and define
as the set of indices for which we have traffic estimates.
NonNegative Matrix Factorization
We want to decompose D as
where N is the rank of the factorization, with \(N\le \min \{T,L\}\), and where the entries of W and H are nonnegative, and where WH denotes the standard matrix product.
To quantify the error in (2), let us first define
with \({\mathcal{I}}\) as in (1). In other words, we replace NaNs with zeroes. Then, define
with \(\Vert \cdot \Vert _F\) being the Frobenius norm.
Sparse Nonnegative Matrix Factorization
The rank N denotes the size of the “universe” of possible signatures. We can think of the columns of W as temporal signatures and the rows of H as weights. Within this collection of temporal signatures, we want to represent each column of D (i.e., the traffic count on each link) using as few of these signatures as possible.
For any matrix \(A\in \mathbb {R}^{M\times N}\), let \(A_{\varvec{\cdot },n}\) denote the nth column of A and let \(A_{m,\varvec{\cdot }}\) denote the mth row of A. Sparse Nonnegative Matrix Factorization (SNMF), as seen in Kim and Park (2008) (cf. Hoyer (2002)), fixes positive parameters \(\beta\) and \(\eta\) and minimizes
Sparsity in the columns of H is encouraged by the penalty term involving \(\beta\) (which involves an \(L_1\) LASSOtype penalty), while the term involving \(\eta\) is used to prevent the values in W from being too large. The choice of these parameters is problemspecific.
Normalization
To provide a common reference for comparing behavior in different columns (i.e., links), we finally require that the columns of W sum to 1 (i.e., have \(L_1\)norm of 1). This gives us a relative traffic count; allowing us to better understand how the traffic count in the signature is temporally broken down (i.e., by time, week, and season). It also explicitly resolves ambiguity in the multiplicative decomposition \(D\approx WH\).
Due to this normalization, our \(H\) contains the scalefactor of \(D\). In other words, scaling \(D\) by a constant factor leaves \(W\) unchanged but scales up \(H\) by that same factor. The choice for N and \(\beta\) therefore are independent of the scale of entries in D.
Algorithm
Our iterative algorithm is based on Lee and Seung (2001) with sparsity modifications as laid out in Kim and Park (2008). Details of the calculation are in the appendix.
For positive integers R (number of rows) and C (number of columns), let \(\mathbf {1}_{R\times C}\) be the \((R\times C)\)matrix whose entries are all 1. For matrices A and B in \(\mathbb {R}^{R\times C}\), let
denote Hadamard (i.e., elementwise) multiplication and division.
Starting with any fullrank \((W,H)\in \mathbb {R}_+^{T\times N} \times \mathbb {R}_+^{N\times L}\), our iterative update is given by a sequence of recursive update rules:
followed by
Algorithm Termination
There are three natural indicators that the algorithm has converged:

\(\left\ W^{(m+1)}W^{(m)}\right\ _F\approx 0\)

\(\left\ H^{(m+1)}H^{(m)}\right\ _F\approx 0\)

\(\left {\mathcal{E}}_{\beta , \eta }(W^{(m+1)},H^{(m+1)}) {\mathcal{E}}_{\beta , \eta }(W^{(m)},H^{(m)})\right \approx 0\).
We use a combination of the first two, that is, we stop our algorithm when
for a fixed positive threshold \(\tau\).
Error Analysis
Sparsity
As we increase the parameter \(\beta\) of (5), which increases the size of the LASSOtype penalty on the columns of H, we expect H to become more sparse; i.e. to have more small entries. We can measure this via the calculations of Hoyer (2004), which are based on the relationship between the \(L_1\) and \(L_2\) norms. For nonzero \(x\in \mathbb {R}^N\), define
Then, \(0\le {{\,\mathrm{Sparsity}\,}}(x)\le 1\), with \({{\,\mathrm{Sparsity}\,}}(x)=1\) if and only if all except one of the entries of x is nonzero, and \({{\,\mathrm{Sparsity}\,}}(x)=0\) if and only if all entries of x take on a common (nonzero) value. We also note that \({{\,\mathrm{Sparsity}\,}}(\alpha x)={{\,\mathrm{Sparsity}\,}}(x)\) for nonzero \(\alpha \in \mathbb {R}\); i.e., \({{\,\mathrm{Sparsity}\,}}\) is scaleinvariant.
For \(H\in \mathbb {R}^{N\times L}\) having no nonzero columns, let us similarly define
\({{\,\mathrm{Sparsity}\,}}(H)\) is the average of the \({{\,\mathrm{Sparsity}\,}}(H_{\varvec{\cdot },\ell })\) over all \(\ell\). We note that this measure of sparsity is unaffected by the rescaling of (7).
Tradeoff
Once we have found a reasonable value for \(\eta\), a range of values of the sparsity penalty \(\beta\) and the rank N (see Sect. 4.1), we can carry out a perturbative analysis of error. For a given lowrank decomposition (W, H), we can construct the error matrix
We are interested in the seasonal fluctuations of the error (10) as an indication of how “ordered” traffic behavior is at different times. A small error would mean that traffic behavior can, in fact, be additively decomposed into different signatures.
We first fix a reference \(\eta\) (see Sect. 4.1). Let’s also fix a set \(\mathcal {N}\) of possible values of the rank parameter N, and a set \(\mathcal {B}\) of possible values of the penalty parameter \(\beta\). For each \((N,\beta )\in \mathcal {N}\times \mathcal {B}\) (i.e., a grid of values for N and \(\beta\)) let \((W^*(N,\beta ), H^*(N,\beta ))\in \mathbb {R}_+^{T\times N} \times \mathbb {R}_+^{N\times L}\) be the result of the iterative scheme of Sect. 2.5, with this \(\beta\) and N, terminated according to the criterion laid out in Sect. 2.6. If in some cases, the algorithm fails to converge, then we say that \((W^*(N,\beta ),H^*(N,\beta ))\) is undefined.
Fix \({\mathcal{T}}'\subset {\mathcal{T}}\), and define
for \((N,\beta )\in \mathcal {N}\times \mathcal {B}\) such that \((W^*(N,\beta ),H^*(N,\beta ))\) is defined. Here in the definition of \({\mathcal{E}}^*\), \((A)_{{\mathcal{T}}'\times {\mathcal{L}}}\) denotes the submatrix corresponding to \((A_{t,\ell }: (t,\ell )\in {\mathcal{T}}'\times {\mathcal{L}})\) for any \(A\in \mathbb {R}^{{\mathcal{T}}\times {\mathcal{L}}}\). For each \(N\in \mathcal {N}\), define the sets
We want to compare \({\mathcal{E}}^*\) for different subsets \({\mathcal{T}}'\) of \({\mathcal{T}}\) (e.g. different \({\mathcal{T}}'\)’s corresponding to different seasons). Informally, we want to compare \({\mathcal{E}}^*(N,\beta ,{\mathcal{T}}')\) and \({\mathcal{E}}^*(N,\beta ,{\mathcal{T}}^{\prime \prime })\) for the same values of N and \(\beta\). A larger value of \({\mathcal{E}}^*\) corresponds to more disorder on the original data. Note that our matrix factorization does not depend on the subset \({\mathcal{T}}'\); we rather are evaluating the error over different subsets of time. This allows us to use as much data as possible in the factorization, and resolve some of the challenges in dealing with sparse data. Informally, we are using a common collection of H weights, while selecting seasonal parts of the W signatures.
Plot 1
(Monotonicity of sparsity). For each N, we can plot
For a fixed \(N\in \mathcal {N}\), we expect that \({{\,\mathrm{Sparsity}\,}}^*\) should be increasing in \(\beta\) (see Fig. 10 on page 13). If so, we can uniquely reparameterize effects of \(\beta\) as effects of \({{\,\mathrm{Sparsity}\,}}^*\) of (9).
Next, we can understand how \({{\,\mathrm{Sparsity}\,}}^*\) and \({\mathcal{E}}^*\) vary for each given \(N\in \mathcal {N}\).
Plot 2
(Dependence of \({\mathcal{E}}^*\) on rank and \(\beta\)) For each \(N\in \mathcal {N}\), we can parametrically plot
We expect this to be nondecreasing; more sparsity reflects more restrictions on the factors in the matrix product, leading to more error (see Figs. 11–14 on pages 13–15).
We finally can approximately plot error as a function of N for fixed sparsity values. Fix \(N\in \mathcal {N}\) and let \({\mathcal{S}}_N:\mathcal {B}\rightarrow [0,1]\) be the piecewise linear function with knots at (12).
Plot 3
(Dependence of \({\mathcal{E}}^*\) on rank and sparsity). If \({\mathcal{S}}_N\) is nondecreasing for each \(N\in \mathcal {N}\), and \(s\in (0,1)\) is in the range of all of the \({\mathcal{S}}_n\)’s (for \(n\in \mathcal {N}\)), we can plot
(See Figs. 15, 16, 17, 18 on pages 15–16).
We expect that as sparsity increases, so does the error.
Analysis of New York City Data: Matrix Factorization
Let’s apply our analysis to the data of Sect. 1.3 (i.e., Donovan et al. (2016)), which reverseengineers estimates of traffic counts from origindestination pairs for taxi trips. Our taxi dataset is an illustrative (and perhaps scaled) proxy for true traffic counts, but we recognize that it is potentially biased. Our methodology could readily be modified when nonbiased counts (possibly available from private companies or from dedicated traffic counting sensors installed by municipalities; see also [pem]) are available.
The dataset contains hourly traffic data in the interval
We thus have
time records. Arranging them in order, we get \({\mathcal{T}}\) of Sect. 2.1.
The dataset contains estimates of taxi counts for \(L_\circ \overset{\text {def}}{=}260,855\) onedirectional links (roadways) in New York City; a twodirectional road segment is represented as two onedirectional links. We use OpenStreetMap labels. Table 1 gives a statistical summary of these links.
In total, the dataset of Donovan et al. (2016) thus has
entries. About \(95\%\) of these (2,181,923,208) are zero. Given that New York City is an urban environment and unlikely to have empty roads at any time of the day, we reset these zero entries to \(\text {NaN}\). To restrict our calculations to a subset for which we have somewhat reliable data, we will consider only those links for which there are at most a total of 720 missing hours (30 days worth) of data. We get \({\mathcal{L}}\) with \(L\overset{\text {def}}{=}2,302\). Selecting more links comes with the benefit of incorporating more traffic data into our analysis while also introducing the cost of having a higher number of missing data entries. The distribution of entries is shown in Fig. 1. Multiplying these links by the time horizon of 8, 760 hours gives over \(2\times 10^7\) data points. Our goal is to understand how to appropriately identify and understand complex patterns in this data. Figure 1 shows that 2, 302 of the mosttraveled links captures \(19\%\) of the entries in D. Adding more (sparsely traveled) links would correspond to adding sparse columns to D, perhaps with diminishing returns for data interpretation.
Constants, Initialization, and Computational Considerations
For our yearlong taxi traffic dataset, on the links of \({\mathcal{L}}\), we use:

\(\eta = \max _{\begin{array}{c} 1\le t\le T \\ 1\le \ell \le L \end{array}}D_{t,\ell } = 4171\),

rank: \(N=50\) ,

\(\beta = 5000\).
These values stem from a grid search of the results of the algorithm of Sect. 2.5. The initial entries of W and H (i.e., the initial condition of W and H) are taken to be i.i.d. Uniform(0, 1) random variables (thus ensuring that W and H start with full rank). We disregard runs which lead to zero columns of W; such zero columns are invariant under our multiplicative update rule and indicate suboptimal use of rank. Note that, by (5) and (6), an iteration leading to a zero column of W will produce a zero row of H and vice versa. The algorithm is relatively insensitive to changes in \(\eta\), and the above value of \(\eta\) leads to values of W which are not too large. Fixing the value of \(\eta\) (to the above value), we carry out a refined grid search on the \((N, \beta )\) parameters. Table 2 gives specific numerical results for two pairs of \((N,\beta )\) parameters.
By thresholding H, we can forcibly express our approximation of each D as a linear combination of as few signatures as possible. For each column of H, we set all entries in each column below the 40th percentile of that column to zero. In practice, this reduces each link to a linear combination of at most eight signatures. Table 3 updates Table 2 once we have thresholded.
The results of the grid search in \((N,\beta )\) are summarized in Figs. 2 and 3. These figures confirm a natural tradeoff: higher N allows lower error and higher \(\beta\) leads to better sparsity, and these are competing objectives, however. We generally consider a sparsity value between 0.8 and 1.0 to be sufficient as it allows for only a handful of dominant signatures per link.
Informally, higher values of \(\beta\) are likely to mean sparser H, and higher values of N mean a larger universe of signatures. Hence, in cases where the algorithm produces a zero signature, we take this to mean that the matrix factorization needs a smaller rank.
To focus on the interpretation of the output of the algorithm, let us now fix \(N=50\) (the smaller value of N) and \(\beta =5000\) for the rest of this section. The output consists of two matrices W and H of sizes \(8,760\times 50\) and \(50\times 2,302\), respectively. The columns of W are \(L^1\)normalized and the columns of H are sparse.
Recall that columns of W represent traffic signatures over time. Each signature is a timeseries for the entire year and hence need not be periodic. For example, the signatures can capture traffic anomalies during holidays, hurricanes, and blackouts.
Furthermore, the entries of a column of H are coefficients for the linear decomposition of a link into distinct signatures. For example, if the 4th column of H is \(\left( 0,7,2,0,\ldots ,0\right) ^T\), then the traffic in link 4 of \({\mathcal{L}}\) can be written as seven times the second signature plus two times the third signature. This decomposition allows us to identify spatial patterns in traffic across the city. These matrices and the patterns derived from them can then aid in making specific observations about the largescale behavior of traffic (as detailed in Sect. 4.4).
Independence of Signatures
To quantify the linear independence of the signatures obtained from the algorithm, we can compute the condition number of WHagen et al. (2000). A high condition number (in the thousands) would indicate that the rank should be reduced. By performing several runs of our algorithm for rank \(N=50\) with different (W, H)initializations, we determine
This number is low enough to give us confidence in the W returned by the algorithm., and further validates our choice of \(N=50\).
Robustness of Algorithm
The factors produced by our algorithm are not unique and can differ by permutations. If \(W_1\) and \(W_2\) are produced by two runs of the algorithm (starting with different initial conditions), we can calculate the Pearson productmoment correlation coefficient between the columns of \(W_1\) and the columns of \(W_2\). A coefficient value close to one implies that the signatures follow the same pattern up to a scale factor. We can construct a greedy algorithm for searching for a permutation which will maximize correlations by sequencing through the columns of \(W_1\), finding the column of \(W_2\) which maximizes the correlation (with respect to the selected column of \(W_1\)), and then removing that column of \(W_2\) from future computations. We can thus permute the columns of \(W_2\) to better match those of \(W_1\). After doing this, we can construct a heatmap which shows the correlation between the columns of \(W_1\) and the columns of (the permuted) \(W_2\). Figure 4 shows this heatmap for two runs of the Algorithm of Sect. 2.5 with different (random) initial conditions and with the prevailing values of \(\eta =4171\), \(N=50\) and \(\beta =5000\) (see Sect. 4.1). 4 gives the correlation between the ith column of \(W_1\) and the jth column of the permuted \(W_2\). We see high correlation on the diagonal, meaning that the original matrix \(W_2\) is very close to a permutation of \(W_1\).
We make observations about the lowrank decomposition are in Sect. 4.4.
Periodicity and Anomalous Observations
We note that the columns of D (and hence the signatures) are roughly periodic, with a period of 7 days. A power spectrum periodogram of D (averaged over all columns) is shown in Fig. 5.
In light of this periodicity, we can look at one day of the week across the entire year (e.g., all Mondays) and compute the hourwise median traffic for that day and then identify anomalous behavior. See Figs. 6, 7a, 8a, and 8b (in dark red). In gray, we plot the relative taxi counts i.e., entries of the normalized signatures. We then determine which dates have relative taxi counts that differ significantly from the hourwise median traffic in the sense that those (signature, day) pairs have the highest sum of absolute deviations from the median weekly traffic. In the subsections below, we identify some possible origins of anomalous behavior.
Hurricane Irene
Figure 6 shows Signature 0, which captures a nearshutdown of taxi traffic on August 27, 2011. This may have been caused by Hurricane Irene hitting NYC. There was an early warning and all subways and buses were shut down at noon on Saturday, August 27. A zoned taxi system was implemented at 9 am and taxis were thereafter running flat fares instead of meters [wny]. All other signatures also show similar behavior on and around August 28.
Wisconsin Labor Rally
Figure 7a shows the behavior of Signature \(21\) on February 26, 2011. The traffic deviates from the median Saturday trend. This may have been caused by a Labor Rally that took place near the New York City Town Hall [wis]. Figure 7b shows that Signature 21 is used by links near the Town Hall, which can be seen as further evidence connecting the rally to this traffic deviation.
Christmas Day
Anomalous behavior was also observed on Christmas Day. This can be seen in Fig. 8a for Signature 0 and Fig. 8b for Signature 4. Note how the Christmas Day traffic is reduced by about half throughout the day.
Endemic Signatures
After thresholding as discussed in Sect. 4.1, we can show the support \(\{\ell \in {\mathcal{L}}: H_{j,\ell } > 0\}\) of signature n on a map, for any given \(n\in \{1,2\dots N\}\). See Fig. 9. We note that of the 50 signatures, some tend to be geographically restricted (called endemic), while others are spread out over larger areas (called dispersed). For example, Signature 0, as seen in Fig. 9a is dispersed. Endemic signatures might sometimes explain traffic densities only on a single but long stretch of road. For example, Fig. 9b shows that Signature 10 is largely used by the the northbound 3rd Avenue and streets like Bowery, Lafayette St. and the southernmost part of Broadway that feed into 3rd Avenue. Similarly, Fig. 9d shows Signature 40 being used exclusively by a small section of the southbound Broadway traffic near Central Park.
In some other cases, signatures can be seen as having a lateral sphere of influence in that they affect not only one street but also others feeding into or out of the street transversally—Signature 24, for example, as seen in Fig. 9c.
Analysis of New York City Data: Error Analysis
We second carry out the error analysis of Sect. 3. We will use
as the sets of (11).
Figure 10 gives us Plot 1. We see that \({{\,\mathrm{Sparsity}\,}}\) increases with an increase in \(\beta\) for every value of \(N\in \mathcal {N}\). This confirms that we can reparametrize \(\beta\) as \({{\,\mathrm{Sparsity}\,}}^*\) from Sect. 3.2 for fixed values of N.
Figures 11, 12, 1314 gives Plot 2. Namely, for each season \({\mathcal{T}}'\), it gives \(({{\,\mathrm{Sparsity}\,}}^*(N,\beta ),\) \({\mathcal{E}}^*(N,\beta ,{\mathcal{T}}')\). We compare each season with the yearly average and note that in spring and winter, the seasonal (relative) error of our approximation is lesser then the yearly (relative) error. This indicates that spring and winter traffic are comparatively lowrank and thus more orderly. The fall and summer traffic are more disordered and have higher approximation error than the yearly average. We also note that the gap between the season and annual approximation errors is more pronounced in fall and winter compared to spring and summer. This indicates that spring and summer are more representative of the annual traffic trends while fall and winter capture more of the anomalous behavior in our traffic dataset.
Figures 15, 16, 17, 18 gives Plot 3. As with Figures 11, 12, 1314, we see a bit more order in the spring and winter, and a bit more disorder in the summer and fall. (Since we restrict the analysis to links missing at most 30 days (1/4 of a season), these conclusions we are likely to be statistically meaningful).
Variables Other Than TaxiCounts
We looked at variables other than taxi counts and observed similar lowrank (periodic) behavior in the data. Figure 19 shows 7day periodicity in taxi travel times, speeds, pace (reciprocal of speed) and taxi density (which was computed as a ratio of the taxi counts to link lengths).
A matrix factorization similar to the one shown here for taxi counts might be mathematically carried out for each of these variables. However, since pace and speed are not additive, the interpretation of these matrix factorizations would have to be carefully motivated.
Conclusions
In this paper, we studied a New York City taxi traffic dataset using SNMF techniques. This gave us some insight into underlying behavior with a small number of signatures. It also enabled identification of anomalous traffic patterns which we visualized in Sect. 4.4. These visualizations captured several widespread anomalous events.
We also developed an analysis which might suggest comparisons between traffic patterns in different circumstances (viz. different time intervals). Various city attributes can be connected to different traffic conditions and signatures. This might be relevant for adaptive urban planning and scheduling.
One result of any coarsegraining analysis, such as ours, is to help focus exploration of large datasets around patterns and events of interest. If one already understands the data and is designing, e.g., an incident detection algorithm, then other (perhaps modelbased) approaches might give more refined and/or complementary insights.
This work did not directly address generalizeability of this approach to other cities. Comparable datasets from other cities would enable us to search for cityspecific idiosyncratic behavior as opposed to behavior which might be somewhat invariant to the urban environment.
Starting with our analysis of seasonal error in Sect. 5, another interesting future direction would be a closer look at how different signatures (which last over the interval (13) of a year) might preferentially represent behavior of different seasons. Informally, the rank of signatures representing a particular season’s behavior might be another indication of the complexity of traffic in that season.
Change history
08 May 2021
A Correction to this paper has been published: https://doi.org/10.1007/s42421021000450
References
Asif MT, Kannan S, Dauwels J, Jaillet P (2013) Data compression techniques for urban traffic data. In: 2013 IEEE symposium on computational intelligence in vehicles and transportation systems (CIVTS), pages 44–49. IEEE
Ahmadi P, Kaviani R, Gholampour I, Tabandeh Mahmoud (2015) Modeling traffic motion patterns via nonnegative matrix factorization. In 2015 IEEE international conference on signal and image processing applications (ICSIPA), pages 214–219. IEEE
AlonsoMora J, Samaranayake S, Wallar A, Frazzoli E, Rus D (2017) Ondemand highcapacity ridesharing via dynamic tripvehicle assignment. In: Proceedings of the National Academy of Sciences, page 201611675
Ban XJ, Hao P, Sun Z (2011) Real time queue length estimation for signalized intersections using travel times from mobile sensors. Trans Res Part C 19(6):1133–1156
Boquet G, Morell A, Serrano J, Vicario JL (2020) A variational autoencoder solution for road traffic forecasting systems: missing data imputation, dimension reduction, model selection and anomaly detection. Trans Res Part C 115:102622
Brunet JP, Tamayo P, Golub TR, Mesirov JP (2004) Metagenes and molecular pattern discovery using matrix factorization. Proc Natl Acad Sci 101(12):4164–4169
Chagoyen M, CarmonaSaez P, Shatkay H, Carazo JM, PascualMontano A (2006) Discovering semantic features in the literature: a foundation for building functional associations. BMC Bioinformatics 7(1):41
Chen X, He Z, Sun L (2019) A Bayesian tensor decomposition approach for spatiotemporal traffic data imputation. Trans Res Part C 98:73–84
Cazabet R, Jensen P, Borgnat P (2018) Tracking the evolution of temporal patterns of usage in bicyclesharing systems using nonnegative matrix factorization on multiple sliding windows. Int J Urban Sci 22(2):147–161
CarmonaSaez P, PascualMarqui Roberto D, Tirado Francisco, Carazo Jose M, PascualMontano Alberto (2006) Biclustering of gene expression data by nonsmooth nonnegative matrix factorization. BMC Bioinformatics 7(1):78
Carrasco DR, Tonon G, Huang Y, Zhang Y, Sinha R, Feng B, Stewart JP, Zhan F, Khatry D, Protopopova M et al (2006) Highresolution genomic profiles define distinct clinicopathogenetic subgroups of multiple myeloma patients. Cancer cell 9(4):313–325
Deri JA, Moura JMF (2015) Taxi data in new york city: a network perspective. In: 2015 49th asilomar conference on signals, systems and computers, pages 1829–1833, Nov 2015
Donovan B Mori A, Agrawal N, Meng Y, Lee J, Work D (2016) New York City hourly traffic estimates (20102013). https://doi.org/10.13012/B2IDB4900670_V1
Dueck D, Morris Quaid D, Frey BJ (2005) Multiway clustering of microarray data using probabilistic sparse matrix factorization. Bioinformatics 21(suppl1):i144–i151
Donovan B, Work Daniel B (2015) Using coarse GPS data to quantify cityscale transportation system resilience to extreme events. arXiv preprint arXiv:1507.06011
Djenouri Y, Zimek A, Chiarandini M (2018) Outlier detection in urban traffic flow distributions. In 2018 IEEE international conference on data mining (ICDM), pages 935–940
Ermagun A, Levinson D (2018) Spatiotemporal traffic forecasting: review and proposed directions. Trans Rev 38(6):786–814
Ferreira N, Poco J, Vo HT, Freire J, Silva CT (2013) Visual exploration of big spatiotemporal urban data: a study of new york city taxi trips. IEEE Trans Vis Comput Graph 19(12):2149–2158
Gao Y, Church G (2005) Improving molecular cancer class discovery through sparse nonnegative matrix factorization. Bioinformatics 21(21):3970–3975
Guan X, Chen C, Work D (2016) Tracking the evolution of infrastructure systems and mass responses using publicly available data. PloS one 11(12):e0167267
Geroliminis N, Daganzo CF (2008) Existence of urbanscale macroscopic fundamental diagrams: some experimental findings. Trans Res Part B 42(9):759–770
Guo J, Huang W, Williams BM (2015) Real time traffic flow outlier detection using shortterm traffic conditional variance prediction. Trans Res Part C 50:160–172
Gong Y, Li Z, Zhang Jian, Liu W, Zheng Y, Kirsch C (2018) Networkwide crowd flow prediction of sydney trains via customized online nonnegative matrix factorization. In: Proceedings of the 27th ACM international conference on information and knowledge management, pages 1243–1252. ACM
Hofleitner A, Herring R, Bayen A, Han Y, Moutarde F, De La Fortelle A (2012) Large scale estimation of arterial traffic and structural analysis of traffic patterns using probe vehicles. In Transportation Research Board 91st Annual Meeting (TRB’2012)
Han Y, Moutarde F (2011) Analysis of networklevel traffic states using locality preservative nonnegative matrix factorization. pages 501–506, 10
Han Y, Moutarde F (2013) Statistical traffic state analysis in largescale transportation networks using localitypreserving nonnegative matrix factorisation. IET Intell Trans Syst 7(3):283–295
Han Yufei, Moutarde Fabien (2016) Analysis of largescale traffic dynamics in an urban transportation network using nonnegative tensor factorization. Int J Intell Trans Syst Res 14(1):36–49
Hoyer PO (2002) Nonnegative sparse coding. In: Neural Networks for Signal Processing, 2002. Proceedings of the 2002 12th IEEE Workshop on, pages 557–565. IEEE
Hoyer PO (2004) Nonnegative matrix factorization with sparseness constraints. J Mach Learn Res 5(Nov):1457–1469
Herman R, Prigogine I (1979) A twofluid approach to town traffic. Science 204(4389):148–151
Ronald H, Steffen R, Bernd S (2000) C*algebras and numerical analysis. CRC Press, Boca Raton
Ito K, Ito M, Miyazaki K, Tanimoto K, Sezaki K (2017) Data analysis on train transportation data with nonnegative matrix factorization. In: 2017 IEEE international conference on big data (Big Data), pages 4080–4085. IEEE
Krichene W, Castillo MS, Bayen A (2016) On social optimal routing under selfish learning. In: IEEE transactions on control of network systems
Kim H, Park H (2007) Sparse nonnegative matrix factorizations via alternating nonnegativityconstrained least squares for microarray data analysis. Bioinformatics 23(12):1495–1502
Kim H, Park H (2008) Nonnegative matrix factorization based on alternating nonnegativity constrained least squares and active set method. SIAM J Matrix Anal Appl 30(2):713–730
Kim PM, Tidor B (2003) Subsystem identification through dimensionality reduction of largescale gene expression data. Genome Res 13(7):1706–1718
Karve V, Yager D, Abolhelm M, Work D, Sowers R NYC Traffic Patterns cSNMF Source Code. https://gitlab.engr.illinois.edu/TrafficPatterns/CSNMF.git
Liu Z, Cao J, Yang J, Wang Q (2017) Discovering dynamic patterns of urban space via seminonnegative matrix factorization. In: 2017 IEEE international conference on big data (Big Data), pages 3447–3453. IEEE
Lv Y, Duan Y, Kang W, Li Z, Wang FY (2015) Traffic flow prediction with big data: a deep learning approach. IEEE Trans Intell Trans Syst 16(2):865–873
Li Stan Z, Hou XW, Zhang HJ, Cheng QS (2001) Learning spatially localized, partsbased representation. In: Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on, volume 1, pages I–I. IEEE
Li Q, Jianming H, Yi Z (2007) A flow volumes data compression approach for traffic network based on principal component analysis. In: 2007 IEEE intelligent transportation systems conference, pages 125–130
Lee T, Matsushima S, Yamanishi K (2016) Traffic risk mining using partially ordered nonnegative matrix factorization. In: 2016 IEEE international conference on data science and advanced analytics (DSAA), pages 622–631. IEEE
Lee DD, Seung HS (2001) Algorithms for nonnegative matrix factorization. In: Advances in neural information processing systems, pages 556–562
Li L, Xiaonan S, Zhang Y, Lin Y, Li Z (2015) Trend modeling for traffic time series analysis: an integrated study. IEEE Trans Intell Trans Syst 16(6):3430–3439
Maher EA, Brennan C, Wen PY, Durso L, Ligon KL, Richardson A, Khatry D, Feng B, Sinha R, Louis DN et al (2006) Marked genomic differences characterize primary and secondary glioblastoma subtypes and identify two distinct molecular and clinical secondary glioblastoma entities. Cancer Res 66(23):11502–11513
Ma X, Li Y, Chen P (2018) Identifying spatiotemporal traffic patterns in largescale urban road networks using a modified nonnegative matrix factorization algorithm. Journal of Traffic and Transportation Engineering (English Edition)
Mahmassani HS, Williams JC, Herman R (1984) Investigation of networklevel traffic flow relationships: some simulation results. Trans Res Record 971:121–130
Nagy AM, Simon V (2018) Survey on traffic prediction in smart cities. Pervasive Mobile Comput 50:148–163
Pavlyuk D (2019) Feature selection and extraction in spatiotemporal traffic forecasting: a systematic literature review. Euro Trans Res Rev 11(1):6
Caltrans Performance Measurement System. http://pems.dot.ca.gov/
Alberto PM, Maria CJ, Kieko K, Dietrich L, PascualMarqui RD (2006) Nonsmooth nonnegative matrix factorization (nsnmf). IEEE Trans Pattern Anal Mach Intell 28(3):403–415
Paul Pauca V, Piper J, Plemmons RJ (2006) Nonnegative matrix factorization for spectral data analysis. Linear algebra and its applications 416(1):29–47
Pauca VP, Shahnaz F, Berry MW, Plemmons RJ (2004) Text mining using nonnegative matrix factorizations. In :Proceedings of the 2004 SIAM international conference on data mining, pages 452–456. SIAM
Pehkonen P, Wong G, Törönen P (2005) Theme discovery from gene lists for identification and viewing of multiple functional groups. BMC bioinformatics 6(1):162
Lijun S, Kay WA. Understanding urban mobility patterns with a probabilistic tensor factorization framework. Transportation Research Part B: Methodological, 91:511–524
Hongzhi W, Mohamed JB, Mohamed H. Progress in outlier detection techniques: A survey. IEEE Access, 7:107964–108000
Wisconsin worries: Labor rallies in NY. https://nypost.com/2011/02/26/wisconsinworrieslaborralliesinny/
NY subway system shuts down due to Hurricane Irene (updated). http://www.wnyc.org
Xu L, Wang Y, Yu H, Li H (2015) Feature extraction of urban traffic network data based on locally sensitive discriminant analysis algorithm
Yangyang X, Yin W, Wen Z, Zhang Y (2012) An alternating direction algorithm for matrix completion with nonnegative factors. Front Math China 7(2):365–384
Yang S, Qian S (2019) Understanding and predicting travel time with spatiotemporal features of network traffic flow, weather and incidents. IEEE Intell Trans Syst Mag 11(3):12–28
Zhang Z, He Q, Tong H, Gou J, Li X (2016) Spatialtemporal traffic flow pattern identification and anomaly detection with dictionarybased compression theory in a largescale urban network. Trans Res Part C 71:284–302
Zheng J Liu HX (2017) Estimating traffic volumes for signalized intersections using connected vehicle data. Trans Res Part C 79:347–362
Yuan Z, Kaan O, Kun X, Hong Y (2016) Using big data to study resilience of taxi and subway trips for hurricanes sandy and irene. Trans Res Record 2599:70–80
Zhan X, Ukkusuri SV, Zhu F (2014) Inferring urban land use using largescale social media checkin data. Netw Spatial Econ 14(3):647–667. https://doi.org/10.1007/s1106701492644
Zhang S, Wang W, Ford J, Makedon Fillia Learning from Incomplete Ratings Using Nonnegative Matrix Factorization, pages 549–553
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
On behalf of all authors, the corresponding author states that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
The original online version of this article was revised due to a retrospective Open Access order.
The authors acknowledge the Program for Interdisciplinary and Industrial Internships at Illinois (PI4) and the Illinois Geometry Laboratory (IGL). The many IGL students who have made invaluable contributions to this work are: Raghav Bakshi, James Kerns, Xinyi Li, Xinyu Liu, Yicheng Pu, Gabriel Shindnes, Haozhe Wang, Jing Wang, Ziying Wang, Yu Wu, Zeyu Wu, Bin Xu, and Dajun Xu. The authors would also like to thank the Siebel Energy Institute for its support of this work. This material is based upon work supported by the National Science Foundation under Grant Numbers CMMI 1727785 and DMS 1345032. This work was also supported by a grant from the Siebel Energy Institute. The code for this work is at https://gitlab.engr.illinois.edu/TrafficPatterns/CSNMF.git
Sandia National Laboratories is a multimission laboratory operated by National Technology and Engineering Solutions of Sandia LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration. Sandia Labs has major research and development responsibilities in nuclear deterrence, global security, defense, energy technologies and economic competitiveness, with main facilities in Albuquerque, New Mexico, and Livermore, California.
This paper describes objective technical results and analysis. Any subjective views or opinions that might be expressed in the paper do not necessarily represent the views of the U.S. Department of Energy or the United States Government.
Appendix
Appendix
For completeness, let’s write down the calculations leading to the algorithm of Sect. 2.5.
Writing out \({\mathcal{E}}_{\beta ,\eta }\) of (5), we get
We seek to minimize this by alternating between minimization problems in W and H. Namely, if we start with a fixed \((W,H)\in \mathbb {R}^{T\times N}_+\times \mathbb {R}^{N\times L}_+\), we can construct a descent step for the function \({\mathcal{E}}_{\beta ,\eta }(W,\cdot )\) and then, letting \(H'\) be the result, we can construct a descent step for \({\mathcal{E}}_{\beta ,\eta }(\cdot ,H')\). This should decrease the value of \({\mathcal{E}}_{\beta ,\eta }\), and we can then proceed iteratively.
The gradients of \({\mathcal{E}}_{\beta ,\eta }\) in the directions of W and H are given by
and
As in Kim and Park (2008), we want to iteratively find the critical points of \({\mathcal{E}}_{\beta ,\eta }\), i.e. the solutions of
The above formulae suggest a multiplicative descent rule (which need not be gradient descent; see Lee and Seung (2001)). Fix \((W,H)\in \mathbb {R}_+^{T\times N}\times \mathbb {R}_+^{N\times L}\). Assume that
we can then decrease the value of \({\mathcal{E}}_{\beta ,\eta }\) by decreasing \(H_{n,\ell }\). Rewriting (14) as
or rather
since W, H, and D all have nonnegative entries, both sides of this equation are nonnegative. This in turn can be written as \({\chi _{n,\ell }^h(W,H)<1}\) where
Thus, another way to decrease \(H_{n,\ell }\) while still retaining nonnegativity is to multiply it by \(\chi _{n,\ell }^h(W,H)\). Reviewing these steps, we also see that if \(\frac{\partial {\mathcal{E}}_{\beta ,\eta }}{\partial H_{n,\ell }}<0\), we want to increase \(H_{n,\ell }\), and can again multiply by \(\chi _{n,\ell }^h(W,H)\). Finally, if \(\frac{\partial {\mathcal{E}}^\beta }{\partial H_{n,\ell }}=0\) (i.e., we have found a critical point) \(\chi _{n,\ell }^h(W,H)=1\), so multiplying \(H_{n,\ell }\) by \(\chi _{n,\ell }^h(W,H)\) leaves \(H_{n,\ell }\) unchanged.
The update rule for \(W_{t,n}\) is similar. To start, assume that
then we can decrease \({\mathcal{E}}_{\beta ,\eta }\) by decreasing \(W_{t,n}\). We can rewrite (15) as
We can again rewrite this as the comparison of two nonnegative quantities;
This in turn is equivalent to \(\chi _{t,n}^w(W,H)<1\) where
In other words, we can decrease \(W_{t,n}\) by multiplying by \(\chi _{t,n}^w(W,H)\). One can similarly see that if \(\frac{\partial {\mathcal{E}}^\beta }{\partial W_{t,n}}<0\), gradient descent again increases or decreases W with the same sign as multiplying by \(\chi _{t,n}^w(W,H)\).
Our proposed update rule for W and H is now
which is equivalent to (6).
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Karve, V., Yager, D., Abolhelm, M. et al. Seasonal Disorder in Urban Traffic Patterns: A Low Rank Analysis. J. Big Data Anal. Transp. 3, 43–60 (2021). https://doi.org/10.1007/s42421021000334
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s42421021000334
Keywords
 Traffic
 Normalization
 Sparse nonnegative matrix Factorization