**6. Conclusions**

This study has developed a new simulation of speculative attack models using machine learning techniques. Using data of period 1995–2019 for the cases of the currencies of Mexico and Thailand (Peso and Baht) and applying four different NN methods in the estimation of the first- and second-generation speculative attacks models to achieve a robust accuracy capacity, such as MLP, DRCNN, DNDT, and QNN. This last methodology is the one that has obtained the highest levels of precision. Most of the proposed NN methodologies have shown a low level of error and stability in the estimates made from speculative attack models, proving their interesting alternative to conventional statistical methods, such as OLS.

Besides, the target has been to improve the accuracy of previous studies using different methodologies. The results obtained in this research are higher than those obtained in the existing literature, with an accuracy range of 82.64–92.84% using the NN methods, while OLS method has only reached an accuracy range of 75.27–78.06%. It has also detected new significant variables to consider in speculative attacks models in weak currencies, allowing a high level of stability in the models developed over forecasting horizons of *t* + 1 and *t* + 2. In contrast to previous research, this study has been able to expand the estimation of speculative attacks in exchange rate attending to accuracy and error results. The results have identified a set of significant variables for each methodology applied and for each standard dependent variable. Furthermore, the time elapsed to make the estimates is less for the proposed NN techniques compared to the time needed for the OLS method. This makes an essential contribution to the field of computational macroeconomics and finance. The conclusions are relevant to public managers, financial analysts, central bankers, and other stakeholders in the foreign exchange markets, who are generally interested in knowing which indicators provide reliable, accurate, and potential forecasts of performance evolution. Our study suggests new explanatory significant variables to allow these agents to analyze the performance of speculative attack models. This research has also provided a new estimation analysis developed for speculative attacks using four NN methods, being the QNN the most accurate. Hence, this study attempts to contribute to existing knowledge in the field of machine learning. These new simulations of estimation can be used as a reference to improve decision-making in public and financial institutions.

In summary, this study provides a significant opportunity to contribute to the research line of currency crises and speculative attacks, since the results obtained have significant implications for the future decisions of public institutions, making it possible to avoid big negative changes of the trend of the exchange rate and the potential associated risks. It also helps these agents send warning signals to governments and central banks and avoid currency crisis losses derived from a huge decrease in the balance of payments. Further research could include speculative attack models with other new variables to take advantage of the benefits of machine learning techniques.

**Author Contributions:** This study has been designed and performed by all of the authors. D.A. collected the data. D.A., F.A.-V. and J.R.S.-S. analyzed the data. The introduction and literature review were written by D.A. and F.A.-V. All of the authors wrote the discussion and conclusions. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Universidad de Málaga, Spain, and Cátedra de Economía y Finanzas Sostenibles Universidad de Málaga, Spain.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data available on request due to restrictions.

**Conflicts of Interest:** The authors declare no conflict of interest.
