A VBA module simulation for finding optimal lag order in time series models and its use on teaching financial data computation

Alan Mustafa (Senior Member, IEEE, Duhok, Kurdistan Region, Iraq)
Abdulnasser Hatemi-J (Department of Finance, College of Business and Economics, United Arab Emirates University, Al-Ain, United Arab Emirates)

Applied Computing and Informatics

ISSN: 2634-1964

Article publication date: 17 July 2020

Issue publication date: 21 June 2022

1832

Abstract

In this study, a tool has been designed and developed for learning about the concept of lag order within a dynamic model, which can be used in any teaching classes on statistics and financial data computation. To show a solution for a complex and multi-step process of finding the optimal lag order for multiple variables data series based on an information criterion a module using Visual Basic for Applications (VBA) for Microsoft Excel (MS Excel) is being developed. This module can be used for estimating a multivariate dynamic model as well as determining the optimal lag order of such a model.

Keywords

Citation

Mustafa, A. and Hatemi-J, A. (2022), "A VBA module simulation for finding optimal lag order in time series models and its use on teaching financial data computation", Applied Computing and Informatics, Vol. 18 No. 3/4, pp. 208-220. https://doi.org/10.1016/j.aci.2019.04.003

Publisher

:

Emerald Publishing Limited

Copyright © 2019, Alan Mustafa and Abdulnasser Hatemi-J

License

Published in Applied Computing and Informatics. Published by Emerald Publishing Limited. This article is published under the Creative Commons Attribution (CC BY 4.0) license. Anyone may reproduce, distribute, translate and create derivative works of this article (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this license may be seen at http://creativecommons.org/licences/by/4.0/legalcode


1. Introduction

The vector autoregression (VAR) model is regularly utilized by practitioners in the empirical analysis of time series data. This model is a seminal contribution by Sims [1], which allows for interaction between the variables in a multivariate sense. The VAR model is known for having good forecasting properties. It can also be used for cointegration and causality testing. Another advantage of this model is that it provides the possibility to generate impulse response functions and variance decomposition in order to capture the impact of an exogenous shock within the system. A crucial issue within this context is to determine the optimal lag order of the VAR model for the reason that all inference based on this model is correct only if the optimal lag length is correctly specified. Thus, paying attention to the process of selecting the optimal lag order in the multivariate model before using the underlying model for empirical analysis is an important issue. Despite its well-known properties, there is currently no module in the MS-Excel, to the best knowledge, that can be used for estimating and determining the optimal lag order of the VAR model. Hence, the main objective of the current paper is to provide a consumer-friendly module in the MS-Excel that can be used for both estimating the parameters in the VAR as well as for determining the optimal lag order based on minimizing an information criterion.

There are numerous tools available to facilitate data analysis, which either make use of a general programming language for application development such as C [2], C++ [3], C# [4], Java [5], R [6], and Python [7] with the support of their relevant libraries such as Scikit-Learn [8] and NumPy [9] for Python and BLAS [10], LAPACK [11] and CUBLAS [12] for C++; or more specialised statistical application software, such as Gauss [13], EViews [14], SPSS [15], Matlab [16] and Octave [17]. There is also various alternative application software available, which do not require any programming skills to develop an environment for advanced data analysis such as Weka [18]. As it has now become clear that by checking the long list of statistical application software and list of programs for developing such applications, a single point brightens up the argument in which all those applications require an environment for data processing. Microsoft Excel similar to Weka is not far from this end user interaction between machines and human cognitive thinking in the way of providing simulations [19,20].

It is a well-known fact that Microsoft Excel is used for small dataset-based projects, providing daily support to small business processes, as it works very well for analysing data and producing results in the form of numbers or charts as a visual reporting tool. All tools are handy and no advanced programming skill is required but knowing a few commands, which can be used to implement few logical and mathematical algorithms. However, there is still one fact remaining, which is the capability of this software when it comes to dealing with complex algorithmic data processing. Few institutions have developed a series of plugins to expand the power of this application so to provide more tools to data scientist and so to work with larger projects. A good list of such add-ins can be found at VeryViz website [21], such as FRED’s data resource provider add-ins at [22], DataForecasting at [23] and SimTools and FormList at [24]. Few of those plug-ins are not free and they can be obtained with a payment paid to those institutions for developing such modules.

On the other hand, one of the major issues in instructional design is on the application of theoretical concepts and representation of its facts in a form which can be delivered to a learner. The approach of using chalk and board or e-smartboards have been used to draw pictures for visual representations of concepts, or a tactile approach (for example a mechanical movement of physical staff) to represent movements, the method has been used for thousands of years in teaching a child by his father or a mentor. In recent decades of advancements on computer hardware and software, this need has been extremely simplified and with the use of special software on a powerful computer any of most complicated models can easily be animated. However, this approach constrains the other end of electronic instructional design with an extreme demand for new applications of e-simulators. In this study, a simulation has been designed and developed that provides a detailed and simplified solution for presenting a complex mathematical calculation for asymmetric causality tests for multivariate autoregression model (VAR). A sample test also has been provided to add to the flexibility of module usage and ease of accessibility of its training module.

2. Theoretical background

2.1 Role of simulations software in education

It is well-known in the literature that an instructional designer1 needs a set of skills on hardware and software combined with a pedagogical philosophy. But at the end, the content matters and so to run a simulation software the content must be designed in such a way that the user (learner/researcher) should be able to mimic it any time with any suitable dataset [25–27]. Hence, in this research, we investigate the use of an algorithm named asymmetric causality test which is based on the optimal lag order determined by the information criterion, and design and develop a VBA module suitable for MS Excel 2013 so to help its user avoiding tasks of calculating the optimal lag order for a dataset. The reasoning behind the use of MS Excel is that the majority of office users have access to it and it is being used greatly for the small dataset on either as part of their daily business work or research.

2.2 Finding optimal lag order as a sample algorithm

The VAR is one of the most applied models in time series analysis since its introduction by Sims [1]. The mathematical idea comes from Granger [28] with massive literature on identifying causality between data with the use of the VAR model. Recently, asymmetric causality tests have been introduced in the literature by Hatemi-J [40] that separates the causal impact of positive changes from the negative ones. However, before testing for causality the optimal lag order needs to be selected in the VAR model. Hence, the Hatemi-J Criterion (HJC) [29] has been used to find the optimal lag order, which can also be used for forecasting purposes.2

This model allows for dynamic and interaction between the underlying variables. It is simple to use and it has excellent forecasting properties. The VAR model can also be used for implementing causality tests. In addition, multivariate cointegration analysis is usually conducted within the context of a VAR model [30]. Impulse response functions and variance decompositions can also be estimated by utilizing the average movement representation of the VAR model. A crucial issue in this context is the correct selection of optimal lag order in the VAR model because all inference is based on the correctness of the selected lag order. Consider the following vector autoregressive model of order p, VAR(p):

Eq.(1)Xt=v+A1Xt1++ApXtp+ut
here v represents a n × 1 vector of intercepts and ut is a n × 1 vector of error terms. The Ar is a n × n matrix of coefficients for lag order r (p = 1, …, p-max). Xt is an n × 1 vector of variables that are quantified across time.

It is widely agreed that lagged correlations are known elements of data science to find a relationship between two or more time series of events. In nature, many factors could be involved in affecting each time series, whether sooner or later. Understanding lagging correlations is a major branch of data science which can present new findings on any multidimensional time series data analysis [31]. Asymmetric causality test as a sample of the algorithm is considered as an advanced level of lagged correlations studies [29,32].

HJC=ln(|Ω^p|)+p(k2lnT+2k2ln(lnT)2T),p=0,,Maxlag.
Eq. 2: Formula for calculating Optimal Lag Order.

Where |Ω^p| is the determinant of the estimated variance–covariance matrix of the error terms in the VAR model based on lag order p. The denotation k represents the number of features or equations in the VAR model and T is the number of observations. The lag order that minimizes the HJC information criterion is the optimal lag order. For simulation results pertinent to this issue see [29,32] and understanding stepwise of VAR(p) calculations the reader is referred to [34].

3. Methodology

A VBA based module is being developed and used as an extension to MS Excel 2013 spreadsheet. The algorithm for developing such application was already presented as per mentioned in equation Eq. (2). The pseudocode for writing the code for this program is devised into three main sections (Appendix A). Reading data from each sheet, retrieving data for processing, and publishing its outcome into new sets of sheets. To create a new sheet and add records to it in multiple turns depending on the number of sub-calculations needed for different sections of the formula in Eq. (2):

The software produces a series of sheets which contain individual steps of manipulating variables as per denotations on Eq. (2). Each group of sheets marked by its relevant lag such as Y_1 for identifying Y values and Z_All_5_T which is a transposed collection of all Z matrices for lag 5.

Reading and writing of the first section of the module which is labelled on the dashboard (Figure 1) as “Determine Optimal Lag – Detailed” is using a series of for-loops to while interacting with individual sheets. On the second method which is labelled as “Determine Optimal Lag – No Details” uses the array techniques; and since this method does not involve reading and writing approach of data from sheets, the calculation of those formulae are much faster in comparison to the first one. The tricky part of this method was on identifying the start and ending points of each loop so to support calculations of each section of the formulae indicated on Eq. (2) and appendix B.

4. Development

The VBA (from Microsoft Excel) module for calculating the optimal lag order which is a combination of two types of outputs (see Figure 1) was built [35]. The slow version which supports learning how data are being calculated, and the fast version which provides only the last result for HJC and a visual representation of optimal lag order.

The first button labelled as “Load Sample Data” is a sample set of exemplary data from Chinese and US market, which contains 65 sets of observations. The dataset included quarterly gross domestic product (GDP) data from both China and US between 1991 and 2015 obtainable from FRED database provided by Federal Reserve Bank of St. Louise and it is available online [36]. Now if a researcher is interested in viewing all calculations done to calculate each part of HJC equation from Eq. (2) on individual sheet separately, s/he should use the “Determine Optimal Lag – Detailed” button. It contains all necessary calculations for finding Optimal lag order, which might be a suitable tool for learning about the data computation process of the variance and covariance matrices for different lag orders and other calculations such as detailed results of the HJC values for different lag orders and its minimum value on a sheet labelled as “HJC_All_and_min” (see Figure 3).

The outcome of HJC calculations for different lags are given in a table named “HJC_All_and_min_arr” (Figure 2) to show the details of why the indicated value is a minimum value. Figures 4–6 give other views of the module with presenting the last outcome of the calculation with estimated parameters of the VAR model for the found lag in Figure 6.

In addition to that in Figure 7, we can clearly see the curve HJC values created based on their lags (values of “p” in the Eq. (2)) and the optimal lag at the bottom of its curve which is the minimum value for the range of HJC values selected prior to calculations. As a sample of data analysis, the maximum lag order needs to be selected a prior. We select 15 as the maximum lag order in this application. But if we are not careful and choose to have a larger value for lag with a small number of observations, a disturbed curve will be drowned as sampled in Figure 8.

This test can be applied as many times as a teacher (researcher) would like to, in order to show possible variations of a maximum number of lag order to have for obtaining a minimum set of information criterion; which in this case clearly depends on the number of observations.

5. Results and discussions

As part assessment of this module, a series of 65 observations from stock markets of the US and China were chosen. Based on the minimization of the information criterion, the optimal lag order of 3 was found. As part of vector auto-regression analysis of data this new module clearly can support this data analysis as an add-in to capabilities of MS Excel. After selecting the optimal lag order, the VAR model can be used for multivariate cointegration analysis [37], conducting causality tests [28,38] and estimating the impulse response functions and variance decompositions [39,40].

Figure 7 clearly shows the optimal lag value of min (HJC lag orders) = 3 as the asymmetric causality between both the US and China markets. The VAR model used in this study uses a set of data on US and China financial markets which can be acquired at FRED database provided by Federal Reserve Bank of St. Louise and it is available online [36].

The VBA module developed for MS Excel (this module was tested on MS Excel 2013), can find the optimal lag order in a vector autoregressive model based on minimization of an information criterion. Simulation results show that this information criterion is successful in correctly finding the optimal lag order if the underlying variables are non-stationary and have unit roots. It is also robust to autoregressive conditional heteroscedasticity (ARCH) [41] effects and it has good forecasting properties. For the technical description please refer to [29,32].

Furthermore, as part of the delivery of knowledge in the form of instructional design, simulation in teaching plays an important factor on learners understanding of the process of a complex mathematical calculation, which is the core part of empirical research. This new tool has used MS Excel spreadsheet, a well-known application software which is common in every office to produce a simulation module for converting theoretical concepts into practical data and visual aid to be used in classrooms and research labs.

6. Conclusions and future work

This paper introduces a module [35] for estimating and determining the optimal lag order in the VAR model, which is developed in the Visual Basic for Applications (VBA) for Microsoft Excel. It is widely agreed that MS-Excel is among popular applications used in academia and industry and it has the capability of data processing for small sets of data while its performance is of up to the expectation [19,20]. There are numerous other applications that exist such as Gauss, EViews and Octave but there is a major drawback on working with those applications and its usage while working with a small set of data based on a complex algorithm. These mentioned applications usually require an expert understanding of those tools and there are not many modules available to automate those processes. Another advantage of MS Excel is that it is widely accessible to practitioners.

The core component of this newly developed module, which is a unique module on its form, produces a series of sheets with processed data as its outcome. The application is easy to work with and the outcome is understandable in two formats of quantitative measures (for example, the sheet labelled as HJC_All_and_min) and a chart (for example, labelled as Optimal Lag Chart) holding a visual representation of a series of lag orders and its optimal lag value assigned on the chart.

After choosing the optimal lag order the interested researcher has the possibility of conducting tests for cointegration or causality. It is also possible to use the underlying model for estimating the impulse response functions and the variance decompositions in order to capture the dynamic interaction between the underlying variables.

A copy of this application for downloading is available at [35] and any type of users (students, faculties, researchers and practitioners) can use it as long as it relates to the concept of asymmetric causality for multiple variables which can lead to the Wald test (as an example).

This application is used to show the powerfulness of MS Excel modules in data science for small projects similar to other advanced applications used for developing such data analysis in Gauss, EViews, and Octave. There is one point that needs to be clarified, which is the limitations of this module. Based on the limitations set by MS-Excel, it is only capable of processing 1048575 rows (one for headers). In terms of other factors, the limitation of 52 × 52 rows for inversing matrixes within this module based on the MS-Excel prior to earlier versions than 2007 has been removed [42]. Hence, the maximum lag value that practitioners are interested in usually (which requires the calculation of the inversed matrices) would rarely need the use of any value reaching this limitation. It should be mentioned that the default value is set to five. Thus, for a small project of datasets, the only limitation a researcher faces is the available memory on the computer. A potential extension of this module is to make the underlying analysis for panel data operational such as the approach developed by Hatemi-J [43]. Panel data combines the cross-sectional dimension with the time series dimension and thereby it creates higher degrees for freedom.Appendix

Figures

First Interactive view of the user interface for using the tool.

Figure 1

First Interactive view of the user interface for using the tool.

The outcome of HJC for different lag values.

Figure 2

The outcome of HJC for different lag values.

List of Sheets with calculated data for each part of HJC calculations for different lag orders.

Figure 3

List of Sheets with calculated data for each part of HJC calculations for different lag orders.

A view of labels for naming sheets generated automatically by the VBA code.

Figure 4

A view of labels for naming sheets generated automatically by the VBA code.

another view of labelling sheets including the chart.

Figure 5

another view of labelling sheets including the chart.

The view for presenting the optimal lag order.

Figure 6

The view for presenting the optimal lag order.

Visual Representation of Optimal Lag Order Curve for maximum 15 lags.

Figure 7

Visual Representation of Optimal Lag Order Curve for maximum 15 lags.

Visual representation of optimal lag order curve for maximum 30 lags, which clearly shows the concept of over-using the number of lags and wrong doing of data analysis.

Figure 8

Visual representation of optimal lag order curve for maximum 30 lags, which clearly shows the concept of over-using the number of lags and wrong doing of data analysis.

High level view for the selection of optimal lag order sub-modules.

Figure 9

High level view for the selection of optimal lag order sub-modules.

Variabledescription
Plag number and it changes from 1 to the defined possible lags by the user default value for p is set to 5
TTotal number of records in the dataset with headings (labels)
TIs the total number of records without headings
T = t − 1
NTotal number of columns
Ycolumns of dataset with no headings (labels) and with rows starting from 1 to T
Y’Y transposed
Worksheets(ws_Y_p_T).Range(“A1″).PasteSpecial Transpose:=True
ZTIs the collection of matrices of YTs
ZT = [1 YT YT-1 … YT-p+1]
ZIs the collection of matrices of ZTs
Z = (Z0, Z1, …, ZT-1) where Z0 = 1
Z’Z transposed
Y × Z’Another set of calculations as part of the calculating HJC
Z × Z’Another set of calculations as part of the calculating HJC
(Z × Z’)−1Inverse of (Z × Z’)
B^B_hat = YxZ’ x inv(ZxZ’) [B_hat means estimated value of B]
BZBZ = B × Z
DD = Y – B × Z
D’D transposed
OmegaΩ^p= (D × D’) / (T- k × p −1)
O_allOmega all
det_ODeterminant(Omega)
HJC_allHJC = ln(det_O + p × (((k^2 × ln(T)) + (2 × k^2 × ln(ln(T))) / (2 × T))

Notes

1.

In the field of e-learning systems the term of teacher has been being replaced by ‘Instructional Designer’ since the middle of last century.

2.

There are also other information criteria that can be used for this purpose. For simulation results pertinent to the performance of different information criteria see, among others, Hacker and Hatemi-J [33].

Appendix A

Pseudocode for the module

The VBA is a powerful application development tool which extends the capabilities of an application to include existing and new modules for new data computation. MS Excel with the support of the VBA can create accurate simulations. For the purpose of this research, the new module includes two actions for presenting the outcome of findings in a detailed or non-detailed sub-modules. The pseudocode for incorporating the VBA into the MS Excel for this paper is shown in Figure 9 detailed below:

With details: The first sub-module works based on a continuous loop between reading a dataset from a sheet, creating a new sheet, manipulating data based on a formula, and writing the outcome into the newly created sheet. This process goes on until it calculates the last part of the formula which is finding the optimal lag order and featuring the outcome in an easily readable chart.

Without details: The No-detailed section of the module uses the structure of arrays to transfer the altered data into different forms and calculations. The difference between this sub-module and the previous one is the saved time in calculations, though giving the same result.

Appendix B

Calculations of matrices and their setups (adapted from [34])

This is a list of variables used to create an individual sheet for importing, processing and producing a suitable outcome for the next part of the calculations.

Then, presenting the list of the values for the HJC in a sheet and a chart as well as finding the minimum value between them, which provides the optimal lag order for the set data.

References

[1]C. Sims, Macroeconomics and reality, Econometrica 48 (1) (1980) 148.

[2]American National Standards Institute, American National Standard for Information Systems-Programming Language C, X3.159, 1989.

[3]ISO/IEC, ISO International Standard ISO/IEC 14882:2017(E)Programming Language C++. Geneva, Switzerland: International Organization for Standardization (ISO), 2014, [Online]. Retrieved from: https://isocpp.org/std/ the-standard (accessed on Mar, 6, 2019).

[4]Microsoft Corporation, C# Language Specification Version 5.0: chapter 2.4.4.1 Boolean literals, [Online]. Available: http://www.microsoft.com/enus/ download/details.aspx?id=7029 (accessed on 6.03.2019).

[5]The Java_ Language Specification, Java SE 8 Edition [Online]. Available: https://docs.oracle.com/javase/specs/jls/se8/jls8.pdf (accessed on 6.03.19).

[6]R Core Team, R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. 2014, [Online]. Available: http://www.R-project.org/ (accessed on 6.03.19.).

[7]Python Core Team, Python: A dynamic, open source programming language. Python Software Foundation. 2015, [Online]. Available: https://www.python. (accessed on 6.03.19).

[8]Scikit-learn: Machine Learning in Python, Pedregosa et al., JMLR 12, pp. 28252830, 2011.

[9]Stéfan van der Walt, S Chris Colbert, Gaël Varoquaux, The NumPy array: a structure for efficient numerical computation, Comput. Sci. Eng. 13 (2) (2011) 2230, https://doi.org/10.1109/MCSE.2011.37.

[10]R. Geijn, K. Goto, BLAS (Basic Linear Algebra Subprograms), in: D. Padua (Ed.), Encyclopedia of Parallel Computing, Springer, Boston, MA, 2011 (accessed on 6.03.19), [Online]. Available: https://link.springer.com/referenceworkentry/ 10.1007%2F978-0-387-09766-4_84.

[11]E. Anderson et al., Users’ Guide, Third,, Society for Industrial and Applied Mathematics, Philadelphia, PA, 1999, ISBN: 0-89871-447-8 (paperback).

[12]CUBLAS Library User Guide (September 2016) by Nvidia, [Online]. Available: http://www.citeulike.org/user/lucaspa/article/8694641, (accessed on 6.03.19).

[13]Roy Dennington, Todd A. Keith, John M. Millam, GaussView, Version 6, Semichem Inc., Shawnee Mission, KS, 2016, [Online]. Available: http://gaussian.com/citation/ (accessed on 6.03.19.).

[14]Eviews, Version 10. [Online]. Available: https://www.eviews.com/home.html (accessed on 6.03.19).

[15]IBM Corp. Released 2017. IBM SPSS Statistics for Windows, Version 25.0. Armonk, NY: IBM Corp. [Online]. Available: https://www.ibm.com/analytics/ spss-statistics-software (accessed on 6.03.19).

[16]MATLAB and Statistics Toolbox Release 2012b, The MathWorks, Inc., Natick, Massachusetts, United States. [Online]. Available: https://www.mathworks.com/. (accessed on Mar, 6.03.19).

[17]J. Eaton, D. Bateman, S. Hauberg and R. Wehbring. GNU Octave version 3.8.1 manual: a high-level interactive language for numerical computations. CreateSpace Independent Publishing Platform. ISBN 1441413006, 2014. (accessed on Mar, 6, 2019), [Online]. Available: http://www.gnu.org/software/octave/doc/interpreter/.

[18]E. Frank, M.A. Hall, I.H. Witten, The WEKA Workbench. Online Appendix for Data Mining: Practical Machine Learning Tools and Techniques, 4th., Morgan Kaufmann, 2016.

[19]I. Grigore, E.S. Barna, Using Excel spreadsheets to study the vertical motion in a gravitational field, Procedia, Soc. Behav. Sci. 191 (2015) 27692775 (accessed on Nov, 4.11.18.) [Online]. Available: http://www.sciencedirect.com/science/ article/pii/S1877042815025197.

[20]M. Alfaro, Modeling of Polarization curves not exhibiting a Tafel region using Excel spreadsheets, Alexand. Eng. J. 53 (2014) 977983 (accessed on November, 4, 8) [Online]. Available: http://dx.doi.org/10.1016/j. aej.2014.07.005.

[21]VeryViz, Excel Add-Ins for Data Analysis, 2018, [Online]. Available: http://dx.doi.org/10.1016/j.aej.2014.07.005. (accessed on 6.03.19.).

[22]Add-In for Microsoft® Excel®. FRED, Federal Reserve Economic Data’s Federal Reserve Bank of St. Louis research database, 2017, [Online]. Available: https://research.stlouisfed.org/fred-addin/. (accessed on 6.03.19.).

[23]Operations Management/Industrial Engineering, Data Forecasting, 2011, [Online]. Available: http://www.me.utexas.edu/_jensen/ORMM/ excel/forecast.html (Accessed on 6.03.19.).

[24]SimTools and FormList, [Online]. Available: http://home.uchicago.edu/ rmyerson/addins.htm (accessed on 6.03.19.).

[25]W. Zhang, J. Liu, Application of Simulation Software in Analog Electronic Technology Teaching,” in 2018 International Conference on Education, Social Sciences and Humanities (ICESSH 2018). Chengdu, China, March, 25-26, 2018. ISBN: 978-1-60595-551-3, [Online]. Available: http://www.dpiproceedings.com/index.php/dtssehs/article/download/23793/23428, (accessed on 4.11.18.).

[26]S.M. Kengyelics, L.A. Treadgold, A.G. Davies, X-ray system simulation software tools for radiology and radiography education, Comput. Biol. Med. 93 (2018) 175183, https://doi.org/10.1016/j.compbiomed.2017.12.005 (accessed on 9.10.18).

[27]D. Pai, Use of simulation for undergraduate medical education, Int. J. Adv. Med. Health Res. 5 (1) (2018) 3-6, https://doi.org/10.4103/IJAMR.IJAMR_63_17 (accessed on 4.11.18.) [Online]. Available: http://www.ijamhrjournal.org/text. asp?2018/5/1/3/235609.

[28]C.W.J. Granger, Investigating causal relations by econometric model and crossspectral methods, Econometrica 37 (1969) 424439.

[29]A. Hatemi-J, A new method to choose optimal lag order in stable and unstable VAR models, Appl. Econ. Lett. 10 (3) (2003) 135137, https://doi.org/10.1080/ 1350485022000041050.

[30]S. Johansen, K. Juselius. Testing structural hypotheses in a multivariate cointegration analysis of the PPP and the UIP for UK [Online]. Available: https://doi.org/10.1016/0304-4076(92)90086-7 (accessed on 6.03.19.).

[31]D.M. Meko, GEOS 585A – applied time series analysis, Lecture Notes (2015) (accessed on 4.11.18), [Online]. Available: http://www.ltrr.arizona.edu/ webhome/dmeko/geos585a.html.

[32]A. Hatemi-J, ‘‘Forecasting properties of a new method to determine optimal lag order in stable and unstable VAR models, Appl. Econ. Lett. 15 (4) (2008) 239243, https://doi.org/10.1080/13504850500461613, accessed on 4.11.18.

[33]S. Hacker, A. Hatemi-J, Optimal lag-length choice in stable and unstable VAR models under situations of homoscedasticity and ARCH, J. Appl. Statist. 35 (6) (2008) 601615.

[34]H. Lütkepohl, New Introduction to Multiple Time Series Analysis, Springer, Berlin, 2005.

[35]A. Mustafa and A. Hatemi-J, Determining the optimal lag order of a VAR model, GitHub Repository, 2017. Accessed on October, 10, 2018, [Online]. Available: https://github.com/alanmustafa/OptLag-HJC.

[36]FRED, Federal Reserve Economic Data’s Federal Reserve Bank of St. Louis research database, 2017, [Online]. Available: https://research.stlouisfed.org (accessed on July, 24.07.17.).

[37]S. Johansen, Statistical analysis of cointegration vectors, J. Econ. Dynam. Control 12 (2-3) (1988) 231254, accessed on 4.11.18.

[38]A. Hatemi-J, Asymmetric causality tests with an application, Empir. Econ. 43 (1) (2012) 447456, accessed on 4.11.18.

[39]H. Pesaran, Y. Shin, Generalized impulse response analysis in linear multivariate models, Econ. Lett. 58 (1) (1998) 1729, https://doi.org/10.1016/S0165-1765(97)00214-0.

[40]A. Hatemi-J, Asymmetric generalized impulse responses with an application in finance, Econ. Model. 36 (2014) 1822, https://doi.org/10.1016/j.econmod.2013.09.014.

[41]STAT 510 – Applied Time Series Analysis, Lesson 11: Vector Autoregressive Models/ ARCH Models [Webpage]. The Pennsylvania State University. [Online]. Available: https://newonlinecourses.science.psu.edu/stat510/node/85/ (accessed on 6.03.19.).

[42]Microsoft Support Description of the limitations for working with arrays in Excel, [Webpage]. Microsoft Support Website. (accessed on 5.04.19.), [Online]. Available: https://support.microsoft.com/en-ca/help/166342/description-ofthe- limitations-for-working-with-arrays-in-excel, 2018.

[43]A. Hatemi-J, Hidden Panel Cointegration, Journal of King Saud University- Science (2018), forthcoming.

Acknowledgements

The authors would like to express their gratitude to the editor of this journal and four anonymous reviewers for their valuable comments that resulted in improving the paper significantly. However, the usual disclaimer applies. The publisher wishes to inform readers that the article “A VBA module simulation for finding optimal lag order in time series models and its use on teaching financial data computation” was originally published by the previous publisher of Applied Computing and Informatics and the pagination of this article has been subsequently changed. There has been no change to the content of the article. This change was necessary for the journal to transition from the previous publisher to the new one. The publisher sincerely apologises for any inconvenience caused. To access and cite this article, please use Mustafa, A., Hatemi-J, A. (2022), “A VBA module simulation for finding optimal lag order in time series models and its use on teaching financial data computation”, Applied Computing and Informatics. Vol. 18 No. 3/4, pp. 208-220. https://10.1016/j.aci.2019.04.003. The original publication date for this paper was 09/05/2019

Corresponding author

Alan Mustafa can be contacted at: alan.mustafa@ieee.org

Related articles