From Deterministic to Random Models: An Analysis of the New Spanish Overtaking Traffic Law

Abstract

The purpose of the research is to analyze the new Spanish law of Traffic, which no longer permits exceeding by up to 20 km/hour the generic speed limits when overtaking on conventional roads. In this research, deterministic and random models are developed to analyze the associated safety risks. The deterministic model highlights the importance of dimensional analysis and provides dimensionless abacuses to analyze the problem. Next, Bayesian networks and Bayesian models are used to build a random model from the previous one, providing a general method to convert deterministic into random models. In addition, the problems of ignoring the dimensions of the variables and parameters are discussed, a common mistake to be corrected. Some examples and multidimensional graphics illustrate the huge reduction in safety and the need to review the existing end of prohibition signs, most of which must be removed. Shortly, the research results show that the distance required for overtaking with safety increases drastically.

Share and Cite:

Castillo, E. , Duato, J. and Girón, J. (2023) From Deterministic to Random Models: An Analysis of the New Spanish Overtaking Traffic Law. Open Journal of Statistics, 13, 74-111. doi: 10.4236/ojs.2023.131006.

1. Introduction, Motivation and Objectives

Although this work was initially devoted to the study of the influence of the new Spanish law on overtaking in conventional roads (see https://www.boe.es/buscar/pdf/2015/BOE-A-2015-11722-consolidado.pdf Spa- nish new law [1] [2] ), which continues to be its main objective, during its writing, other no less important objectives have been identified, which are considered to be of great interest.

Therefore, the objectives of this work are the following.

1) Analyze the overtaking manoeuvre risks under the new traffic law. Since overtaking on conventional roads under the new law and its serious impact on safety has generated much controversy, we have decided to write this work to inform the society about the associated risks and show how probability and statistics can be of help in this and many other problems. In particular, the old and the new law (see https://www.boe.es/biblioteca_juridica/abrir_pdf.php?id=PUB-PB-2022-209) will be compared to show the relevance of the change.

2) Explain a general method to build deterministic models. Using as an illustrative example the problem dealt with, some of the required steps to build a deterministic model are discussed, and they are illustrated for this specific case, but which has general validity.

3) Highlight the importance of dimensional analysis. Since in our refereeing experience, important errors have been detected in statistical models with respect to variables with physical dimensions, we want to insist on the need to include a dimensional analysis in the models, which not only reduces their complexity, but avoids important dimensional errors. In the case of the traffic law, it will be seen that, although initially 5 functionally independent variables are considered and another 7 are functionally dependent on them, the dimensional analysis shows that there are only 3 independent dimensionless variables on which it functionally depends. This is a very important fact that is not widely known in the statistical area, and has negative consequences for efficient and correct modelling.

4) Point out the importance of dimensionless abacuses. Demonstrate, with an example, that this dimensional analysis allows building abacuses, which summarize many functional relations in one. This is the basic idea for the use and experimentation with reduced models, such as dams and structures, with which it is possible to move from reduced models to much larger models by simply preserving the values of these dimensionless variables, which reduce their number, but are able to capture all the factors influencing the problem.

5) Show the consequences of ignoring the dimensions of the problem variables. Describe the problems that arise when considering probabilistic models that ignore the physical dimensions of the variables and their consequences.

6) Explain how to convert deterministic models into random ones. Since we will convert our initial deterministic to a random model (see [3] [4] , who show the differences between both types of models), we take the opportunity to describe a general methodology for moving from deterministic to random models through the use of Bayesian networks and Bayesian models, which allow these models to be built and the joint distribution to be obtained very easily, not only for the variables, but also for the parameters, which adding a Bayesian perspective they are considered random.

7) Show some important virtues of the OpenBUGS methodology. Emphasize the reasons why OpenBUGS software relies on Bayesian networks and Bayesian methods, two complementary elements which guarantee simplicity, compatibility and general models.

8) Encourage graphical representation of multidimensional results. Show how multidimensional results can be represented by graphs of relationships by pairs of variables and joint graphs, as well as the importance of a good choice of colors that facilitates their interpretation.

This paper analyses the influence of the prohibition of exceeding the generic speed limits on conventional roads by up to 20 km/h when overtaking other vehicles, as the new law does.

Two methods are presented here, one deterministic and one random model. Both will be discussed. The results of the analysis are very clear: the extra accident risk imposed on drivers and their occupants with this new law is very high.

In addition, the entry into force of this law makes it necessary to analyse and redesign all the overtaking prohibition end signs, because of the new conditions imposed by the new law, since they prevent overtaking with reasonable safety if the speed of the overtaken vehicle is not considerably lower than the maximum permitted speed. This difference is close to 20 km/hour, which was allowed by the old law and is now abolished. Thus, the law change should have been forced only after the analysis and possible changes of the existing overtaking prohibition end signs, but never before. Failure to remove the existing signs would jeopardize safety, make this omission a huge mistake, and the main cause of many serious accidents if drivers try to abide by the new law.

Once the objectives have been indicated and the specific problem being mentioned, we show, first, how to build the deterministic model and, second, how the random model can be built based on it. This will allow us to analyze the risk implied by the new law and compare it with the old one.

2. Building a Deterministic Model of the Problem

In this section, a deterministic model of the problem is built, explaining in detail how it is done and commenting on its fundamental aspects, as advanced in [5] .

In our first model, to compensate for ignoring its truly random behaviour, we play with safety coefficients, as it is done in classical safety analysis. These coefficients are chosen so that the extreme values, which are those causing the accidents can be reached.

2.1. Distance Required for a Reasonably Safe Overtaking

We assume that a vehicle is traveling at speed v 0 and another vehicle traveling at speed v 1 wants to overtake it. We also assume that an oncoming vehicle suddenly appears at speed v 2 , which, to side with safety, is chosen to be v 2 = 1.3 v max , that is, it is overspeeding and it appears at the instant when the driver of the vehicle has just started the overtaking.

Figure 1 shows the road section affected by the overtaking with the three vehicles, illustrating the zone in which the overtaking occurs and the zone from which another oncoming vehicle appears.

We assume that the overtaking vehicle circulates just after the overtaken vehicle at a safe distance b 1 , moves to the left line, advances to overtake and returns to the right line again respecting a safe distance b 2 . We also assume a car appearing in the contrary direction that circulates at a speed v 2 , and finally, that a safety margin length is considered. As it can be seen, the strict overtaking distance apart from the term v 0 t , includes the distances between vehicles before, b 1 , and after, b 2 , and also their lengths, l 0 and l 1 .

Often, this speed, v 1 , will be v 0 , since vehicles will wait to reach the overtaking prohibition end sign to overtake. However, it is also possible that a vehicle circulates at v 1 > v 0 , having already decided to overtake. Here, we assume that the initial speed of the overtaking vehicle is v 1 = v 0 .

To calculate the distance required to overtake, we assume that the overtaking vehicle accelerates until it overtakes the overtaken vehicle and returns to the right lane, in which case it will be accelerating until the overtaking is complete, or until it reaches the maximum allowed speed, v max , driving at that speed until it returns to the right lane.

2.2. Time and Distance Required to Reach the Maximum Speed

First, the time needed to reach the maximum speed v max is calculated starting from v 1 . This time, which we will denote t 0 is:

t 0 = v max v 1 a , (1)

where a is the average acceleration used.

The distance needed by a vehicle to reach v max , denoted by d 0 , will be:

d 0 = v 1 t 0 + a t 0 2 / 2 = v 1 v max v 1 a + 1 2 a ( v max v 1 a ) 2 = v 1 v max a v 1 2 a + 1 2 ( v max v 1 ) 2 a = v max 2 v 1 2 2 a . (2)

Figure 1. Diagram of an overtaking with the overtaking vehicle in yellow, the overtaken vehicle in green, and the oncoming vehicle in red, showing the strict overtaking distance, the safety margin and the distance required for reasonably safe overtaking, along with the details of the overtaking zone and the origin zone of the assumed oncoming vehicle.

2.3. Time and Distance Required to Overtake

Figure 2 shows the diagram of the relative movement of the overtaking and the overtaken vehicles, showing that it requires a relative displacement between the two vehicles, l s , which is equal to

l s = b 1 + b 2 + l 0 + l 1 , (3)

that is, the sum of the initial gap between the two vehicles, b 1 , the final one, b 2 , after overtaking, plus the sum of the lengths of the two vehicles, l 0 and l 1 , respectively, as shown in Figure 2.

Next, the two cases that can occur are studied:

Case 1: The vehicle completes the overtaking before reaching v max . Then, the distance covered, in a time t, will be:

e 1 ( t ) = v 1 t + a t 2 / 2 ; t t 0 . (4)

Case 2: The vehicle completes the overtaking after reaching the maximum speed, v max . Then, the distance covered, in a time t, will be:

e 2 ( t ) = d 0 + v max ( t t 0 ) ; t t 0 . (5)

The distance traveled by the overtaken vehicle during time t will be:

e 0 ( t ) = v 0 t ; t 0 (6)

The required overtaking time will be:

Case 1. If the overtaking is completed while still accelerating (see Figure 1), the overtaking vehicle will have covered the distance traveled by the overtaken vehicle, e 0 ( t ) , plus the distance l s , namely.

e 1 ( t ) = e 0 ( t ) + l s = v 1 t + 1 2 a t 2 = v 0 t + l s , (7)

from which the second degree equation in t is obtained:

D = 1 2 a t 2 + ( v 1 v 0 ) t l s = 0 , (8)

where D is the indicated quadratic expression, whose only positive solution is the time elapsed until overtaking finishes:

Figure 2. Diagram of the relative movement of the overtaking and overtaken vehicles, showing that it requires a displacement, l s , which includes the lengths of both vehicles and the two safety distances, b 1 and b 2 , before and after overtaking, respectively.

t 1 = v 0 v 1 + ( v 1 v 0 ) 2 + 2 a l s a , (9)

where t 1 is the overtaking time in the case 1. Note that if D > 0 this means that the vehicle overtakes accelerating, and that, otherwise, the overtaking occurs at maximum speed.

Case 2. If the overtaking is completed after reaching the speed v max , the overtaking condition would be:

e 2 ( t ) = d 0 + v max ( t t 0 ) = e 0 ( t ) + l s (10)

namely

v max 2 v 1 2 2 a + v max ( t t 0 ) = v 0 t + l s , (11)

which can be written as

( v max v 0 ) t = l s + v max t 0 v max 2 v 1 2 2 a = l s + v max 2 2 v max v 1 + v 1 2 2 a = l s + ( v max v 1 ) 2 2 a , (12)

from which the elapsed time until overtaking obtained in this case is:

t 2 = l s + ( v max v 1 ) 2 2 a v max v 0 . (13)

Note that in case 1 the new law does not affect the driver during the overtaking, while in case 2, it does so by drastically limiting speed.

Thus, the strict distances required for overtaking are:

Case 1. If the overtaking is completed while still accelerating.

e 1 = e 1 ( t 1 ) = v 1 t 1 + 1 2 a t 1 2 . (14)

Case 2. If the overtaking is completed after reaching the speed v max .

e 2 = e 2 ( t 2 ) = d 0 + v max ( t 2 t 0 ) = v max 2 v 1 2 2 a + v max ( t 2 t 0 ) . (15)

Finally, the reasonable safety distance for overtaking, that is, between the overtaking and the oncoming vehicles is (see Figure 1):

L = { e 1 + v 2 t 1 + margin in case 1 , e 2 + v 2 t 2 + margin in case 2 , (16)

where margin is a safety distance, which, if desired, could be expressed as a factor of l s . In this case, a margin value = 40 m has been taken, which is already considered a very tight margin. It has been obtained based on the maximum speed, which is 90 km/hour, and considering the deceleration possibilities of the different vehicles. We have also taken into account that a driver may become very stressed when driving on a collision path against another vehicle. A distance as short as 40 m will make most drivers become very stressed, thus affecting the driver’s response and endangering their life.

2.4. Algorithm for Calculating the Lead Distance

Based on all the above, the following algorithm can be used to calculate the lead distance.

Step 1. Obtain the time needed to reach t0. The value of t0 is calculated using the Formula (1).

Step 2. Obtain the distance traveled to reach vmax. The value of d0 is calculated using the Formula (2).

Step 3. Evaluate criteria to differentiate cases 1 and 2. D is calculated, using the expression (8):

D = v 1 t + 1 2 a t 2 v 0 t l s . (17)

If D > 0 the vehicle overtakes before reaching the speed v max and we are in case 1. If D < 0 the vehicle advances after reaching the speed v max and we will be in case 2.

Step 4. Calculate the times, t1 and t2, that the overtaking lasts in cases 1 and 2, respectively. If D > 0 , t 1 is calculated using the Formula (9). If D < 0 , t 2 is calculated using the Formula (13).

Step 5. Calculate the strict distances required for overtaking. If D > 0 , e = e 1 ( t 1 ) is calculated using the Formula (14). If D < 0 , e = e 2 ( t 2 ) it is calculated using the Formula (15).

Step 6. Calculate the distance required to be able to overtake with reasonable safety. If D > 0 , L = e + v 2 ( t 1 ) + margin is calculated using the first formula in (16). If D < 0 , L = e + v 2 ( t 2 ) + margin is calculated using the second formula in (16).

2.5. Variables Involved in the Problem: Dimensional Analysis

From all this it follows that the five primary variables involved in the problem are:

v 0 , v 1 , v max , a , l s (18)

and the seven secondary ones, which can be obtained from the primary ones by means of the previous formulas

d 0 , e 1 , e 2 , t 0 , t 1 , t 2 and L . (19)

If we now use the Backingham’s Pi theorem (see the Buckingham theorem and the dimensional analysis theory in [6] [7] [8] ), it follows that, although there are 5 primary variables, only 3 primary dimensionless variables suffice, which, if v max and l s are used as normalizing variables, turn out to be:

v 0 v max , v 1 v max , a l s v max 2 , (20)

and the secondary variables:

d 0 l s , e 1 l s , e 2 l s , t 0 v max l s , t 1 v max l s , t 2 v max l s , L l s . (21)

We inform the reader that there are other alternative equally valid adimensionalization options.

Unfortunately, though there are some areas of knowledge that use, as the first step, of the modelling process, the variable adimensionalization, in the statistical area is not the common case. So, we take this opportunity to recommend its use in all practical applications of physical origin. This will lead to simpler and more efficient models.

2.6. Abacuses for Calculation of Overtaking Distance

The above formulas can be summarized graphically using abacuses, which greatly facilitate the study of the problem.

Since we have 5 variables in total, the graphical representation in two dimensions would require several abacuses. However, the use of the 3 dimensionless variables allows us to represent the problem in a single graph.

Figure 3 shows a dimensionless abacus that allows obtaining the dimensionless overtaking distances L / l s in each case, assuming that v 1 = v 0 , that is, the overtaking vehicle is behind the vehicle to be overtaken and travelling at the same speed, v 0 , which is the most frequent case.

Figure 3. Abacus providing the necessary distance to overtake for the new law when v 0 = v 1 .

Figure 3 has been obtained from expression (16), replacing the values of e 1 and e 2 from expressions (14) and (15), the values of t 1 and t 2 from expressions (9) and (13), respectively, adimensionalizing, using the denominators l s

and v max , and finally using the indicated dimensionless accelerations a l 2 v max 2 , of the three typical vehicle types.

The different curves correspond to the different possible vehicle accelerations. The less powerful vehicles correspond to the curves located higher up, and the

more powerful, to the lower ones. The legend shows the dimensionless coefficient, a l s v max 2 , corresponding to the acceleration. However, to facilitate its understanding, the time it takes for the vehicle to reach 100 km/hour is given if

l s = 30 m and v max = 100 km/hour. The 4 seconds case corresponds to very powerful vehicles, while 22 seconds corresponds to heavy ones. Common vehicles are in the range of 9 to 14 seconds.

For those not familiar with the Pi theorem, we emphasize that thanks to it, a single abacus is valid for all cases, while, otherwise, different abacuses would be needed for the different values of the variable v max .

2.7. Comparison of the Old and New Laws

To facilitate the comparison between the old and the new laws, the abacus corresponding to the old law has also been developed, and the corresponding superimposed abacuses are shown in Figure 4.

Figure 4. Abacuses providing the necessary distance to overtake for the old and new laws, when v 0 = v 1 .

Note that there are three regions. The first, on the left, is the region where there are no differences between both laws, the central one corresponds to the new law, and the one on the right, to the old law.

In this way, it can be verified that for a fixed value of v 0 / v max , the required overtaking distances, with reasonable safety, increase considerably with the new law and go asymptotically to infinity when the speeds of both vehicles, the overtaken and the one overtaking have the same speeds.

As an illustrative example, the differences in the overtaking required dimensionless distance, L / l s , for v 0 / v max = 0.8 goes from 8 to 15 for the old law to 13 to 17 for the new law and for v 0 / v max = 0.9 goes from 11 to 16 for the old law to 26 to 28 for the new law, which clearly shows the important increases, which makes overtaking almost impossible.

2.8. Examples

In order to make the comparison of both laws clearer, in Table 1 and Table 2,

Table 1. Comparison of reasonably safe overtaking distances for different combinations of the speed and acceleration of the overtaking vehicle, assuming a maximum speed v max = 90 km/hour.

Table 2. Comparison of the durations, t o and t n , associated with the old and new laws, respectively, of reasonably safe overtaking for different combinations of the speed and acceleration of the overtaking vehicle, assuming a maximum speed v max = 90 km/hour.

the corresponding distances, L o and L n , are given and the times, t o and t n , of overtaking according to the old and new laws, respectively, are shown. They correspond to a representative value l s = 30 m, three common speeds of the vehicle to be overtaken of v 0 = 60 , 70 and 80 km/hour and three common

values of the acceleration a l s v max 2 = 0.049 , 0.09 and 0.27 of the three types of vehicles (truck, car and motorcycle).

They correspond to the two extreme curves, the upper and the lower ones, and to an intermediate one in the abacus. It can be seen how, for reduced speeds, there are no differences or they are very small, but for speeds close to v max the increments, both in distances and times, are very large and very dangerous.

For example, if the maximum speed allowed on the section is 90 km/hour, and you are trying to overtake a vehicle traveling at 80 km/hour, the distance required to overtake with reasonable safety would be above 700 m, more than double than with the old law. Overtaking times would exceed 11 seconds, much more than under the old law.

2.9. Conclusions of the Classic Safety Study

The first conclusion is that the resulting overtaking distances with the new law are considerably larger than those corresponding to the old law, which significantly reduces the ability to overtake. To get an idea, l s can be close to 30 m, in the case of cars and motorcycles, and much higher if one or both of them are trucks, which implies that multiplying the values in ordinates gives the distance L, which is very high.

Furthermore, an analysis of the abacus in Figure 3 leads to the following conclusions:

1) As indicated by the abacus on the right, the new approved law practically prevents overtaking on many sections of the roads involved, when the vehicle to be overtaken is traveling at more than 85% or 90% of the maximum speed v max , since the reasonable safe distance of the lead increases a lot and becomes infinity for v 0 = v max .

2) The area corresponding to case 2, indicated as the overtaking area at v max , is the area affected by the new law, which prevents drivers from leaving the dangerous left lane as soon as possible, greatly affecting the distance of overtaking and increasing the risk of accident. It is especially affected when v 0 exceeds 70% of v max .

3) Given that drivers cannot have this complex abacus in their heads, they cannot assess the enormous limitation that the new law implies and know the reasonable overtaking speed in each case, which will make them attempt overtaking even though they will not be able to complete it, by complying with it, with the consequent very serious risk of accident, which in many cases will be fatal.

4) Furthermore, this is valid for all vehicle accelerations, as seen on the abacus, which shows that the band of the different accelerations narrows a lot in the area where v 0 / v max exceeds the 85%, indicating that acceleration has very little influence there.

5) To overtake, drivers would be forced to request those 20 km/hour differentials, which the old law gave them, to the vehicles they overtake. If they do not slow down, in many cases, they will not be able to overtake.

6) If the placement of the overtaking prohibition end signs does not take into account the new law, the consequences that this will produce will be desastrous.

7) Finally, the abacus in Figure 4 can be used to compare the old law with the new one. As it can be seen, when the maximum speed is increased by 20 Km/hour, what happens is that curves shift to the right of the abacus, which greatly reduces the risk. Therefore, this law change can be classified as unfortunate.

In summary, two abacuses have been given, which allows us to obtain the strict overtaking distances in all situations and compare the old and new laws showing that if the overtaken vehicle travels above 85% or 90% of the maximum speed it is practically impossible and extremely dangerous to overtake.

3. Problem Random Model: Bayesian Network

As the problem under study is actually random, it deserves a study, as such, to draw much more reliable and precise conclusions than those given by the classical deterministic model. In fact, probabilistic safety analyses represent an important paradigm shift with respect to safety, which are carried out in the most dangerous branches of engineering, such as aeronautics and nuclear power plants. Recently, these analyses have been extended to the case of railway lines, roads and highways. You can see, for example, [9] [10] were Bayesian networks are used to reproduce in detail roads and railway lines to detect risks and quantify the probability of them.

This work wants to contribute its grain of sand in this direction, highlighting the importance and differences between classical safety treatments and probabilistic safety analyses. In this specific case, this implies carrying out the study of overtaking considering all the most unfavorable possible combinations of the variables v 0 , v 1 , v max , a, l s , etc. which guaranties considering those combinations, which are the ones that, when they coincide, lead to the vast majority of accidents.

As indicated, we will build the random model starting from the deterministic model. We will use both, Bayesian networks and Bayesian methods, that is, we will also assume that the model parameters are random. In fact, we will use the OpenBUGS standard statistical structure, which has been selected because of simplicity, generality, consistency and non-parametric properties. This will be explained below.

3.1. Why OpenBUGS Enforces Bayesian Network Structure and Includes Model Parameters as Additional Variables

Bayesian networks, whose father was Judea Pearl (see [11] for one of the most important publications on Bayesian networks), who inspired many statisticians and, in particular, the book [12] [13] , provides a detailed description of this very powerful tool to deal with multivariate random variables.

A Bayesian network contains two parts, an acyclic graph, which defines the list of variables involved in the problem and their local dependency relationships, and a list of conditional probabilities, which defines the joint probability of all variables and, indirectly, an order of the set of variables. Although any order of variables is valid, some lead to more compact expressions than others.

This graph plays a very relevant role for the definition of the joint probability of the model, which is the product of the probabilities of each node conditioned on its parents, where those probabilities are defined by the links or the arrows of the graph, that is:

p ( x 1 , x 2 , , x n ) = i = 1 n p ( x i | p a ( x i ) ) , i = 1 , 2 , , n , (22)

where the functions p ( ) must be interpreted as a density or probability function, depending on whether the variables are continuous or discrete, respectively, and p a ( x i ) is the set of parents of the node associated with x i .

Note that while in a model in which all the variables are independent, the density or joint probability function is the product of the marginal densities of all single variables, here, which is the general case, these are replaced by those conditioned on their parents. In addition, neither the marginal distributions, in the case of independence, nor the conditional ones, in the general case, are subject to any special extra condition, except that of being valid as density or probability functions. This is a very relevant and valuable result in modelling.

In this way, not only a very simple and compact valid model is ensured, in the sense that the resulting product is always a joint probability-density function of all the variables but, more important, the resulting model is also consistent, that is, if the probabilities of the nodes conditioned on its parents were obtained from this joint distribution, precisely the corresponding factors of the product would be obtained, that is, they are compatible.

We mention that there are other ways of defining this joint distribution by means of some marginals and conditionals, see, for example, [20] [21] , where it is shown how the joint distribution of multivariate random variables can be defined by means of conditionals and warning about possible inconsistencies. However, the reader must be aware that alternative methods to define the joint density, as some based on subsets of some marginals and conditionals fail to satisfy this important consistency condition, as it can be seen in [22] . This justifies the selection of Bayesian networks as a universal and safe way to define compatible joint distributions.

The reader can see several interesting applications of probabilistic and Bayesian networks models, for example, in [10] [14] - [19] , were interesting practical applications are explained.

The second important property offered by OpenBUGS is the possibility of including Bayesian models, that is, models whose parameters are random.

The most elegant and clear way of doing it is by incorporating the parameters as additional random variables, enlarging the acyclic graph and the sets of conditional probabilities by using priors.

The reader must be aware that this implies using mixtures of distributions, a very important extension of the underlying models. In fact, with mixtures one can produce practically any distribution. If we are in front of a problem with large samples (big data, for example), the role of priors disappears and we can consider that our models show a desired generality, which is not present without the mixtures.

The two previous elements, Bayesian networks and Bayesian models, justify the use of the statistical structures of OpenBUGS and warn users about the indiscriminate use of some alternative models.

3.2. Building the Random Model Starting from the Deterministic Model

As indicated, we use the traffic example as an illustrative case of a very general method, which allows converting deterministic models into random ones, through the use of Bayesian networks.

The model can be built using the following steps:

1) Build the acyclic graph of the Bayesian network using the formulas of the deterministic model. These formulas express some variables in terms of others, so that the former can be considered the sons or daughters and the latter the corresponding parents. This implies an ordering of the variables and some links of the graph. For example, Expressions (1), (2), (3), (4), (5), (8), (9), (13) and (16) define the variables t 0 , d 0 , l s , e 1 , e 2 , D , t 2 and L, in terms of their right hand side variables (see the acyclic graph in Figure 5).

2) Identify the model parameters and constants. Discover which variables are not written in terms of another variables. They will be the model parameters and the constants, which will become the additional variables. Once the previous variables are incorporated to the acyclic graph, they will appear as terminals of the branches of the acyclic graph.

Examples of parameters are the acceleration a or the speeds v0, v and v2. Examples of constants are b1 and b2.

3) Define the priors for the parameters and incorporate them as additional variables. Some examples are a min , a max or the shape and scale Weibull parameters.

4) Complete the conditional probabilities with the previous priors. Add them to the set of conditional probabilities.

5) Incorporate other required variables. In some cases it will be necessary to incorporate some more variables or parameters, for example, to enrich the learning possibilities of the model.

For example, as it will be seen, the variables Ymp[k], which have been assumed to be Dirichlet, are necessary to be able to learn the random proportions of motorcycles, cars and trucks, which would otherwise be fixed instead of

Figure 5. Directed acyclic graph of the Bayesian network, in which all the variables, including the parameters, which are considered random, and the direct dependency relationships are shown by means of arrows.

random variables.

Figure 5 shows the acyclic graph that has been considered for the Bayesian network, in which all the variables involved can be seen, including the parameters, as well as the local dependency relationships, that is, the direct dependencies of child variables on parent variables. Note that there are variables that depend on the index i, variables that depend on the index k, and variables that do not depend on any of them. The different groups have been included in two rectangles, the first two groups, and outside of them, the third.

To understand this graph and the rest of the work, the reader should use the notation that appears at the end of this work. A first reading of this is highly recommended.

4. Prior Distributions, Data Collection and Learning

The second part of the Bayesian network consists of defining the conditional probabilities, that is, those of each variable conditional on its parents.

Initially, it is assumed that there are no data, so it will be necessary to give some “a priori” probabilities, a term that refers to the fact that they are prior to the data, that is, previous to all knowledge.

Once the data is available, the model is able to improve the “a priori” distributions and generate “a posteriori” distributions, which already include the information contained in the data on the joint distribution of the variables. Therefore, this process is actually a learning process, which consists of altering the parameters, so that the model better fits the reality shown in the data.

In choosing “a priori” distributions, one can take a very rigid attitude, giving little freedom, or, conversely, leave many possibilities open; this is the case of non-informative distributions, in which very little or almost nothing is said about the variables. For example, it is quite common to adopt wide uniform distributions as “a priori” distributions, which do not discriminate certain parameter values over other ones.

Finally, it should be noted that the non-informative hypotheses of uniform distributions that are generally assumed are more aimed at fixing the variation ranges than anything else, since it is known that with not very large sample sizes, the weight of these distributions becomes practically null. The same happens with the assumed Weibull distributions, which define the range, whose finite lower limit is given or estimated and the upper limit is infinite, but they also have modes, which means that they are more inclined to some values of the parameters than to other ones.

In this example, the Weibull distributions have been considered as appropriate for the “a priori” distributions, so they are informative.

4.1. The Prior Distributions Used

In this work almost all the conditional distributions have been chosen as Weibull distributions.

Figure 6 shows the “a priori” Weibull density functions, assumed for the distances, l 0 , the accelerations, a, and the velocities, v0, of the vehicle advanced, of the three types of vehicles, motorcycles, cars and trucks, respectively.

The densities give us a very clear idea of how these speeds have been assumed and the corresponding distribution functions will allow us to determine the proportions of vehicles with high overtaking times or distances above certain specific values, which will show the high associated risks.

Table 3 shows the location, scale and shape parameters of the Weibull distributions, which, in the absence of real data, have been determined by fixing three percentiles: the minimum or zero percentile, and the percentiles 0.05 and 0.999. Note that the units of measurement used in Figure 6 and in Table 3 are not always the same, so to compare, the corresponding change of units would have to be made. In particular, in Figure 6 m has been used for distances and m/sec2 for accelerations, instead of the lesser used units of km and km/hour2, which are less familiar to us.

4.2. Important Considerations about the Dimensionality of the Variables and Their Consequences. Weibull Distributions

An important error when giving the parameters of the distributions is to omit

Figure 6. Weibull density functions “a priori”, assumed for the distances, l 0 , the accelerations, a and the velocities of the vehicle ahead, v0, of the three types of vehicles: motorcycles, cars and trucks.

their dimensions when they have them, in which case the information provided would be incomplete.

The dimensions of the location and scale parameters have to coincide with the dimensions of the data, since the former responds to a translation, that is, to add a value to a reference variable, and the latter is supposed to result from multiplying the data by dimensionless constants (changes of scale). Thus, if the data are lengths or volumes, for example, so must be the location and scale parameters.

In addition, it should be noted here that the arguments of the exponential, power, logarithmic, and trigonometric functions must always be dimensionless. This is an important rule to apply.

For example, the Weibull cumulative distribution and density functions used in OpenBUGS, for a two-parameter, location λ and scale v, Weibull distribution are, respectively:

F ( x ) = 1 exp ( λ x v ) and f ( x ) = v λ x v 1 exp ( λ x v ) ; x > 0 , (23)

which implies two parameters λ and v, which are intended to be, one for scale, the first, and another for shape, the second.

Table 3. Parameters of the Weibull “a priori” distributions of the distances, l 0 , the accelerations, a, and the velocities, v0, of the passed vehicle.

Since the argument λ x v of the exponential function must be dimensionless, λ, must have dimensions dependent on the shape parameter, v, and not coincident with those of the random variable x, so its dimensions cannot be known until the value of v is known, and they will be different for different samples. Therefore it would not be correct to call it a scale parameter. Fortunately, the shape parameter, v, is dimensionless, as it corresponds to shape parameters.

Therefore, it would be better to use the expressions:

F ( x ) = 1 exp [ ( x ρ ) v ] and f ( x ) = v ρ ( x ρ ) v 1 exp [ ( x ρ ) v ] ; x > 0 , (24)

instead of (23), in which the parameter ρ has the same dimensions as the random variable X, regardless of the value of v and also the quotient x / ρ of the exponential function is dimensionless, as it should be.

This correction has been made to all Weibull functions in this example.

From (23) and (24) it follows that:

ρ = λ 1 / v or λ = ρ v , (25)

which allows us to solve the problem.

The inverse function of the left hand side of (24) is:

x = ρ ( log ( 1 p ) ) 1 / v ; p ( 0 , 1 ) , (26)

which allows estimating the parameters ρ and v from two percentiles x 1 and x 2 , corresponding to the values p 1 and p 2 , respectively, using the formulas:

v = log ( log ( 1 p 1 ) log ( 1 p 2 ) ) log ( x 1 x 2 ) : ρ = x 1 ( log ( 1 p 1 ) ) 1 / v or ρ = x 2 ( log ( 1 p 2 ) ) 1 / v . (27)

For a description of how to build coherent and compatible models, see [8] [23] [24] [25] . This will avoid common and serious errors in modelling.

4.3. Data Collection

Once the problem and the Bayesian network to be used have been defined, data collection and learning must be carried out. For this, it is necessary to obtain the “a posteriori” distributions, which define the distributions as mixtures of the selected families.

In this case that concerns us with the overtaking of vehicles, samples are relatively easy to obtain and can have very large sizes, so learning the real probabilities in each case is relatively simple and easy. In fact, the General Directorate of Traffic has a lot of data and, in addition, they can be obtained for each section under study very easily (https://www.dgt.es/menusecundario/dgt-en-cifras/dgt-en-cifras-resultados/dgt-en-cifras-detalle/?id=00004).

4.4. Differences between Classical and Bayesian Models from the Learning Point of View

While learning in classical models consists of obtaining estimates of the parameters, learning is now based on improving the joint distribution of the parameters, and, indirectly, the joint distribution of variables and parameters.

It is important for the reader to understand how Bayesian methods work and what their differences are with respect to the classical statistical methods, in which families of distributions are assumed and the one that best fits the data is sought. Therefore, in these methods we do not go outside the families chosen for the model and we simply choose a distribution of that family that is considered the best, once the data has been considered. The differences are even larger in the case of hypotheses tests (see [26] for a detailed analysis of the new and original proposal to deal with hypotheses testing).

On the contrary, Bayesian methods, by assuming that the parameters of a model are random, work with convex linear combinations of distributions, that is, polytopes or mixtures of distributions, which can be quite different from the initially chosen families. In fact, the Bayesian posterior distribution almost never is a distribution of those families. In our case, using Weibull distribution priors is sensible as any distribution on the positive real line is a mixture of Weibull distributions or a limit of them. On the other hand, Gamma distributions could also have been considered as prior distributions, as any distribution on the positive real line is a mixture of Gamma’s or a limit of them. It should be noted that this is very important, since the set of possible solutions, through these combinations, has almost no restrictions, while imposing that they belong to a certain family has very strong restrictions in general. In addition Judea Pearl has added the possibility of deriving causal relations (see [27] [28] , where a whole treatment of the causes is done).

4.5. Implementation of the Model in OpenBUGS

To reproduce the probabilistic structure of the model and subsequently carry out the learning, the well-known and important OpenBUGS application has been used, which is described in [29] . The instructions used are indicated in Figure 7. To analyze the old law, simply change the values of xexcess to the value 20 Km/hour and the value threshold to the value 1.

Figure 8 shows the list of the data file used in OpenBUGS, which contains some variables or parameters and the observed data. It can be seen in it that N = 21 , since a test sample of 20 vehicles has been considered, reserving the index 21 for the analysis variable, that is, an unobserved variable that could be or not observed in the future. In this way the marginal distribution of this variable or any joint distribution including it can be analyzed.

In this study, samples of sizes 20, 100 and 500 have been used. We want to remark that the chosen a priori Weibull distributions in Table 3 are very informative. Recall that, if one has a priori sensible or good information, as is our case, it should be incorporated in the Bayesian model as an a priori distribution; otherwise, choose a non informative or reference prior.

Figure 7. OpenBUGS code used.

Figure 8. Data OpenBUGS file used.

Small differences have been observed for the different sample sizes, which implies that the “a priori” distributions of the Weibull type match very well with the actual data, independently of the sample size. This makes sense here, since this is a very well-known problem and it is relatively easy to define these random variables without deviating too much from reality. Also, the two-parameter Weibull distribution included in OpenBUGS has been augmented with location parameters, making it actually a three-parameter family.

4.6. Hypotheses Made in the Implementation in OpenBUGS

As can be seen, in the list of instructions in Figure 7, the following hypotheses have been made:

1) The proposed model reproduces only a road section in which overtaking is allowed, considering its particular data and, especially, its distance, L f r e e . Therefore, in practice, it is necessary to make an evaluation of each particular section separately and decide if it meets the sufficient and reasonable safety conditions, based on the resulting probabilities of being able or not to overtake in the section been analyzed. If this is not the case, overtaking must be prohibited or the overtaking prohibition end sign at the beginning of the section must be eliminated, if it exists.

2) It has been assumed that three types of vehicles circulate, which correspond to motorcycles ( V h 1 ), cars ( V h 2 ) and trucks ( V h 3 ), whose proportions, p 1 , p 2 and p 3 , have been assumed random of the Dirichlet type, with “a priori” parameters 0.1, 0.8, and 0.1, respectively, which are initially equivalent to those proportions. This assumes that the model has the ability to learn about the parameters p, from the data. The Dirichlet distribution has been generated by simulating three independent gamma variables and dividing by their sum.

3) Two maximum speeds have been assumed, v max 0 = 90 km/hour and v max 1 = 80 km/hour, the first for motorcycles and cars and the second for trucks. As will be seen, this difference makes it easier for motorcycles and cars to overtake trucks, since at least 10 km/hour is the starting point, which is very important.

4) For simplicity, the minimum distances between vehicles, b 1 and b 2 , before and after overtaking, respectively, have been assumed fixed and equal to 8 m and 15 m, respectively.

5) The “a priori” distributions of the vehicle velocities, v 0 , v 1 and v 2 , the leading one, the overtaking one and the one that can appear head-on, have been assumed to be Weibull to reproduce the asymmetry. Although the data greatly diminishes the effect of the “a priori” distribution, it has been considered better to give distributions skewed to the right, such as those of Weibull.

6) It is assumed that the overtaken vehicle does not change its speed during overtaking.

7) Only overtaking produced by vehicles driving behind the vehicle to be overtaken is assumed, starting from the speed of the overtaking vehicle and accelerating, if necessary, up to the maximum allowed for its type, maintaining that speed until the overtaking is complete.

8) Weibull “a priori” distributions are also assumed for the lengths and accelerations of the vehicles, with the values of the parameters indicated in Table 3, that is, with the density functions in Figure 6.

9) The variables t 0 , t 1 , t 2 , D , e 1 , e 2 , e , l s and L, are supposed to respond to the same formulas of the case analyzed in the first part of this work, but with the parameters (distances, speeds and accelerations) assumed to be random.

10) In the case of the new law, it is assumed that the driver will not overtake if the speed of the vehicle to be overtaken is greater than 95% of the maximum allowed, since such a small difference leads to very high overtaking times and distances and, therefore, to very risky maneuvers.

11) To test learning, we have assumed sample sizes of 0, 20, 100 and 500 vehicles, with simulated data.

4.7. Model Learning. Montecarlo Simulation of Markov Models and One-Dimensional Analysis of the Results

With this “a priori” information, all the variables have been simulated 1000 times, in an initiation or heating phase, until the stabilization of the process. Next, 3000 more times have been simulated, verifying that it is enough for the convergence of results. This implies that learning has occurred, that is, that the “a posteriori” simulations have incorporated all the information that the sample used contains about the variables and parameters.

It must be said that OpenBUGS supplies simulations of a very large size, in fact this size can be selected by the user, to give the learning results. These simulations are then used to draw the densities or probabilities that follow, that is, it replaces the complex analytical expressions of the posterior by the samples.

Figure 9 shows the posterior density and distribution functions of the variables, a, l 0 and l s . It can be easily seen that they consist of mixing the three distributions of motorcycles, cars and trucks. For example, for the accelerations a, three clearly differentiated zones are seen, one, on the left, of low accelerations corresponding to the trucks, a central one, which corresponds to the average accelerations of the cars, and, finally, that of the right that corresponds to the high accelerations of the motorcycles.

Figure 9. Functions of density and distribution “a posteriori” of the variables, a, l 0 and l s .

The densities of the lengths of the vehicles l 0 also clearly show the differences between the three types of vehicles with their three modes.

The variable l s presents more peaks due to combining the lengths of the types of vehicles being overtaken and the overtaking distance, which gives 9 possible combinations. Note that the inflection points of the distribution functions correspond to the maxima of the density functions of the continuous variables, from which the risk of accident due to overtaking in each of them can be evaluated, in the assumed situation, that is, that the driver obeys the new law in the event that an oncoming vehicle appears when the overtaking starts.

Figure 10 shows the posterior probability density and distribution functions of v 0 , v max and D.

Figure 10. Posterior probability density and distribution functions of the variables, v 0 , v max and D.

The variable v 0 is affected by the difficulty of overtaking, producing a concentration of vehicles that circulate at 75 and 85 km/hour that cannot overtake, trucks, the former, and motorcycles and automobiles, the latter, because those 5 km/hour difference is clearly insufficient for overtaking, since it has been assumed a maximum allowed speed of 80 and 90 km/hour, respectively. This explains the two modes that appear.

The variable v max for the cases of the old and new law is displaced by a value of 20 km/hour that now disappears in the new law.

Finally, the variable D, which defines cases 1 and 2, depending on whether it takes positive or negative values, supposes the need to finish overtaking at maximum speed or to do it before having reached it, respectively. The figure shows the random variable D, in the case of the old law, in red, and the new law, in black. It can be immediately seen that the value of D decreases substantially in the case of the new law and in fact is always negative, which indicates that practically no vehicle overtakes by accelerating, and also shows that all vehicles need to reach the maximum speed and finish overtaking at that speed, something that did not happen with the old law, in which 18% of the vehicles overtook while accelerating.

Figure 11 shows the posterior probability density and distribution functions of the times t1 and t2, necessary to advance in cases 1 and 2 and the total time, t.

The time, t1, needed to reach the maximum speed is around 5 seconds for motorcycles and cars, and around 9 seconds for trucks, with the old law.

The comparison of the functions for the case of the variables t2 and t indicate that the differences are practically imperceptible, which is due to the fact that only, in any case, a very small part of the overtaking occurs when accelerating.

Note the great increase in the time required for overtaking due to the new law. While with the old law there were two modes, (maxima), one at 5 seconds and another at 7 seconds, with the new law they go to be 9 and 26 seconds, respectively, which is a very notable increase. For example, it can be seen that while only 1% of the vehicles needed more than 10 seconds to overtake with the old law, with the new law they are 50% of them. In addition, while with the new law 28% need more than 20 seconds to overtake, it was only a negligible percentage in the case of the old law.

Figure 11. Posterior probability density and distribution functions of the time variables, t1 and t2, necessary to advance in cases 1 and 2 and the total time, t.

Figure 12 shows the posterior probability density and distribution functions of the overtaking distance variables, e1 and e2, in cases 1 and 2, respectively, and the total distance, e, as well as the distance, L, required to set the end of prohibition sign.

Something analogous occurs with the necessary distance, e, to overtake, which with the new law is more than 300 m for 38% of vehicles, and more than 500 m for 28% of vehicles, while with the old law they were only 1% of the vehicles and a negligible proportion, respectively. Note that it represents a very notable increase in risk.

Finally, for the free distance, L, needed to prohibit overtaking or remove the end of prohibition of overtaking signs, almost none of the overtaking required more than 600 m and only 1% of them required more than 1000 m with the old law, now with the new law they become 38% and 28%, respectively. This gives an idea, again, of the notable increase in the overtaking risks if the law is respected, which should make those responsible for the measure—including deputies and senators of the Spanish Parliament, who gave their approval—reflect.

Figure 12. Posterior probability density and distribution functions of the overtaking distance variables, e1 and e2, in cases 1 and 2, and the total distance, e, as well as the distance, L, required to put the end of prohibition sign.

It should be noted that this figure is of great importance and plays a fundamental role in making the decision whether or not to allow overtaking in a given section, depending on its distance, L f r e e , and speed limitations. and their characteristics.

Figure 13 shows the posterior probability functions of the vehicle types V h 0 , V h 1 and V h 2 . Since the vehicles come from the same population, although independent samples are generated, it is not surprising that practically identical figures come out. However, while they do not match the prior probabilities, which were 0.1, 0.8, and 0.1, for motorcycles, cars, and trucks, respectively, they are quite close to them. As additional information, in the sample of size n = 500 , the proportions of vehicles V h 0 , V h 1 and V h 2 were 0.182, 0.712, 0.106, 0.169, 0.715, 0.116 and 0.173, 0.710, 0.117, respectively.

It is important to note that the variables involved in this problem are closely related, so almost all of them have information about the others. For example, the accelerations, a, and the speeds, v0, of the vehicles or the overtaking times, t, and the corresponding lengths, e, tell us a lot about the type of vehicle, even when this information were not contained in the sample.

4.8. Multidimensional Analysis of the Results

Figure 14 gives the diagrams of cross relationships between the variables l 0 , l 1 , a , t and v 0 after normalizing them, showing, on the same scale, the results of the simulations ‘a posteriori’, in the cases of the old law (in blue) and the new law (in red). In it, you can easily see the differences between the different variables and their relationships.

In particular, it can be seen how the red spots extend much further than the blue ones to the most dangerous areas with the longest times required for overtaking, which correspond to the graphs in the fourth row and fourth column, which allows us to conclude that these are much more dangerous under the new law.

It should also be noted that asymptotic behavior is observed in the cases of the variable t, time required for overtaking, which takes values that tend to infinity, as shown by the graphs in the fourth row and fifth column and in the fifth row and fourth column. This implies that if the difference between the speed of the

Figure 13. Posterior probability density and distribution functions of the vehicle type variables V h 0 , V h 1 and V h 3 .

Figure 14. Multivariate diagram showing the pair relationships between the variables l 0 , l 1 , a , t and v 0 for the cases of the old law (in blue color) and the new one (in red color) demonstrating the noticeable increase in the danger of overtaking.

vehicle to be overtaken and the maximum allowed is not at least 15 or 20 km/hour, just what the new law now eliminates, overtaking will be very dangerous and cannot be carried out. Note that there are two asymptotes, located at the height of 85 and 75 km/hour and that they correspond to motorcycles and cars, the first, and to trucks, the second.

The graphs in this figure that do not include the variable t and that appear in blue are actually identical for the two laws, but when the blue points are superimposed on the red ones, the red color disappears.

To facilitate the understanding of the graphs that follow, colors are used. Thus, to distinguish the type of vehicle ahead, reddish colors are used when the vehicle ahead is a motorcycle, green, when it is a car, and blue, when it is a truck. In addition, to distinguish overtaking vehicles, darker colors are used as their size increases. Table 4 shows the criteria used for coloration. Therefore, the colors indicate the 9 combinations of overtaking and overtaken vehicle types.

The variables e, distance needed to overtake, and L free distance needed to overtake, including the presence of possible oncoming vehicles, present graphs very similar to the variable t, as shown in Figure 15. For this reason, from now on, only the variable t will be shown, which gives the necessary time to advance.

The l 0 v 0 diagrams, shown in Figure 16, are very similar for the new and old laws, with the only exception that the speeds of the overtaking vehicles are lower in the new law and do not reach 90 km/hour.

Figure 15. Multivariate diagram showing the relationships between the variables L, e and t with the variables l 0 , l 1 , a and v 0 for the cases of the old law (above) and the new one (below). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

Figure 16. Multivariate plot showing the relationships between the variables l 0 and v 0 for the cases of the old law (left) and the new law (right). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

Table 4. Explanation of the colors used to distinguish the types of vehicles ahead and the one that overtakes.

The l 0 t diagrams are shown in Figure 17, in which it is verified that in the case of the old law it is seen that the motorcycles overtake very quickly, then the cars follow and, finally, the trucks. It also shows that overtaking time does not depend much on the vehicle being overtaken, although it increases from motorcycles to cars and from these to trucks.

In the case of the new law, there is a notable increase in overtaking times, but it is observed that there is a fraction of all types of vehicles that have very serious overtaking difficulties. While in the old law the types of vehicles are separated, in the new one they are mixed.

Finally, the v 0 t diagrams of both laws, which appear in Figure 18, although they have identical color ordering, are very different because in the case of the new law an asymptotic behavior appears, since the overtaking times increase a lot when the speed of the overtaken vehicle is close to the maximum allowed and can tend to infinity.

Figure 17. Multivariate plot showing the relationships between the variables l 0 and t for the cases of the old law (left) and the new law (right). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

Figure 18. Multivariate plot showing the relationships between the variables v 0 and t for the cases of the old law (left) and the new one (right). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

It is interesting to note that overtaking times increase primarily with the size of the vehicle being overtaken. That is to say, the cases with reddish colors are more favorable than the greenish ones and these better than the bluish ones and, to a lesser degree, with that of the overtaking vehicle, that is, the darker the color, the more time is necessary for overtaking,

Figure 19 shows the multivariate plot showing the relationships between the variables V h 1 , V h 0 , l 0 , l 1 , a , t , e , L and v 0 for the cases of the old law (left) and the new law (right). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

From it, conclusions can be drawn on the dependencies between more than two variables, since the segments join the points that correspond to the same overtaking, which is one of the data.

A simple glance at the figures of the two laws allows us to observe how the new law equates motorcycles, cars and trucks, while the old one separated them

Figure 19. Multivariate plot showing the relationships between the variables V h 1 , V h 0 , l 0 , l 1 , a , t , e , L and v 0 for the cases of the old law (left) and the new one (right). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

much more clearly. As the data is normalized, it is not observed that the overtaking times for the new law are much greater than those of the old law, so that equality is achieved on the side of the high overtaking times.

Figure 20 shows a multivariate plot showing the relationships between the variables l 0 , l 1 , a , t and v 0 for the cases of the old law (above) and the new one (below). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

In some applications, such as matlab, for example, information can be obtained directly from the graph, simply by clicking on each point with the mouse, to know the index of the point and the values of all the variables associated with that particular advancement.

As can be seen, the use of colors greatly facilitates data analysis.

5. Conclusions

The most important conclusions derived from this work are:

1) Although they are based on the same starting formulas, the deterministic and the random models presented are very different in terms of the information they provide.

2) While the deterministic model provides only one value of the variables, as representative of the problem, and the frequentist random models would allow, at most, confidence intervals for the variables, the Bayesian models give the full density functions, not just of the variables, but also of the parameters of the model, giving a very precise idea of its variability.

3) In the deterministic model, the variability of the variables can only be taken into account by means of the coefficients of reduction or enlargement of the variables, depending on their positive or negative effect on safety. These are the classic models that have always been used in engineering. For example, in the

Figure 20. Multivariate plot showing the relationships between the variables l 0 , l 1 , a , t and v 0 for the cases of the old law (above) and the new law (below). The colors indicate the 9 combinations of overtaking and overtaken vehicle types.

deterministic model, a coefficient of 1.3 has been used to increase the speed of the oncoming vehicle.

4) While the deterministic models allow knowing whether the times and overtaking distances are large, moderate or small, the random models allow these to be precisely quantified based on the proportion of affected vehicles in each case.

5) Both models coincide in indicating a substantial increase in overtaking times and distances with the new law, compared to the old one, which indicates a great increase in risk.

6) Dimensional analysis has reduced the complexity and dimension of the problem posed, allowing the use of dimensionless abacuses, which unify similar cases.

7) In this work, a very simple and totally general method has been shown to go from a deterministic model to a random one. Readers are invited to make use of this methodology to enrich their models.

8) We have shown how to correctly use the location and scale parameters, and the need to avoid expressions that include parameters with dimension in functions such as exponential, power, logarithmic and trigonometric, in which dimensionless variables and parameters have to be used.

9) Once more, the OpenBUGS tool has been shown to be very powerful and useful for obtaining uni, bi and multidimensional distributions. In reality, what OpenGUGS gives is a sample as large as desired of the posterior joint distribution of all variables and parameters, which avoids having to do complex or impossible integrations to derive the exact functional form of this posterior distribution and replaces it. In addition, it has been shown that OpenBUGS not only takes care of models to be consistent by enforcing the use of Bayesian networks to define the joint distributions of variables, but by providing the direct access to Bayesian methods by incorporating the parameters as new variables.

10) The use of colors greatly facilitates the understanding and interpretation of the results. In our example, the 9 colors grouping the data by similarities, in reddish, greenish and bluish, make it possible, on one hand, to identify the type of vehicle, and, on the other hand, their lightness or darkness, whether it is an overtaking or an overtaken vehicle.

Notation

To facilitate the understanding of this work, the notation used is given below:

a: average vehicle acceleration when trying to reach the maximum speed v max starting from v 1 < v max

a [ i ] : acceleration of the overtaking vehicle of the i-th data of the sample

a min : lower bound of acceleration a

a max : upper bound of acceleration a

b 1 , b 2 : separation between vehicles before and after overtaking, respectively

D: condition that allows you to decide if you are in case 1 ( D > 0 ) or in case 2 ( D < 0 )

d 0 : distance traveled to reach the maximum speed v max starting from v 1 , assuming an average acceleration a

e: distance traveled when overtaking considering cases 1 and 2.

e 0 ( t ) : distance traveled by the overtaking vehicle during a time t, assuming a constant speed v 0 .

e 1 : strict distance needed to overtake in case 1

e 1 ( t ) : distance traveled starting from the speed v 1 and accelerating with constant acceleration a for a time t t 1 , i.e. in case 1

e 2 : strict distance needed to overtake in case 2

e 2 ( t ) : distance traveled during the overtaking for a time t t 1 in case 2

e 3 ( t ) : distance traveled by the oncoming vehicle in a time t, assuming it circulates at a constant speed v 2

l 0 : length of the overtaken vehicle

l 0 [ i ] : length of the overtaken vehicle of the i-th data of the sample

l 0 min : lower bound of l 0

l 0 max : upper bound of l 0

l 1 : length of the overtaking vehicle

l 1 [ i ] : length of the overtaking vehicle of the i-th data of the sample

l 1 min : lower bound of l 1

l 1 max : upper bound of l 1

L: reasonable safety distance for overtaking

p [ ] : array containing the proportions of motorcycles, cars and trucks

t 0 : time needed to reach the maximum speed v max starting from v 1 and assuming an average acceleration a

t 1 : time that the overtaking lasts in case 1

t 2 : time that the overtaking lasts in case 2

V max 0 : maximum speed allowed in the studied section for motorcycles and cars

V max 1 : maximum speed allowed in the studied section for trucks

V max [ i ] : maximum speed allowed to the i-th vehicle of the sample in the studied section considered (90 km/hour, 70 km/hour, 50 km/hour, etc.)

V 0 min [ i ] : minimum speed of the i-th overtaken vehicle of the sample

V 0 max [ i ] : maximum speed of the i-th overtaken vehicle of the sample

V 1 min [ i ] : minimum speed of the vehicle that overtakes in the i-th item of the sample

V 1 max [ i ] : maximum speed of the vehicle that overtakes the i-th item of the sample

V 3 min [ i ] : minimum speed assumed for the i-th assumed oncoming vehicle

V 3 max [ i ] : maximum speed assumed for the i-th assumed oncoming vehicle

v max : maximum speed allowed in the considered section without considering possible excess allowed when overtaking

v 0 : velocity of the overtaking vehicle, assumed to be constant

v 1 : velocity of the overtaking vehicle when overtaking starts

v 2 : velocity of the assumed oncoming vehicle

V h 0 : type of the overtaken vehicle

V h 1 : type of the overtaking vehicle

V h 3 : type of the assumed oncoming vehicle

Disclaimer

The authors of this work decline all responsibility for the use of the material contained in it. The people who use it must verify its correctness and that the use they make is adequate for their objectives.

Conflicts of Interest

The authors declare no conflicts of interest.

References

[1] Decreto Aprobación Ley de Tráfico. BOE número 261, de 31 de octubre de 2015, Referencia: BOEA201511722.
[2] Ley 18/2021, por la que se modifica el texto refundido de la Ley sobre Tráfico, Circulación de Vehículos a Motor y Seguridad Vial, aprobado por el Real Decreto Legislativo 6/2015, de 30 de octubre, en materia del permiso y licencia de conducción por puntos.
[3] Manou-Abi, S.M., Dabo-Nian, S. and Salone, J.J. (2020) Mathematical Modeling of Random and Deterministic Phenomena. ISTE, Wiley, Berlin.
https://doi.org/10.1002/9781119706922
[4] Goicolea, T., et al. (2021) Deterministic, Random, or in between? Inferring the Randomness Level of Wildlife Movements. Movement Ecology, 9, 33.
https://doi.org/10.1186/s40462-021-00273-7
[5] Castillo, E. and Duato, J. (2022) Los riesgos de la nueva normativa de Tráfico para adelantar. The Conversation, 178930.
[6] Buckingham, E. (1915) The Principle of Similitude. Nature, 96, 396-397.
https://doi.org/10.1038/096396d0
[7] Barenblatt, G.I., et al. (1996) Cambridge Texts in Applied Mathematics. 1em plus 0.5em minus 0.4em. Cambridge University Press, Cambridge.
[8] Castillo. E., O’Connor, A., Nogal, M. and Calviño, A. (2014) On the Physical and Probabilistic Consistency of Some Engineering Random Models. Structural Safety, 51, 1-12.
https://doi.org/10.1016/j.strusafe.2014.05.003
[9] Castillo, E., Grande, Z. and Calviño, A. (2016) Bayesian Networks-Based Probabilistic Safety Analysis for Railway Lines. Computer-Aided Civil and Infrastructure Engineering, 31, 681-700.
https://doi.org/10.1111/mice.12195
[10] Grande, Z., Castillo, E., Mora, E. and Lo, H. (2017) Highway and Road Probabilistic Safety Assessment Based on Bayesian Network Models. Computer Aided Civil and Infrastructure Engineering, 32, 379-396.
https://doi.org/10.1111/mice.12248
[11] Pearl, J. (1988) Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann Publishers Inc., San Francisco.
[12] Castillo, E., Gutiérrez, J.M. and Hadi, A.S. (2012) Expert Systems and Probabilistic Network Models, ser. Monographs in Computer Science. Springer, Berlin.
[13] Castillo, E., Gutiérrez, J.M. and Hadi, A.S. (1997) Sistemas expertos y modelos de redes probabilísticas. Real Academia de Ingeniería, Madrid.
[14] Bielza, C., Li, G. and Larrañaga, P. (2011) Multi-Dimensional Classification with Bayesian Networks. International Journal of Approximate Reasoning, 52, 705-727.
https://doi.org/10.1016/j.ijar.2011.01.007
[15] Castillo, E., Menéndez, J. and Sánchez-Cambronero, S. (2008) Predicting Traffic Flow Using Bayesian Networks. Transportation Research Part B: Methodological, 42, 482-509.
https://doi.org/10.1016/j.trb.2007.10.003
[16] Bielza, C., Moral, S. and Salmerón, A. (2015) Recent Advances in Probabilistic Graphical Models. International Journal of Intelligent Systems, 30, 207-208.
https://doi.org/10.1002/int.21697
[17] Castillo, E., Gutiérrez, J.M. and Hadi, A.S. (1996) A New Method for Efficient Symbolic Propagation in Discrete Bayesian Networks. Networks, 28, 31-43.
https://doi.org/10.1002/(SICI)1097-0037(199608)28:1<31::AID-NET5>3.0.CO;2-E
[18] Larrañaga, P. and Moral, S. (2011) Probabilistic Graphical Models in Artificial Intelligence. Applied Soft Computing, 11, 1511-1528.
https://doi.org/10.1016/j.asoc.2008.01.003
[19] Castillo, E., Gutiérrez, J.M., Hadi, A.S. and Solares, C. (1997) Symbolic Propagation and Sensitivity Analysis in Gaussian Bayesian Networks. Application to Damage Assessment. Artificial Intelligence in Engineering, 11, 173-181.
https://doi.org/10.1016/S0954-1810(96)00030-1
[20] Arnold, B., Castillo, E. and Sarabia, J.M. (1992) Conditionally Specified Distributions, ser. Lecture Notes in Statistics, Vol. 73, Springer-Verlag, Berlin.
[21] Arnold, B., Castillo, E. and Sarabia, J. (1996) Specification of Distributions by Combinations of Marginal and Conditional Distributions. Statistics and Probability Letters, 26, 153-157.
https://doi.org/10.1016/0167-7152(95)00005-4
[22] Arnold, B., Castillo, E. and Sarabia, J. (2002) Exact and Near Compatibility of Discrete Conditional Distributions. Computational Statistics and Data Analysis, 40, 231-252.
https://doi.org/10.1016/S0167-9473(01)00111-6
[23] Castillo, E., Calviño, A., Nogal, M. and Lo, H.K. (2014) On the Probabilistic and Physical Consistency of Traffic Random Variables and Models. Computer-Aided Civil and Infrastructure Engineering, 29, 496-517.
https://doi.org/10.1111/mice.12061
[24] Arnold, B., Castillo, E. and Sarabia, J. (2004) Compatibility of Partial or Complete Conditional Probability Specifications. Journal of Statistical Planning and Inference, 123, 133-159.
https://doi.org/10.1016/S0378-3758(03)00137-X
[25] Nogal, M., Castillo, E., Calviño, A. and O’Connor, A. (2015) Coherent and Compatible Statistical Models in Structural Analysis. International Journal of Computational Methods, 13, Article ID: 1640008.
https://doi.org/10.1142/S0219876216400089
[26] Girón, J. (2021) Bayesian Testing of Statistical Hypotheses. Real Academia de Ciencias Exactas, Físicas y Naturales, Málaga.
[27] Pearl, J. (2009) Causality: Models, Reasoning and Inference. 2nd Edition, Cambridge University Press, Cambridge.
[28] Pearl, J. and Mackenzie, D. (2018) The Book of Why: The New Science of Cause and Effect. Basic Books, Inc., New York.
[29] Lunn, D., Thomas, A., Best, N. and Spiegelhalter, D. (2000) WinBUGS a Bayesian Modelling Framework: Concepts, Structure, and Extensibility. Statistics and Computing, 10, 325-337.
https://doi.org/10.1023/A:1008929526011

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.