## 2 Methodology
### Cost-Benefit Analysis  
Welfare maximization can be defined as the objective of cost-benefit analysis [13]. The cost-benefit analysis is dependent on the Pareto criterion for checking whether a project increases welfare or not. This idea is based on the ideal welfare scenario where a policy improvement makes some people better off while nobody would experience a loss. However, in reality, projects make some people better off, while others would be worse off. As a result, economists pledge to a less demanding state: a project satisfies the criterion when those who benefit from a project, compensate those who lose from it [13]. The same concept was implemented in this study. If overall, the total benefit is to be positive, optimizing would be cost-effective. Also, a higher priority is given to a higher total benefit based on the analysis. The benefit over a 10-year period based on equivalent property damage only (EPDO) could be written as:  
\[ \begin{array}{l}\textit{Benefit over $10$ year based on EPDO}\\ =\sum\limits_{i=1}^{10}\textit{Predicted cost with barriers enhancement}_{i}\\ -\textit{Predicted cost with no barrier enhancement}_{i}\end{array}  \tag{19}\]  
And the total benefit is calculated as:  
\[ \begin{array}{l}\textit{Total benefit}=\textit{Benefit over $10$ year based on EPDO}\times\ 34,612-\text{reset }\cos\text{t}\end{array}  \tag{20}\]  
The value of $34,612 is the cost of PDO in Wyoming based on the state criteria: after coming up with EPDO, the value would be converted into costs. It should be noted that the cost of barrier enhancements would be added just for the first year in Equation (19). In Equation (19), costs at year i would be estimated based on the interpolated traffic in that year. Based on the last 10-year historical traffic data, traffic in the state highway system was almost constant. However, the interstate system traffic increased by a rate of 4% in 10 years or \(\frac{4\%}{10}\) for every year. The costs of the barriers' resets would be executed only for the first year. Based on WYDOT's recommended values, EPDO is written as:  
\[ \begin{array}{ll}\textit{EPDO rate}&=\textit{Fatal crashes}+\textit{ suspected serious in jury}\\ &+\textit{suspected minor injury}+\textit{possible in jury}+\textit{Unknown}+\textit{PDO} \end{array}  \tag{21}\]  
Now after converting every crash severity level to PDO in Equation (21), with the same sequence of variables, it follows that [3]:  
\[ \begin{array}{l}\textit{EPDO rate}=277\times\textit{PDO}+13\times\textit{ PDO}+4\times\textit{PDO}+4\times\textit{PDO}+4\times\textit{PDO}+1\times\textit{PDO} \end{array}  \tag{22}\]  
where for instance, a fatal crash is equivalent to 277 EPDO crashes, from Equations (21) and (22). In summary, the methodological optimization steps taken in this study are summarized as follows:  
1. Dataset preparation: Filter the data to include barriers experiencing crashes on state highway and interstate systems in Wyoming
2. Barrier types: Filter data to include only box beam and W-beam barriers since other barriers only account for a small proportion of the dataset
3. Data aggregation: Aggregate the crash data across traffic barriers and traffic datasets, based on mileposts and roadway IDs. Also consider the relation of various demographic and environmental factors to crashes. For instance, if barrier ID 1234 experienced 10 crashes, based on EPDO, the average of various explanatory variables such as driver and environmental characteristics would be aggregated over that barrier ID* Hierarchy setting: Identify a best choice of variable for the model hierarchy, based on the lowest DIC
* Convert the best fit model in step 4 into an equation
* Data preparation: train the model on the dataset including all barriers that experienced at least one crash
* Implement the trained model on a test dataset with barriers' current heights: based on current barriers' geometric characteristics.