The files provided in this archive are expected to be used with MATLAV 22b or newer. 
Steps of using the scripts:
1. Load "Dirichlet_copula_worspace.mat". This a snapshot of MATLAB workspace, which contains data structures created by conducting multi-variate Bayesian inference, described in the paper "Popov, P., Dynamic safety assessment of Autonomous Vehicle based on Multivariate Bayesian Inference (DyAVSA), 2025". Among them are:
- the prior and posterior distributions - of the marginal probabilities of accident per mile of driving in the 5 operating conditions used in the illustrative examples, and 
- the Dirichlet distributions used to model an uncertain operational profile. This includes the parameters of the prior and posterior distribution with 5 variates (representing the likelihood of each of the 5 operating conditions) and also an array with the probability mass of the 3876 distinct points of the discretised Dirichlet distribution with up to 20 discretisation points along each of the 5 dimensions of the Dirichlet distribution together with the probability masses computed for each of the discretisation points.
script 
Once, this is done, one can load and run "Dirichlet_Copula_post.m" which generates a significant number of plots including some of the plots included in Appendix 2 of the paper "Popov, P., Dynamic safety assessment of Autonomous Vehicle based on Multivariate Bayesian Inference (DyAVSA), 2025".

18 May, 2025