EconPapers    
Economics at your fingertips  
 

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

Daniel C. Schneider and Sebastian Kripfganz
Additional contact information
Daniel C. Schneider: Max Planck Institute for Demographic Research

German Stata Users' Group Meetings 2017 from Stata Users Group

Abstract: 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++.

Date: 2017-09-20
New Economics Papers: this item is included in nep-cmp
References: View references in EconPapers View complete reference list from CitEc
Citations: Track citations by RSS feed

Downloads: (external link)
http://repec.org/dsug2017/Germany17_Schneider.pdf presentation materials (application/pdf)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:dsug17:04

Access Statistics for this paper

More papers in German Stata Users' Group Meetings 2017 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2023-01-26
Handle: RePEc:boc:dsug17:04