**Appendix**

In this Appendix we present the code of the programme in R used to estimate the order of the non-homogeneous Markov chain as well as its transition probabilities. The code it not optimal and can be highly improved, but in its present form it provides elements for estimating the necessary quantities.

```