scieee AI-readable full text Open interactive document viewer

Forecasting the stock market using ARIMA and ARCH/GARCH approaches

Dinardi, Felipe Bardelli

Abstract

Forecasting stock returns forecasting is a crucially important topic in the study of finance, econometrics, and academic studies, and involves an in-depth study on time series. This thesis aims to examine the most representative companies on the São Paulo Stock Exchange, and based on that data, predict the behavior of future stock returns using several different forecasting methods. In time series analysis, ARIMA models are used in many situations and usually present good results; nevertheless, to determine which model best suits the data, others must be tested. When considering the high volatility of the data and factoring in the economic situation of the country that is being analyzed, other techniques must be considered, especially the ARCH family ones. Those techniques are primarily used to predict data involving Stock Markets worldwide. An accurate prediction can bring advantages for the companies who make those predictions and benefit the stakeholders directly since it provides enough information to make better decisions towards the future.

Full text

Forecasting the Stock Market Using ARIMA and ARCH/GARCH Approaches Felipe Bardelli Dinardi Dissertation presented as partial requirement for obtaining the Master’s degree in Statistics and Information Management 2 NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa FORECASTING THE STOCK MARKET USING ARIMA AND ARCH/GARCH APPROACHES by Felipe Bardelli Dinardi Dissertation presented as partial requirement for obtaining the Master’s degree in Statistics and Information Management, with a specialization in Information Analysis and Management. Advisor / Co-Advisor: Professor Jorge Mendes, PhD November 2019 3 ACKNOWLEDGMENTS I would like to take the opportunity to thank several people who helped me during the whole process of the thesis, as well as the curricular part of the program. First of all, Professor Jorge Mendes, who was my tutor in the research methodologies class and since the very beginning, provided all the help I needed in order the develop the work, including suggestions and comments essential for the development of the dissertation. Finally, my family and friends, who offered all the support I needed throughout the path. 4 ABSTRACT Forecasting stock returns forecasting is a crucially important topic in the study of finance, econometrics, and academic studies, and involves an in-depth study on time series. This thesis aims to examine the most representative companies on the São Paulo Stock Exchange, and based on that data, predict the behavior of future stock returns using several different forecasting methods. In time series analysis, ARIMA models are used in many situations and usually present good results; nevertheless, to determine which model best suits the data, others must be tested. When considering the high volatility of the data and factoring in the economic situation of the country that is being analyzed, other techniques must be considered, especially the ARCH family ones. Those techniques are primarily used to predict data involving Stock Markets worldwide. An accurate prediction can bring advantages for the companies who make those predictions and benefit the stakeholders directly since it provides enough information to make better decisions towards the future. KEYWORDS Stock Market; Forecasting; Time Series; ARIMA models; Stock Returns. 5 INDEX 1. Introduction .................................................................................................................. 9 1.1 Context ................................................................................................................... 9 1.2 Background .......................................................................................................... 10 1.3 Objectives and Study Relevance ......................................................................... 11 2. Literature review ........................................................................................................ 14 3. THEORETICAL FRAMEWORK ....................................................................................... 17 3.1. ACF and PACF....................................................................................................... 18 3.2. Stationarity .......................................................................................................... 19 3.3. ARIMA MODELS ................................................................................................... 19 3.3.1. AR Models..................................................................................................... 20 3.3.2. MA Models ................................................................................................... 20 3.3.3. ARMA Models ............................................................................................... 21 3.4. ARCH/GARCH models .......................................................................................... 23 4. Methodology .............................................................................................................. 25 5. Results and discussion ................................................................................................ 28 5.1 Data Analysis ......................................................................................................... 28 5.2 Exploratory Data Analysis ..................................................................................... 28 5.3 Arima Models ....................................................................................................... 30 5.3.1 Out-of-Sample Forecast ............................................................................... 34 5.4 ARCH Models ........................................................................................................ 35 5.5 Discussion ............................................................................................................. 38 6. Conclusions ................................................................................................................. 40 7. Limitations and recommendations for future works ................................................. 41 8. Bibliography ................................................................................................................ 42 9. AnNexes ...................................................................................................................... 44 6 LIST OF FIGURES Figure 1.1 - Process ................................................................................................................... 11 Figure 5.1 - Ambev Histogram .................................................................................................. 29 Figure 5.2 - Ambev Log Return ................................................................................................. 29 Figure 5.3 - Ambev Unit - Root test .......................................................................................... 29 Figure 5.4 - Ambev ACF and PACF ............................................................................................ 31 Figure 5.5 - Ambev Model Comparison .................................................................................... 31 Figure 5.6 - Ambev ARMA Model ............................................................................................. 32 Figure 5.7 – Residuals Ambev ACF and PACF ............................................................................ 32 Figure 5.8 - Ambev ARMA Forecast .......................................................................................... 33 Figure 5.9 - Out-of-sample forecast Ambev ............................................................................. 34 Figure 5.10 - Ambev Regression Outputs ................................................................................. 36 Figure 5.11 - Ambev Residuals .................................................................................................. 36 Figure 5.12 - Ambev ARCH Test ................................................................................................ 36 Figure 5.13 - Ambev ARCH Outputs .......................................................................................... 37 Figure 5.14 - Ambev ARCH Forecast ......................................................................................... 37 Figure 9.1 - Petrobras Log Return ............................................................................................. 44 Figure 9.2 - Itau S/A Log Return ................................................................................................ 44 Figure 9.3 - Itau Unibanco Log Return ...................................................................................... 45 Figure 9.4 - Vale Log Return...................................................................................................... 45 Figure 9.5 - Petrobras ARMA Forecast ...................................................................................... 45 Figure 9.6 - Itau S/A ARMA Forecast ......................................................................................... 46 Figure 9.7 - Itau Unibanco ARMA Forecast ............................................................................... 46 Figure 9.8 - Vale ARMA Forecast .............................................................................................. 47 Figure 9.9 - Out-of-Sample Forecast Petrobras ........................................................................ 47 Figure 9.10 - Out-of-Sample Forecast Itau/SA .......................................................................... 48 Figure 9.11 - Out-of-Sample Forecast Itau Unibanco ............................................................... 48 Figure 9.12 - Out-of-Sample Forecast Vale ............................................................................... 49 7 LIST OF TABLES Table 1.1 - Summary of the Questions ..................................................................................... 12 Table 3.1 - Course of Action for ARIMA models ....................................................................... 21 Table 3.2 - Theoretical Patterns of ACF and PACF .................................................................... 21 Table 5.1 - Summary of the results ........................................................................................... 30 Table 5.2 - Ambev Ljung-Box test ............................................................................................. 33 Table 5.3 - Summary of the results ........................................................................................... 33 Table 5.4 – RMSE Ambev model ............................................................................................... 34 Table 5.5 - Summary of the results Out-of-sample forecast ..................................................... 35 Table 5.6 - Summary of the results ........................................................................................... 37 Table 9.1 - Top 5 Brazilian Companies São Paulo Stock Exchange ............................................ 44 8 LIST OF ABBREVIATIONS AND ACRONYMS ACF Auto Correlation Function AI Artificial Intelligence AIC Akaike Information Criterion AR Autoregressive ARCH Autoregressive Conditionally Heteroscedastic ARIMA Autoregressive Integrated Moving Average DF Degree of Freedom GARCH Generalized Autoregressive Conditionally Heteroscedastic JB Jarque-Bera MA Moving Average PACF Partial Auto Correlation Function RMSE Root Mean-square Error 9 1. INTRODUCTION 1.1 CONTEXT The study of time series has been developed in many areas such as physics, engineering, anthropology, among others. Nevertheless, in recent years, the attention of many researchers in the field is focused on the study of financial time series. The reasons for this phenomenon can be easily understood if one considers the global scenario for the past several years, with a massive economic crisis in big markets such as the US and Europe. In this framework, the in-depth study of economic/financial time series, especially those involving modeling and statistical analysis applied to economics, becomes paramount. Since understanding and predicting future conditions are crucial, traditional forecasting techniques have been used to predict stock market returns. Such linear techniques, called ARIMA, usually produce good results for other fields. However, for financial time series, they must be studied carefully because, in most cases, they are not the best models to understand the past to predict the future. In the forecasting field, financial markets can be considered as a special case, due to volatility, which happens because financial markets do not follow a pattern, and usually, present large variability over time for many different reasons. Hence the main reason for the development of other methods such as ARCH models and its derivations, this family of models imputed as heteroscedastic models for modeling time series to predict the future behavior of the returns. Heteroscedasticity in statistical terms can be defined as a statistical phenomenon in which observations exhibit different variances over time, and it fits perfectly in financial time series behavior. Although volatility is in financial market data, the linear models are also going to be tested, since some companies might present a more stable time series and the heteroscedastic models might not produce better results for those. After carefully studying the behavior of each time series and based on the results of each the models, the best will be chosen, and the predictions will be made. 16 Given the model introduced by Engel, Bollerslev introduced the Generalized ARCH model called the GARCH model. In this model, the conditional variance depends not only on the disturbance term of the previous period but also on the conditional variance of the previous period (Abounoori & Tour, 2019). GARCH (1,1) is the most widely used model. Akgiray (1989) is the first researcher who used the GARCH model to forecast volatility, and he demonstrated that GARCH produces better forecasts than most of the other forecasting methods such as Random Walk (RW), Historical Mean (HM), Moving Average (MA), and exponential smoothing (ES) when applied to monthly US stock market data (Miles & Huberman, 1994); (Chtourou, 2015). The GARCH model family is a series of models designed to explain the regularity of fluctuations in time series, and they prove to be of really good ability when describing the volatility of financial data, adding a wide range of theoretical and practical value (Lin, 2018). In this particular paper, the model was used to predict the stock market in China. It achieved the best performance among several models. The author also points to the fact that those models are usually more effective when used to predict financial time series in developed countries, nevertheless the methodology worked perfectly, even given the features of the Chinese market and the characteristics of the time series in this case. 17 3. THEORETICAL FRAMEWORK Initially, it is important to define time series, to understand the concept, and by consequence, the further application of the models, better. A time series can be defined as a collection of random variables indexed according to the order they are obtained in time. The primary objective of time series analysis is to develop mathematical models that provide plausible descriptions for sample data (Shumway & Stoffer, 2011). In the context of time series analysis, several techniques might be used to understand how the data behaved over time and to make predictions. In this work, a few models will be tested and studied in further detail, particularly the ARIMA and ARCH/GARCH models, with a special emphasis on the ARIMA models. When dealing with time series analysis, some important steps must be followed. One of the first and most critical aspects, predominantly, is to plot the data on a graph at the outset. In this way, some features regarding the time series can be observed, and the researcher can understand more about the kind of data under deliberation. From the plot of the data, the existence of some kind of trend in the data can be detected, which means that the data must be observed, and downward or upward movements over time must be discerned. Another important aspect is the presence of the seasonality in the data, which means some repeating patterns over time. This facet is particularly important for a variety of forecasting methods since some of them are not able to deal with seasonality, and it must be removed before the forecasting procedure. Outliers are other issues that must be analyzed in a time series. The occurrence of outliers is particularly important in regression models and can even alter the efficiency of the model. The variance must also be analyzed to understand if the data varies over time, or if the variance is constant, which might sometimes be hard to identify when only considering the plot of the data. The normality of the data must be tested before modeling, since this is not necessarily possible by just looking at the histogram, another way of testing, is to apply the Jarque-Bera test, which is a normality test. This test first computes the skewness and kurtosis measures of the OLS residuals and uses the following test statistic: 18 Where n is equal to the sample size, S the skewness coefficient, and K the kurtosis coefficient. For a normally distributed variable, S = 0 and K = 3. Therefore, the JB test of normality is a test if the joint hypothesis that S and K are 0 and 3, respectively. In that case, the value of the JB statistic is expected to be 0. Under the null hypothesis that residuals again are normally distributed, Jarque and Bera showed the JB test asymptotically follows the chi-square distribution with two df in the given equation. Applications of the test will be seen in the data analysis section. 3.1. ACF AND PACF Another important concept before defining the models themselves is to make a definition of the Autocorrelation Function (ACF) and the Partial Autocorrelation Function (PACF). The ACF is defined as: The ACF measures the linear predictability of the series at time t, say , using only the value (Shumway & Stoffer, 2011). The partial autocorrelation function gives the partial correlation of a stationary time series with its own lagged values, regressed the values of the time series at all shorter legs. It contrasts with the autocorrelation function, which does not control for other lags. In general, a partial correlation is a conditional correlation. It is a correlation between two variables under the assumption that we know and consider the values of some other set of variables if considering a regression where, , , and are predictor variables. In this scenario, the partial correlation between and is the correlation between variables determined considering how both are related to and . It can be mathematically denoted as: To determine the order of the models being considered, the ACF and the PACF must be analyzed together. 19 3.2. STATIONARITY Stationarity is another concept that is crucial while modeling data. A stationary time series must have a constant mean and variance over time. Broadly speaking, a stochastic process is said to be stationary if its mean and variance are constant over time and the value of the covariance between the two periods only depends on the lag between the two time periods and not the actual time at which the covariance is computed (Gujarati, 2003). Broadly speaking, a time series is said to be stationary if there is no systematic change in mean (no trend) over time, if there is no systematic change in variance and if period variations have been removed (Aljandali & Tatahi, 2018). One important point to be noted is that before executing any time series analysis the time series data is supposed to be stationary. There are different test for stationary diagnosis, like Augmented Dickey Fuller test. If data is stationary then we can proceed, on the other hand if it is not, then we difference it and make stationary. ARMA model of the differenced series is called ARIMA model (Prasad & Choubey, 2018). In order to determine stationarity in a time series, a few procedures can be undertaken. One of them is a test denominated as the Augmented Dickey-Fuller ADF test. The test consists in estimating the following equation: The number of lagged difference terms to include is often determined empirically. The idea is to include enough terms so that the error term in the equation above is serially uncorrelated. Details in the application and the assumption for the test can be seen when they are applied in the time series. 3.3. ARIMA MODELS In the context of this research, the ARIMA models will be the ones most analyzed. It is, therefore, imperative to understand them well. These models, also known as the Box- Jenkins methodology, encompass autoregressive and integrate with moving average methods. Thus, the origin of the term ARIMA (Autoregressive Integrated Moving Average). 20 The models were introduced in 1976 and are based on the estimation of the dependent variable y as a function of the lag of the y variable itself, indicated by p autoregressive terms, q terms representing the past errors. As most economic/financial time series are not stationary, the application of the ARIMA models (p,d,q) demands the transformation of the variables. The ACF and the PACF must be analyzed in conjunction to determine the orders of the model, where the goal is to minimize the AIC, which is a method of measuring the quality of the model. We must first introduce the AR (Autoregressive) and MA (Moving Average) terms of the equation to understand the models better. 3.3.1. AR Models Autoregressive models are based on the idea that the current value of the series, , can be explained as a function of the past values. This can be defined by the equation: 𝑋𝑡= Φ1𝑋𝑡−1+ Φ2𝑋𝑡−2+⋯+Φ𝑝𝑋𝑡−𝑝 + 𝜀𝑡 Where is the observation in time t, is the parameter of the model AR, is the order of the model, and represents the error that cannot be explained by the model. 3.3.2. MA Models As an alternative to the autoregressive representation in which the on the left-hand side of the equation is assumed to be combined linearly, the moving average model of order q, abbreviated as MA(q), assumes that white noise on the right-hand side of the defining equation is combined linearly to form the observed data (Shumway & Stoffer, 2011). This can be represented as: 𝑋𝑡= ω𝑡+ θ1ω𝑡−1+θ2ω𝑡−2+⋯+θ𝑞ω𝑡−𝑞 Where there are q lags in the MA, and , , … , are the parameters. 21 3.3.3. ARMA Models Together, the two previous models form the ARMA model. They can be mathematically be represented as: 𝑋𝑡= Φ1𝑋𝑡−1+ Φ𝑝𝑋𝑡−𝑝 + 𝛼𝑡− θ1α𝑡−1−⋯− θ𝑞α𝑡−𝑞 It is important to mention that these models are not suitable to model non-linear relationships. Nevertheless, they are very important to the understanding of stationary time series and autoregressive models. The model already discussed is the integration of the AR and MA models proposed by Box and Jenkins. The table below presents the order of the events when modeling using ARIMA models: STEP ACTION 1 Examine the series for stationary. Analyze ACP and PACF and perform the unit-root test 2 If it is not stationary, difference it one or more times to make it stationary 3 Identify if the series is AR, MA or ARIMA 4 Estimate the model 5 Analyze the residuals 6 Forecast using the model Table 3.1 - Course of Action for ARIMA models With regard to the points in the table, it is salient to mention that the ACF and the PACF must be analyzed to estimate the orders of the model. The table below shows the theoretical patterns for ACF and PACF: Type of Model Typical pattern of ACF Typical pattern of the PACF AR (p) Decays exponentially or with damped sine wave pattern or both Significant spikes through lags p MA (q) Significant spikes through lags qDeclines exponentially ARMA (p,q) Exponential decay Exponential decay THEORETICAL PATTERNS OF ACF AND PACF Table 3.2 - Theoretical Patterns of ACF and PACF Another important detail involves the residuals of the model. The residuals from the tentative model are examined to find out if they are white noise. If they are, the tentative model is probably a good approximation to the underlying stochastic process. If they are not, the process is started all over again. Therefore, the Box-Jenkins method is iterative (Gujarati, 2003). 22 As mentioned previously, one of the methods to evaluate the model is the Akaike Information, which can be written mathematically as: ln𝐴𝐼𝐶 = 2𝐾 𝑁 +ln 𝑅𝑆𝑆 𝑛 Where k is the number of regressors, n is the number of observations and RSS the Residual Sum of Squares, which is a measure of the discrepancy between the data and the estimation model. The intention when comparing two or more models is to consider the model with the lowest AIC. The model penalizes the error in the variance by a term proportional to the number of parameters. Finally, analyzing the residual requires a specific test, which is called the Ljung-box test. In the context of the model, the residuals must be independent of each other. The p-value of the test will show whether the residuals are independent or not. The null hypothesis for this test is that the residuals are not correlated. The Ljung-Box test statistic can be defined as: Where T is the sample size, is the sample correlation at lag h and N is the number of lags being tested. Considering that the out-of-sample forecast will be performed, other measures might be helpful to evaluate the predictive power of the model. In this scenario worth to present the Root Mean-square error (RMSE). The RMSE is a frequently used measure of the difference between the observed and the predicted values, and it is highly efficient to measure the accuracy of the model. Although the threshold might be difficult to define, it is a measure that researchers must consider. Can be defined as: 23 Where N is the number of observations and predicted and actual are the values of the model. 3.4. ARCH/GARCH MODELS The ARCH family modes emerged in the context of high volatility. It is normally used in the context of financial time series due to its characteristics, such as high variance and volatility. ARCH, in this case, stands for autoregressive conditional heteroscedasticity. As the name suggests, heteroscedasticity, or unequal variance, may have an autoregressive structure in that heteroscedasticity observed over different periods may be uncorrelated (Gujarati, 2003). In essence, the ARCH model is a model for volatility in a time series. In order to make it possible to use the ARCH model, a test must be performed to make sure that the time series present the necessary features that justify the use of the heteroscedastic models. If the time series has mean 0, the ARCH model can be written as: Where : The ARCH(1,0) model for the variance of the model is that conditional on , the variance at the time t is: The analysis of the ACF and the PACF must be done to understand the orders of the model, and the model can be tested after this step. ARCH models have had several variations since they were first developed. These variants include the GARCH models, which are the generalized autoregressive conditional 24 heteroscedasticity models. The most popular version of the model is GARCH (1,1), and it can be mathematically written as: GARCH models were only presented as variations of the ARCH. In the framework of this study, those models will not be used. 25 4. METHODOLOGY As previously described, the main objective of the study is to undertake an in-depth probe into time series analysis, to understand the past, and predict the future. In works of this nature, the following steps are taken to achieve better results, in general: • Problem Definition • Information Gathering • Exploratory Data Analysis • Choice of the Best Model • Evaluation of the results Problem Definition The problem definition is the first point, and it is essential to define all the steps of the study. The question for this study is relevant to the stock market and financial fields. It is also a conundrum that other researchers are trying to understand better. Furthermore, the problem definition also helps to delimitate the questions dealt with in the research, which should not exceed the limits proposed in the first place. Information Gathering Due to legal issues and transparency, all data involving financial markets have to be published. In this scenario, all information needed to develop this study can be found on the São Paulo Stock Exchange website, and in many other internet tools devoted to studying this field. 32 Figure 5.6 - Ambev ARMA Model Although it is considered the best model based on the AIC, after further analysis, we can see that not all coefficients are statistically different from 0, and this conclusion can be reached by calculating the ratio between each coefficient and the standard error. In terms of the residuals, the table below shows that they are white noise, which is a positive point in the model since it shows that there is no information in the residuals that might be helpful for the model: Figure 5.7 – Residuals Ambev ACF and PACF Another important factor to be considered is the independence of the residuals, which is measured by the Ljung-Box test, and taking into account the high p-value for this test, the conclusion is that the residuals are independent of each other: 33 p-value 0,5841 Ljung-Box Test Table 5.2 - Ambev Ljung-Box test Regarding the forecast for this model: Figure 5.8 - Ambev ARMA Forecast As expected, for the stationary model, the forecast will eventually converge to the mean and stay at this level for the remaining periods. In the plot above, before the forecast converges to the mean, some predictions are made. The table below shows the summarized results for the other companies analyzed: Petrobras Itau S/A Itau/Unibanco Vale Features Order Best Model ARMA (3,3) ARMA (3,3) ARMA (4,4) ARMA (3,3) AIC -2,742414 -3,591795 -3,526002 -2,537487 Residuals White noise White noise White noise White noise Ljung-Box Test Independent Residuals Independent Residuals Independent Residuals Independent Residuals Effective in the short term, but Effective in the short term, but Effective in the short term, but Effective in the short term, but eventually converges to the mean eventually converges to the mean eventually converges to the mean eventually converges to the mean and stay at this point for all periods and stay at this point for all periods and stay at this point for all periods and stay at this point for all periods Companies Forecasting Table 5.3 - Summary of the results 34 5.3.1 Out-of-Sample Forecast Considering the results presented so far, and to attest that the models described previously are the best to make predictions, the out-of-sample forecast will be performed. Comparing the fit out-of-sample allows us to evaluate features of model performance that are important for practical applications. In the previous section, important conclusion about the model were reached, such as the ability of the ARMA models to make predictions in the short-term. Hence, the out-of-sample forecasting should be done considering the short term, to produce better results. The period used to make the predictions involves the weekly data of the year of 2017. Regarding the company Ambev: Data Out-of-Sample Forecast Figure 5.9 - Out-of-sample forecast Ambev As the graph shows, although the data tends to stay around the mean, it has the ability of making predictions in the short-term. The modelling was made considering the best model for the company, which is the ARMA (2,3) based on the AIC. For the same model, the RMSE was calculated, as follows: Company Model RMSE Ambev ARMA (2,3) 4,16745 Table 5.4 – RMSE Ambev model The same procedure was adopted for all the other companies: 35 Petrobras Itau S/A Itau/Unibanco Vale Features Model ARMA (3,3) ARMA (3,3) ARMA (4,4) ARMA (3,3) RMSE 9,340332 5,595034 5,497613 10,21861 Make predictions in the short term Make predictions in the short term Make predictions in the short term Make predictions in the short term but with time converges to the mean but with time converges to the mean but with time converges to the mean but with time converges to the mean Companies Forecasting Table 5.5 - Summary of the results Out-of-sample forecast In the table are summarized the values founded by company. Other models were compared and those of the table are the best based on the RMSE. 5.4 ARCH MODELS The ARCH (Autoregressive Conditionally Heteroscedastic), is a model for a variance of a time series. The methodology was developed, especially to deal with the high volatility in problems involving econometrics and finance. The goal of this work is to understand which model produces better results considering financial time series in the Brazilian stock market (São Paulo Stock Exchange), and although ARCH models are considered particularly attractive when dealing with financial time series, they might not be the best ones in every case. The ARCH/GARCH models will be performed for each of the companies to compare the results, and after the full analysis, the results will be compared, considering the results of the ARIMA modeling as well. As the first step, the model should be run. By doing this procedure, we will be able to analyze the residuals and identify if the ARCH family models might be suitable for the analysis. We need to confirm the presence of heteroscedasticity in the data series before processing to modeling, and this can be achieved by doing the ARCH effect test. Financial assets price of stock index series or another high-frequency data will often appear in the feature that a large fluctuation usually followed by another large fluctuation, and a small fluctuation usually followed by another even smaller fluctuation, this is called the ARCH effect (Lin, 2018). Appertaining to the outputs of the analysis for the company Ambev: 36 Figure 5.10 - Ambev Regression Outputs ARCH models are specifically designed to model and forecast conditional variances. The variance of the dependent variable is modeled as a function of past values of the dependent variable, in this case the dependent variable are the returns considered in the study. The next step is to look at the residuals: -.10 -.05 .00 .05 .10 .15 -.10 -.05 .00 .05 .10 .15 8/1/10 28/5/10 15/10/10 4/3/11 22/7/11 9/12/11 27/4/12 14/9/12 1/2/13 21/6/13 8/11/13 28/3/14 15/8/14 2/1/15 22/5/15 9/10/15 26/2/16 15/7/16 2/12/16 Residual Actual Fitted Figure 5.11 - Ambev Residuals Based on the residuals, the conclusion is that the volatility is constant, and there are no periods without volatility. The ARCH test must be performed to validate the conclusions: Heteroskedasticity Test: ARCH F-statistic 1.273428 Prob. F(1,362) 0.2599 Obs*R-squared 1.275975 Prob. Chi-Square(1) 0.2586 Figure 5.12 - Ambev ARCH Test 37 With regard to the test, the null hypothesis is that there is no ARCH effect, and the alternative hypothesis is that there is an ARCH effect. In this case, the null hypothesis cannot be rejected (since the p-value is above 5%), so there is no ARCH effect. If performing the ARCH modeling and forecasting, in this case, the results will be poor: Variable Coefficient Std. Error z-Statistic Prob. C 0.002494 0.001479 1.685569 0.0919 Variance Equation C 0.000737 6.70E-05 10.99135 0.0000 RESID(-1)^2 0.091523 0.060293 1.517977 0.1290 R-squared -0.000029 Mean dependent var 0.002647 Adjusted R-squared -0.000029 S.D. dependent var 0.028481 S.E. of regression 0.028481 Akaike info criterion -4.271231 Sum squared resid 0.295270 Schwarz criterion -4.239177 Log likelihood 782.4996 Hannan-Quinn criter. -4.258492 Durbin-Watson stat 2.064153 Figure 5.13 - Ambev ARCH Outputs -.06 -.04 -.02 .00 .02 .04 .06 .08 8/1/10 24/12/10 9/12/11 23/11/12 8/11/13 24/10/14 9/10/15 23/9/16 9/9/17 25/8/18 10/8/19 25/7/20 10/7/21 LOG_RETURNF ± 2 S.E. .00077 .00078 .00079 .00080 .00081 .00082 8/1/10 24/12/10 9/12/11 23/11/12 8/11/13 24/10/14 9/10/15 23/9/16 9/9/17 25/8/18 10/8/19 25/7/20 10/7/21 Forecast of Variance Figure 5.14 - Ambev ARCH Forecast The results above were provided by the software considering an ARCH (1,0) model. The table below shows the summary of the results for the other companies: Petrobras Itau S/A Itau/Unibanco Vale Test ARCH Effect No No No No Companies Table 5.6 - Summary of the results 38 Since the time series regarding the companies do not present the ARCH effect, this technique proved to be not effective in the case of the Brazilian market for the period under study. 5.5 DISCUSSION Dealing with stock market data is always challenging in the sense that several factors might influence how the market behaves. The stock market is constantly changing with uncertainties. Rapid dissemination of information and fast capital flow will lead to fluctuations in the stock price, and the undulating price and the undulating price will affect the market in return (Lin, 2018). Considering similar studies in other markets, the ARCH models are prevalent and in general, are used more often than other methods, primarily due to the characteristics of the data such as high volatility. The literature supports the application of ARIMA and ARCH models to analyze and make predictions based on time series data. Specific characteristics of the data and even of the market being analyzed gives us some clue about which model might be more suitable. For financial markets in general, due to the characteristics of the time series, heteroscedastic models are very popular. The conclusions about the results will be presented next, but some discussion concerning the findings must be made. The first factor is that even though heteroscedastic models perform well when trying to predict financial markets, in the specific market applied in this research, they were not as effective as they usually are, at least taking into consideration the literature on the topic. Another important point is that even the ARIMA models efficacious for short-term predictions are not effective in the long-term. This aspect is another characteristic that the theory supports since these models tend to converge to the mean of the time series in the long-term and remain at that point for future periods. In summary, the research reached the goal of understanding which methods perform better in respect of the Brazilian scenario for the time frame studied. The results confirmed what the theory states. Heteroscedastic models are not necessarily the best as they usually are in 39 other markets. Besides, even though ARMA models do not provide the best predictions, are the ones under study who can provide better results, especially in the short-term. 40 6. CONCLUSIONS The conclusion is that in the framework of the Brazilian stock market, ARIMA models perform better. Even given the problems with long-term forecasting, modeling the data with the ARIMA approach produces better results. The best way to use this approach granted the limitations would be to predict short-term with ARIMA and evaluate the quality of the predictions in each period. The other approach that was considered to model the data was the ARCH approach. Nevertheless, the data does not present the features that are necessary to frame the analysis using this methodology. As the data analysis has shown, one of the key aspects to determine whether the ARCH model family might be suitable or not, namely, the ARCH effect is not present in any of the time series studied. Thus, in this case, this methodology will not produce good results considering the forecasting. Other time frames can be studied in the attempt to identify if the ARCH effect is present, and in this case, this mechanism can be used to produce forecasting for stock returns. During the period that the study focused on, the Brazilian market behaved very well, without any degree of oscillations. This fact can explain why simpler models such as ARIMA were more effective in the attempt to forecast stock returns. Usually, concerning other markets, ARCH models are more effective during the high oscillations in the market due to crises and several other events that might influence this process. In the framework of the Brazilian stock market, higher fluctuations during the period would change the results entirely. 41 7. LIMITATIONS AND RECOMMENDATIONS FOR FUTURE WORKS The study was conducted using the most popular techniques to make predictions in financial markets, specifically the ARIMA and ARCH/GARCH models. Nonetheless, several other techniques are also being used for this purpose nowadays. Even though financial time series is a distinctive case due to its features such as high volatility in some periods, or even constant depending on the market, other techniques might produce good results. Recently, data mining techniques and artificial intelligence techniques like decision trees, rough set approach, and artificial neural networks have been applied to this area (Al- Radaideh, Assaf, & Alnagi, 2013), and presenting good results. A further study involving those time series might be to test a few AI techniques such as Neural Networks and compare them with traditional ones, to establish some comparisons on the outputs. In summation, more techniques can be analyzed and tested to produce even better results or to prove the traditional techniques as being the best to use in the financial field. Regardless of the chosen technique, it is important to mention that during the period studied the financial time series presented a regular behavior, which means that the results would be different if during the period the market was facing instability due to crisis or any other event. Hence, the conclusions of the study could have been different in this scenario. 48 Data Out-of-Sample Forecast Figure 9.10 - Out-of-Sample Forecast Itau/SA Data Out-of-Sample Forecast Figure 9.11 - Out-of-Sample Forecast Itau Unibanco 49 Data Out-of-Sample Forecast Figure 9.12 - Out-of-Sample Forecast Vale Page | i