{'fraction_non_alphanumeric': 0.03278865923601342, 'fraction_numerical': 0.011362406665945244, 'mean_word_length': 4.547418967587035, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modelling train delays with q-exponential functions

We demonstrate that the distribution of train delays on the British railway network is accurately described by q-exponential functions. We explain this by constructing an underlying superstatistical model.

A possible dynamical reason for q-statistics is a so-called superstatistics [5]. For superstatistical complex systems one has a superposition of ordinary local equilibrium statistical mechanics in local spatial cells, but there is a suitable intensive parameter β of the complex system that fluctuates on a relatively large spatio-temporal scale. This intensive parameter may be the inverse temperature, or the amplitude of noise in the system, or the energy dissipation in turbulent flows, or an environmental parameter, or simply a local variance parameter extracted from a suitable time series generated by the complex system [6]. The superstatistics approach has been the subject of various recent papers [7,8,9,10,11,12] and it has been applied to a variety of complex driven systems, such as Lagrangian [13,14] and Eulerian turbulence [15,6], defect turbulence [16], cosmic ray statistics [17], solar flares [18], environmental turbulence [19], hydroclimatic fluctuations [20], random networks [21], random matrix theory [22] and econophysics [23].
If the parameter β is distributed according to a particular probability distribution, the χ 2 -distribution, then the corresponding superstatistics, obtained by integrating over all β, is given by q-statistics [1,2,3,4], which means that there are q-exponentials and asymptotic power laws. For other distributions of the intensive parameter β, one ends up with more general asymptotic decays [8].
In this paper we intend to analyse yet another complex system where qstatistics seem to play an important role, and where a superstatistical model makes sense. We have analysed in detail the probability distributions of delays occuring on the British rail network. The advent of real-time train information on the internet for the British network (http://www.nationalrail.co.uk/ ldb/livedepartures.asp) has made it possible to gather a large amount of data and therefore to study the distribution of delays. Information on such delays is very valuable to the traveller. Published information is limited to a single point of the distribution -for example, the fraction of trains that arrive with 5 minutes of their scheduled time. Travellers thus have no information about whether the distribution has a long tail, or even about the mean delay. We find that the delays are well modelled by a q-exponential function, allowing a characterization of the distribution by two parameters, q and b. We will relate our observations to a superstatistical model of train delays. This paper is organized as follows: first, we describe our data and the methods used for the analysis. We then present our fitting results. In particular, we will demonstrate that q-exponentials provide a good fit of the train delay distributions, and we will show which parameters (q, b) are relevant for the various British rail network lines. In the final section, we will discuss a superstatistical model for train delays.

The data
We collected data on departure times for 23 major stations for the period September 2005 to October 2006, by software which downloads the real-time information webpage every minute for each station. As each train actually departs, the most recent delay value is saved to a database. The database now contains over two million train departures; for a busy station such as Manchester Piccadilly over 200,000 departures are recorded.

The model and parameter estimation
Preliminary investigation led us to believe that the model would fit well; here t is the delay, 0 < q < 2 and b > 0 are shape parameters, and c is a normalization parameter. We have e q,b, These limiting forms allow an initial estimate of the parameters; an accurate estimate is then obtained by nonlinear least-squares. We also have so that q measures the deviation from an exponential distribution. An estimated q larger than unity indicates a long-tailed distribution.
We did not include the zero-delay value in the fitted models. Typically 80% of trains record t = 0, indicating a delay of one minute or less (the resolution of the data). Thus, our model represents the conditional probability distribution of the delay, given that the train is delayed one minute or more.
In order to provide meaningful parameter confidence intervals, we weighted the data as follows. Since our data is in the form of a histogram, the distribution of the height c i of the bar representing the count of trains with delay i will be binomial. In fact, it is of course very close to Gaussian whenever c i is large enough, which is the case nearly always. The normalized height f i = c i /n (where n is the total number of trains) will therefore have standard i /n. We used these values as weights in the nonlinear least squares procedure, and hence computed parameter confidence intervals by standard methods, namely from the estimated parameter covariance matrix. We find that typically q and b have a correlation coefficient of about −0.5; thus, the very small confidence intervals quoted in the figure captions for b are not particularly useful; b typically acquires a larger uncertainty via its correlation with q.

Results
We first fitted the model to all data, obtaining the fit shown in Figure 1. This corresponds to a 'universality' assumption -if all routes had the same distribution of delays, the parameter values q = 1.355, b = 0.524 would be the relevant ones. We may thus compare the parameters for specific routes with these. Typical fits for three such routes are shown in Fig. 2, Fig. 3, and Fig. 4.

Superstatistical model
We start with a very simple model for the local departure statistics of trains. The waiting time distribution until departure takes place is simply given by that of a Poisson process [24] P (t|β) = βe −βt .
Here t is the time delay from the scheduled departure time, and β is a positive parameter. The symbol P (t|β) denotes the conditional probability density to observe the delay t provided the parameter β has a certain given value. Clearly, the above probability density is normalized. Large values of β mean that most trains depart very well in time, whereas small β describe a situation where long delays are rather frequent.
The above simple exponential model becomes superstatistical by making the parameter β a fluctuating random variable as well. These fluctuations describe large-scale temporal variations of the British rail network environment. For example, during the start of the holiday season, when there is many passengers, we expect that β is smaller than usual for a while, resulting in frequent delays. Similarly, if there is a problem with the track or if bad weather conditions exist, we also expect smaller values of β on average. The value of β is also be influenced by extreme events such as derailments, industrial action, terror alerts, etc.
The observed long-term distribution of train delays is then a mixture of exponential distributions where the parameter β fluctuates. If β is distributed with probability density f (β), and fluctuates on a large time scale, then one obtains the marginal distributions of train delays as It is this marginal distribution that is actually recorded in our data files.
Let us now construct a simple model for the distribution f (β). There may be n different Gaussian random variables X i , i = 1, . . . , n, that influence the dynamics of the positive random variable β in an additive way [25]. We may thus assume as a very simple model that where X i = 0 and X 2 i = 0. In this case the probability density of β is given by a χ 2 -distribution with n degrees of freedom: The average of β is given by and the variance by The integral (4) is easily evaluated and one obtains where q = 1 + 2/(n + 2) and b = 2β 0 /(2 − q). Our model generates qexponential distributions of train delays by a simple mechanism, namely a χ 2 -distributed parameter β of the local Poisson process.
Typical q-values obtained from our fits are in the region q = 1.15 . . . 1.35 (see Fig. 5 and Table 1). This means is in the region 4 . . . 11. This means the number of degrees of freedom influencing the value of β is just of the order we expected it to be: A few large-scale phenomena such as weather, seasonal effects, passenger fluctuations, signal failures, repairs of track, etc. seem to be relevant.  We can also estimate the average contribution of each degree of freedom, from the fitted value of b. We obtain If the above number is large for a given station, the local station management seems to be doing a good job, since in this case the local exponential decay of the delay times is as fast as it can be. In general, it makes sense to compare stations with the same q (the same number of external degrees of freedom of the network environment): The larger the value of b, the better the performance of this station under the given environmental conditions. Our analysis shows that two of the best performing busy stations according to this criterion are Cambridge and Edinburgh.