IDEAS home Printed from https://ideas.repec.org/p/boc/dsug17/04.html
   My bibliography  Save this paper

A case study in efficient programming in Stata and Mata: Speeding up the ardl estimation command

Author

Listed:
  • Daniel C. Schneider

    (Max Planck Institute for Demographic Research)

  • Sebastian Kripfganz

    (University of Exeter)

Abstract

The user-written package ardl, first released in 2014, estimates autoregressive distributed lag (ARDL) time-series models and provides the popular Pesaran, Shin, and Smith (2001, Journal of Applied Econometrics) bounds testing procedure for a long-run relationship. In this presentation, the statistics and application side of the command take a back seat and give way to a discussion of the algorithms used under the hood of ardl. Efficient programming is critical for ardl for two reasons: optimal lag selection and for obtaining critical values via simulation. This presentation will use the "case study" of the ardl estimation command to discuss efficient programming in Stata and Mata. Various programming concepts (compilation, argument passing, data types, pointer variables, etc.) and their implementation in Stata/Mata will be explained, as well as various finer Mata-specific topics (fast matrix indexing, matrix inversion, etc.). The overall message is that coding based on common sense, knowledge of the workings of Stata/Mata, and knowledge of linear algebra goes a long way when trying to write high-performance code and in many cases is to be preferred to the tedium of moving to a lower-level programming language like C/C++.

Suggested Citation

  • Daniel C. Schneider & Sebastian Kripfganz, 2017. "A case study in efficient programming in Stata and Mata: Speeding up the ardl estimation command," German Stata Users' Group Meetings 2017 04, Stata Users Group.
  • Handle: RePEc:boc:dsug17:04
    as

    Download full text from publisher

    File URL: http://repec.org/dsug2017/Germany17_Schneider.pdf
    File Function: presentation materials
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Sebastian Kripfganz & Daniel C. Schneider, 2023. "ardl: Estimating autoregressive distributed lag and equilibrium correction models," Stata Journal, StataCorp LP, vol. 23(4), pages 983-1019, December.
    2. Sebastian Kripfganz & Daniel C. Schneider, 2023. "ardl: Estimating autoregressive distributed lag and equilibrium correction models," Stata Journal, StataCorp LP, vol. 23(4), pages 983-1019, December.
    3. M. Hashem Pesaran & Yongcheol Shin & Richard J. Smith, 2001. "Bounds testing approaches to the analysis of level relationships," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 16(3), pages 289-326.
    4. Paresh Kumar Narayan, 2005. "The saving and investment nexus for China: evidence from cointegration tests," Applied Economics, Taylor & Francis Journals, vol. 37(17), pages 1979-1990.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Stéphane Lemarié & Valérie Orozco & Jean-Pierre Butault & Antonio Musolesi & Michel Simioni & Bertrand Schmitt, 2020. "Assessing the long-term impact of agricultural research on productivity: evidence from France," European Review of Agricultural Economics, Oxford University Press and the European Agricultural and Applied Economics Publications Foundation, vol. 47(4), pages 1559-1586.
    2. Moutinho, Victor & Santos de Oliveira, Helena M. & Viana Espinosa de Oliveira, Henrique & Puime Guillén, Félix, 2023. "The augmented and integrative model of economic growth: Theoretical and empirical evidence from USA," Socio-Economic Planning Sciences, Elsevier, vol. 89(C).
    3. Maria Karadima & Helen Louri, 2021. "Determinants of Non-Performing Loans in Greece: the intricate role of fiscal expansion," GreeSE – Hellenic Observatory Papers on Greece and Southeast Europe 160, Hellenic Observatory, LSE.
    4. Dervis Kirikkaleli & Hasan Güngör & Tomiwa Sunday Adebayo, 2022. "Consumption‐based carbon emissions, renewable energy consumption, financial development and economic growth in Chile," Business Strategy and the Environment, Wiley Blackwell, vol. 31(3), pages 1123-1137, March.
    5. Ngozi Adeleye & Evans Osabuohien & Ebenezer Bowale & Oluwatoyin Matthew & Emmanuel Oduntan, 2018. "Financial reforms and credit growth in Nigeria: empirical insights from ARDL and ECM techniques," International Review of Applied Economics, Taylor & Francis Journals, vol. 32(6), pages 807-820, November.
    6. Lukman Ayinde Olorogun, 2022. "Revisiting the Nexus of FDI-Led Growth Hypothesis and Economic Development in Rwanda: a Johansen-ARDL Approach to Cointegration," Journal of the Knowledge Economy, Springer;Portland International Center for Management of Engineering and Technology (PICMET), vol. 13(4), pages 2695-2717, December.
    7. P. Jijin & Alok Kumar Mishra & M. Nithin, 2022. "Macroeconomic determinants of remittances to India," Economic Change and Restructuring, Springer, vol. 55(2), pages 1229-1248, May.
    8. Stamatios Ntanos & Michalis Skordoulis & Grigorios Kyriakopoulos & Garyfallos Arabatzis & Miltiadis Chalikias & Spyros Galatsidas & Athanasios Batzios & Apostolia Katsarou, 2018. "Renewable Energy and Economic Growth: Evidence from European Countries," Sustainability, MDPI, vol. 10(8), pages 1-13, July.
    9. Satya Prasad Padhi, 2024. "Indian Experience of Managing Impossible Trinity, Growth and Possible Tradeoff Between FDI and FIIs: Nature of Capital Inflows Matter," Global Journal of Emerging Market Economies, Emerging Markets Forum, vol. 16(1), pages 44-63, January.
    10. Bartosz Jóźwik & Antonina-Victoria Gavryshkiv & Phouphet Kyophilavong & Lech Euzebiusz Gruszecki, 2021. "Revisiting the Environmental Kuznets Curve Hypothesis: A Case of Central Europe," Energies, MDPI, vol. 14(12), pages 1-17, June.
    11. Maxwell Chukwudi Udeagha & Marthinus Christoffel Breitenbach, 2023. "The Role of Financial Development in Climate Change Mitigation: Fresh Policy Insights from South Africa," Biophysical Economics and Resource Quality, Springer, vol. 8(1), pages 1-34, March.
    12. Mariia Ostapchuk & Claire Auplat & Pierre Boucard, 2023. "Economic Growth and Scientific Knowledge as Determinants of Innovation Uptake in a Situation of Uncertainty About Environmental or Health Risk," Journal of the Knowledge Economy, Springer;Portland International Center for Management of Engineering and Technology (PICMET), vol. 14(2), pages 1602-1634, June.
    13. Jörg Döpke & Karsten Müller & Lars Tegtmeier, 2023. "Moments of cross‐sectional stock market returns and the German business cycle," Economic Notes, Banca Monte dei Paschi di Siena SpA, vol. 52(2), July.
    14. Nuno Carlos Leitão, 2021. "Testing the Role of Trade on Carbon Dioxide Emissions in Portugal," Economies, MDPI, vol. 9(1), pages 1-15, February.
    15. Boucekkine, R. & Laksaci, M. & Touati-Tliba, M., 2021. "Long-run stability of money demand and monetary policy: The case of Algeria," The Journal of Economic Asymmetries, Elsevier, vol. 24(C).
    16. Sebastian Kripfganz & Daniel C. Schneider, 2020. "Response Surface Regressions for Critical Value Bounds and Approximate p‐values in Equilibrium Correction Models," Oxford Bulletin of Economics and Statistics, Department of Economics, University of Oxford, vol. 82(6), pages 1456-1481, December.
    17. Max Resende & Juliano Leal & João Simoni, 2021. "Electricity demand in the iron ore industry: Evidence from Brazil," Economics Bulletin, AccessEcon, vol. 41(3), pages 929-937.
    18. Desire Wade Atchike & Zhen-Yu Zhao & Geriletu Bao, 2020. "The Relationship between Electricity Consumption, Foreign Direct Investment and Economic Growth: Case of Benin," International Journal of Energy Economics and Policy, Econjournals, vol. 10(4), pages 507-515.
    19. Maria Karadima & Helen Louri, 2022. "Government debt accumulation and non-performing loans: An ARDL bounds testing approach," Economics and Business Letters, Oviedo University Press, vol. 11(4), pages 150-160.
    20. Olufunmilayo T. Afolayan & Henry Okodua & Hassan Oaikhenan & Oluwatoyin Matthew, 2020. "Carbon Emissions, Human Capital Investment and Economic Development in Nigeria," International Journal of Energy Economics and Policy, Econjournals, vol. 10(2), pages 427-437.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:dsug17:04. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.