• No results found

Market intraday momentum : volatility improves out-of-sample return predictions?

N/A
N/A
Protected

Academic year: 2021

Share "Market intraday momentum : volatility improves out-of-sample return predictions?"

Copied!
54
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Market Intraday Momentum: Volatility Improves

Out-Of-Sample Return Predictions?

Tom Schellings

A thesis submitted in partial fulfillment for the

degree of Bachelor of Econometrics

in the

Faculty of Economics and Business

University of Amsterdam

Supervisor: MSc L. HAO

Assessor: Dr K.J. van GARDEREN

(2)
(3)

This document is written by Student Tom Schellings who declares to take full responsibility for the contents of this document. I declare that the text and the work presented in this document are original and that no sources other than those mentioned in the text and its references have been used in creating it. The Faculty of Economics and Business is responsible solely for the supervision of completion of the work, not for the contents.

(4)

Abstract

The literature concerning high frequency return predictions applied to the biggest financial market,

namely the foreign exchange market is relatively narrow. This thesis attempts to broaden this by

studying to what extend the last half-hour returns can be predicted out-of-sample more accurately for

volatile periods than for less volatile ones for the currency pair EUR/HUF, using the first half-hour

returns. Statistical tests are performed to test for a significant difference in forecast accuracy of both

periods, whereby the moving block bootstrap plays an essential part. Different results are found,

whereby in most cases the volatile period outperformed the low volatile one in terms of having a

significantly lower Mean absolute scaled error. However the test results are dependant on the chosen

(5)

Contents

1 Introduction 1

2 Theoretical Context 3

2.1 Volatility . . . 4

2.2 Interval length . . . 5

2.2.1 First half hour returns . . . 5

2.2.2 First two 5-minutes returns . . . 6

2.3 Trading hours . . . 6

3 Data 9 4 Methodology 11 4.1 Moving block bootstrap . . . 11

4.2 First Hypothesis . . . 13

4.3 Second Hypothesis . . . 15

5 Results 17 5.1 Is the level of volatility different? . . . 17

5.2 Is the forecast accuracy different? . . . 18

5.3 Hypotheses applied to USD/RUB . . . 19

5.3.1 First hypothesis applied to USD/RUB . . . 20

5.3.2 Second hypothesis applied to USD/RUB . . . 20

(6)

B Tables 29

C Stata code 31

D R code 33

(7)

Chapter

1

Introduction

The decrease of the British pound sterling relative to the United States dollar of roughly 10 percent in just one trading day (Plakandaras, Gupta, & Wohar, 2016) illustrates the economic importance of predicting returns on a short horizon. Despite the wide variety of literature on predicting returns, many of these studies experienced difficulties finding return predictions that were of statistical significance.

Goyal and Welch (2006) examined the performance of predictive regressions by comparing the historical average returns to forecasted excess returns, using predictive regressions on predictor variables. They found no models that outperformed the historical average returns. Nonetheless, they encouraged the profession to find some variable that has meaningful and robust empirical excess return forecasting power.

Campbell and Thompson (2008) managed to do so by finding a number of variables that are correlated with subsequent returns on the aggregate U.S. stock market in the twentieth century. Their predictor variables performed better out of sample than the historical average return forecast when weak restrictions were imposed on the signs of coefficients and returns forecasts.

The majority of the return prediction studies, including the above mentioned ones, are confined to return patterns at the monthly or weekly frequency (Gao, Han, Li, & Zhou, 2017). However, by using a shorter horizon, more long and/or short trades can be carried out for the benefit of investors. Gao, Han, Li and Zhou (2017) analyzed half hour returns of the SP 500 ETF from 1993-2013 and noticed an intraday momentum pattern, which they described as: "The first half hour return on the market since the previous day’s market close significantly predicts the last half-hour return on the market."

They have given two explanations for this pattern. Firstly, intraday momentum can be driven by investors who delay their portfolio re-balancing to the last half-hour for settlement to avoid overnight risk. Secondly, the presence of late-informed investors: Well-informed investors push up the price in the first half hour and late-informed buy in the most liquid period, which is the last-half hour. They also conclude

(8)

is mainly concentrated on Exchange Traded Funds (ETF’s), which gives rises to the question whether intraday momentum patterns can be found on other financial markets. Elaut, Frömmel and Lampaert (2018) confirm this by finding intraday momentum patterns on the foreign exchange market (where investors can trade currencies) for the RUB/USD currency pair. However they conclude that explicit trading hours matter for intraday momentum, which excludes the majority of the financial instruments on the foreign exchange market.

Their research is limited to the currency pair RUB/USD. It is not known whether such momentum pattern can be found for different currency pairs on the foreign exchange market. Besides the fact that research on this topic is relatively novel, the above mentioned studies are exposed to another important issue, with respect to the assumptions made and their impact on the validity of the results. Chapter four explains some potential issues, with respect to these assumptions.

The aim of this thesis is to contribute to the relatively little research that is currently available on intraday momentum patterns. This is done by studying the following research question: to what extend can the last half-hour returns be predicted out-of-sample more accurately for volatile periods than for significantly less volatile ones for the currency pair EUR/HUF, using the first half-hour returns? Based on Elaut, Frömmel and Lampaert (2018)’s findings a currency pair with explicit trading hours is chosen to be the financial instrument of interest. For simplicity purposes, the first- respectively last half-hour returns are referred to as opening- respectively closing returns.

The next chapter explains more about trading hours in general on the foreign exchange market, which impacted the choice of currency pair. The methodology in this thesis deviates from the current research, by taking a different approach which does not require all assumptions, stated in the above described literature.

The thesis is structured as follows: The next chapter presents the theoretical context. Building upon that, the third chapter describes the data used in this study and the fourth chapter introduces the methodology used for the research in this thesis. Finally, the fifth chapter discusses and interprets the results, followed by the conclusion. In addition, appendices show the figures, tables and the code used for the empirical analysis.

(9)

Chapter

2

Theoretical Context

This chapter describes the available theoretical and empirical literature, which serves as the framework of the empirical research, discussed in the next chapters. The literature is used to complement current research, but also to challenge it by studying potential weaknesses. The latter is mainly done in the first section of the fourth chapter. Besides studying weaknesses, an alternative approach is discussed which uses different assumptions that avoid those issues.

Making assumptions is often unavoidable in research, yet having substantiated ones is critical to obtain valid results. A relatively small bias, caused by a wrong assumption can have a significant impact on the profitability of a trading strategy that is based on high frequency return predictions, especially on a market where roughly five trillion US dollars are traded on a daily basis (Bank for International Settlements, 2013).

The below discusses the most important findings of current literature on intraday momentum modelling. In order to understand how these results are obtained, a selection of the used methodology is explained in this chapter. Subsequently, these paragraphs are used to build upon in order to construct hypotheses which are used to study the research question. Before these can be constructed, it is important to explain the type of data and the methodology first since they play a crucial part in the construction of the hypotheses.

The following two topics are further examined below: i) The positive correlation between volatility and the predictability of returns, and ii) The influence of the chosen time intervals on the predictability of returns. It has to be taken into account that the discussion of the aforementioned theories does not cover all assumptions and choices made in the literature of high frequency return predictions. Challenging other assumptions and choices made in that literature that are not covered in this thesis is an important field for future research.

(10)

2.1

Volatility

This section zooms in on: i) the findings of Gao et al. (2017) with respect to the impact of volatility on the predictability of the last half-hour returns, and ii) Modelling choices made which led to those findings.

Gao et al. (2017) studied how intraday momentum, as defined in the introduction, is affected by volatility as follows: To start of, they measure the volatility of the first half-hour returns. Subsequently, the data is split into three groups, based on the level of first half-hour volatility. Lastly predictive regressions are executed and their outcomes are discussed. Before discussing their results, the models, leading to those are briefly explained below.

The half hour returns are defined by Gao et al. (2017) as follows: rj,t =

pj,t

pj−1,t

− 1, j = 1, ..., N (2.1)

The variables are defined as follows: pj,trepresents the price of the financial product of the j-th half

hour on day t and pj−1,trefers to the price of that product of the previous half hour on that same day.

The subscript t distinguishes one trading day from another. The first-half hour return of today’s trading day uses the last-half hour price of yesterday’s trading day and the first half-hour price of today’s. N is used to denote the last half hour. The amount of half-hours in a trading day is market specific and can be a challenge for return predictions for foreign exchange markets. This potential market specific issue is explained in the section 2.3.

Subsequently, the minute by minute returns of the first half-hour are calculated, using the aforemen-tioned formula. Then, terciles are made of the minute by minute returns, whereby the first tercile has the lowest estimated volatility of the three.

For each group, the following predictive regression is performed:

rN,t= α + βr1,t+ t, t = 1, ..., T (2.2)

This regression predicts the last-half hour return, using the first half-hour return on trading day t out of a total of T . The outcomes point out that the predictability is the lowest for the least volatile tercile and the highest for the most volatile one. This is measured by Gao et al. (2017) with i) The level of R2, which result from the above mentioned regressions, and ii) the significance of the β coefficient.

Gao et al. (2017) also performed predictive regressions, using data from the financial crisis of December 2007 to June 2009. The obtained R2 increases significantly compared to their data sample that excluded the financial crisis. Parallel they compare the results using non crisis data, which results in weaker predictability. They point out the high volatility characteristics of the financial crisis, which is a possible explanation for the increase in predictability compared to non financial crisis data.

(11)

The positive correlation between volatility and predictability of intraday momentum is an remarkable result from Gao et al. (2017). However, as mentioned in the introduction, current literature on intraday momentum is relatively narrow. The limited statistical proof is provided by Gao et al. (2017) is an opportunity to explore the influence of volatility on the predictability of intraday momentum. The main statement of this paper provided in the introduction incorporates an alternative approach to the study performed by Gao et al. (2017).

2.2

Interval length

As mentioned in the introduction, most literature uses low frequency data for their return predictions. The relatively marginal available literature which focuses on high frequency data does not always use the same time interval for their predictions. Therefore the question arises what the optimal interval length is, which results in the highest forecast accuracy of return predictions.

Given the infinite possibilities of interval lengths, it is out of scope of this thesis to determine the optimal interval length. Therefore, it is decided to discuss two interval lengths originating from the aforementioned literature. Furthermore, motivation is given why thirty minute intervals are chosen for the research question. However this does not mean that the second interval, namely five minute intervals, cannot be studied in future research.

2.2.1 First half hour returns

Gao et al. (2017) and Elaut (2018) both use half hour intervals to predict the last half hour returns of their examined investment products. Both studies are restricted to these intervals, but an economic theory is provided by Gao et al. (2017) which supports their chosen interval length: Whenever a significant news event is released, it is more likely that the market is closed.

From the latter, the following economic reason follows intuitively: An investor cannot re-balance it’s portfolio when the market is closed. This leaves him/her exposed to the risk that his/her portfolio loses value due to the impact of the news event on that portfolio. Gao et al. (2017) mentions that the market usually needs approximately thirty minutes to react to news events. They substantiate this with the presence of high volume and high volatility in the first half-hour the market is open. They also mention that this high volume and volatility decreases after the first half-hour and and increases in the last half-hour. Gao et al. (2017) remarks a U-shaped pattern of daily trade volume.

(12)

2.2.2 First two 5-minutes returns

Chen (2013) takes a different approach, which makes use of the first two 5-minute returns to predict the returns of the rest of the trading day. Empirical evidence is found by him, which results in a profitable trading strategy applicable to the Taiwanese futures market. He examines whether the opening returns can endure near the closing of the market on a trading day.

A number of economic theories are provided by Chen (2013) to support his choice of intervals. He mentions that the actions of informed traders may influence the first two 5-minute returns and volume. Both Gao et al. (2017) and Chen (2023) remark the relatively high trading volume near opening and-closing of the market compared to trades made between those moments. Another finding of Chen (2023) is that the opening returns may have a signaling function of informed investors. Delaying their portfolio re-balancing near the end of the market closure is a remark both Gao et al. (2017) and Chen (2013) make. Chen (2013) states that the time intervals used in his study are likely to work on financial markets other than the Taiwanese futures market.

The above paragraphs discusses two approaches with respect to time intervals used to predict returns on an intraday basis. The approaches taken are not directly comparable due to two reasons: Firstly, the examined financial markets are not the same. Each financial markets has its own characteristics, which may affect the predictability of intraday returns. Secondly, Gao et al. (2017) predict the last half-hour returns while Chen (2013) predicts the returns of the rest of the trading day using the first two 5-minute returns. Since specifically the returns before market closure are of interest in this study, it is chosen to use the time intervals of Gao et al. (2017). However future research can study whether the time intervals used by Chen (2013) can be used for return predictions applied to the foreign exchange market.

2.3

Trading hours

Different financial products may be bounded by their own specific trading hours. However, not all financial instruments are bounded to explicit trading hours, meaning they can be traded during the entire day. Most currency pairs traded on the foreign exchange market are traded without being limited to explicit trading hours. The figure below illustrates the trading hours of the foreign exchange market in general (Investing.com, 2018).

As figure 2.1 demonstrates, the trading hours of different geographical locations are overlapping to a certain extent (e.g. Tokyo overlaps with Sydney and London). This seems only relevant if trading hours have a impact on the return predictions.

(13)

Figure 2.1: Trading hours of the foreign exchange market across the world.

Elaut et al. (2018) study whether the existence of trading hours matter for the predictability of the intraday momentum pattern for the foreign exchange market. They conclude that the existence of explicit trading hours has an influence on the predictability of the intraday momentum pattern. This makes the foreign exchange market a challenging one to perform the return predictions due to the fact that most currency pairs have no explicit trading hours. However, a limited amount of currency pairs do exist. Elaut et al. (2018) focuses their study on one of those, namely the RUB-USD currency pair. The currency pair examined in this thesis, as discussed in the introduction is bound to trading hours. This pair is further examined in the next chapter.

(14)
(15)

Chapter

3

Data

This chapter provides a description of the data used in the empirical analysis of the next chapter. Since the raw data sets contained observations that were not suitable for desirable analysis, certain manipulations have been executed to tackle this problem. In order to enhance the transparency and reproducibility of the research of this thesis, the most important manipulations leading from the raw data to the data used for the empirical research are described in Appendix C.

Data per minute is downloaded from the Swiss foreign exchange bank Dukascopy for the EUR/HUF currency pair for the period 2007-2018. The above mentioned currency pair is limited to trading hours, which is needed to support the economic theory that trading hours matter for the presence of an intraday momentum pattern- as defined in the introduction. For this particular currency pair, the market closes at 21:00 GMT and opens at 06:00 GMT.

Due to the availability of minute data, instead of the required half-hour data the following procedure has been executed: A filter is applied which only keeps the first- and last half-hour observations. The second data filter removes observations with trading volume near zero. The last data manipulation removes observations where only the open returns or only the closing returns exist.

Besides the EUR/HUF currency pair, another currency pair is studied- which is further explained in section 5.3. The same procedure is performed for the USD/RUB currency pair, although the trading hours are slightly different (as can be seen in the code of the first manipulation).

(16)
(17)

Chapter

4

Methodology

4.1

Moving block bootstrap

This chapter discusses an alternative approach to the ones used in the aforementioned literature. This approach makes use of the moving block bootstrap procedure, which plays an important role in the construction of the hypotheses of this thesis. Firstly, an introduction is given concerning bootstrapping and secondly the hypotheses are constructed.

As mentioned in the introduction, the discussed literature has its weaknesses which are specific of the characteristics of the data. In order to explain this, a general description of the data is required: The data used in the relevant aforementioned literature as well as the ones used in this thesis are financial time series data. More specifically, they contain financial time series return data, rather than time series of prices of the corresponding financial product.

Financial returns are often assumed to be stationary, which can facilitate empirical research. Before continuing to the methods used for the analysis, the data feeding into it is explained below. However there are certain disadvantages of financial time series return data, as mentioned by Ruiz and Pascual (2002), namely: The presence of volatility clustering, whereby observations with high volatility tend to be followed with other observations, also characterized with high volatility. Another disadvantage mentioned by Ruiz and Pascual (2002) is the property of excess Kurtosis. This refers to the property of the fat tails of the probability distribution, compared to the tails of the normal distribution.

This complicates the analysis of the data, since a relatively high proportion of time series models and forecasts are based on the property normal innovations. A possible solution, which avoids the widely used assumption of normality - is the use of bootstrapping methods. The commonly presence of excess Kurtosis within the above data type does not form a problem for bootstrapping procedures. Moreover, bootstrapping methods do not make assumptions concerning the distribution of the data. Based on the

(18)

above, bootstrapping methods are chosen for the testing of the hypotheses.

Thus continuing discussing further properties of bootstrapping, the general concept is briefly explained: Bootstrapping is a resampling technique, relying on sampling with replacement. One of its applications is to estimate the properties of an estimator (e.g. the variance) by calculating those properties during sampling of an approximating distribution. This technique often gives better approximations than those resulting from the widely adopted Central Limit Theory.

However, a wide variety of bootstrapping methods exist whereby choosing a different method may influence the results of the empirical analysis. In order to facility this choice, the findings of Ruiz and Pascual (2002) are used to determine what bootstrapping method should be used for the empirical analysis. To give the reader context on their research, a brief description is given. Ruiz and Pascual (2002) review certain bootstrapping procedures and their applications with respect to financial time series predictions. However, most bootstrapping methods they discuss are based on assumptions are commonly violated with financial returns. This assumptions is that the observations are independent and identically distributed, abbreviated as "i.i.d". Ruiz and Pascual (2002) acknowledge this issue and recommend non-parametric bootstrapping alternatives, which are applicable to dependant observations.

One of these methods is the moving block bootstrap technique. This technique, which splits the data sample into R non-overlapping blocks of length L. These blocks are sampled with replacement from these blocks and then the parameters are estimated. This method is applicable to dependant data, making it a better option than bootstrapping methods, assuming i.i.d. observations. Nonetheless, one issue is that the bootstrapped observations are not stationary anymore. According to Politis and Romano (1994), this can be resolved by randomly varying the block length.

Lahari and Furukawa (2007) emphasize an argument in favour of choosing block bootstrapping methods over classical inference methods. This argument encloses that block bootstrap methods have the property of providing consistent estimators of a variety of population parameters, without using parametric model assumptions. However, they also state a disadvantage of block bootstrapping. The accuracy of the block bootstrap estimators is strongly dependant on the block size chosen by the user. Lahari and Furukawa (2007) study the optimal block length and conclude that it is often difficult in practise to determine this. One of the reasons examined is that most methods determining this length depend on various population characteristics, which complicates the estimation of these parameters in practise.

Since determining the optimal block length is a study itself, it is left for future research to determine this. However, when estimating the distribution function, Lahari and Furukawa also use a simple mathematical expression to calculate the block length in one of their examples. Estimation the distribution 12

(19)

function of a parameter is also what block bootstrapping is used in the next chapter. Therefore, rather than randomly choosing different block lengths this thesis will use the mathematical expression of Lahari and Furukawa. Sections 4.2 and 4.3 provide an more detailed explanation what the exact use is for bootstrapping in this research. The expression to calculate the block length is as follows:

Ln= [n, n1/3],  ∈ (0, 1/3) (4.1)

Whereby Lnrefers to the block length as function of the amount of observations n.  is a parameter

with a value between zero and a third. It can be concluded that the block length increases as the amount of observations increases. From the above expression, an infinite amount of possible values of Lncan be

chosen. Therefore a finite amount of values for  is chosen, namely: 0, 1/6 and 1/3. Using the above equation, block lengths 1, n1/6and n1/3are constructed. However, block bootstrapping with a block size of one, removes the aspect of blocks of data. Therefore, the replication of correlation within the data will be lost. Nonetheless, it is interesting to see if the results of the empirical analysis are different compared to the two other block sizes.

The next sections explain how the moving block bootstrapping technique is applied to the empirical analysis to test for two hypotheses.

4.2

First Hypothesis

The research question of this thesis is split up into two parts. The first part relates to the measure of volatility. In order to obtain a meaningful answer to the research question, the volatile period should be significantly more volatile than the not so volatile period - as mentioned in the research question. Therefore the first hypothesis is constructed in order to test whether the volatility of the closing returns is indeed different from the during certain periods. Based on figure 4.1 below, illustrating the opening- and closing returns over time for the EUR/HUF currency pair during between 2007 and 2018, the following can be seen: the closing returns are much more stable after approximately the 1200th observation compared to the first ones.

The measurement of volatility of the closing returns is measured in this thesis by the variance. However, simply analyzing the figure below does not give statistical proof that there is indeed a difference in variance between the above mentioned data intervals. Therefore, an explicit test is required to test the following: Is the variance of the closing returns of the first 1200 observations significantly higher than the variance of the last 376 ones? It has to be outlined that the data interval chosen is based on the visual analysis of figure 4.1 below. When the data is not split into two groups of equal size, an advantage is given

(20)

to the bigger group. However, a problem arises when splitting the data into two equal groups, whereby the first group contains the first half of the data and the second group the last one. This problem is that the variance of the two groups are closer to each other than the originally proposed groups, whereas two groups with significantly different variances are required for the main question of this thesis. Therefore, a non-equal data split is used for the EUR/HUF currency pair. However, section 5.3 studies a different currency pair, where an equal data split is made. This is explained further in the concerned section. Figure 4.1: Closing returns over time for the EUR/HUF currency pair, for observations of the period 2007-2018.

Firstly, the data set is split up into two separate data sets, where the first data set contains the first 1200 observations and the second group contains the remaining 376 ones. Consequently, in order to simulate the distribution of the variance, the moving block bootstrap technique is applied to both data sets. Resulting from these steps are two vectors, of dimension 1200 by 1 respectively 376 by 1. These vectors are the results of the simulations of the variance distributions of both data sets. Once these vectors are constructed, it can be tested whether the variances of both data sets were selected from the same distribution.

This can be done by a Wilcoxon signed-rank test, which tests whether the difference between two pairs of observations follows a symmetric around zero. Based on this test, it can be concluded whether the variance of the closing returns of the first 1200 observations is significantly higher than the variance of the last 376 ones. The mathematical expression of the test statistic is as follows:

W =XNr

i=0sgn(x2,i− x1,i∗ Ri), i = 1, ..., N (4.2)

(21)

Whereby N is the number of pairs and xij are observation pairs j from dataset i. sgn refers to the sign

function. Nris the reduced sample size, by which observations with |x2,i− x1,i| are excluded. The data

pairs are ranked by their magnitude. Ri equals that rank, whereby R1is the smallest pair. The general

hypotheses are as follows: H0states that the difference between the pairs follow a symmetric distributin

around zero and H1 states that the difference between the pairs does not a symmetric distributin around

zero.

4.3

Second Hypothesis

As argued in the previous section, the research question is split into two parts. This section constructs the second hypothesis, which contributes to the answering of main question of this thesis. The two data sets, as defined in the previous section, can be used for predictive purposes. The variable to be predicted is the last half-hour returns of the EUR/HUF currency pair. Since in-sample predictions are typically not that useful in practise, the focus of the predictions is centered at out-of-sample forecasting. Out-of-sample predictions use the sample data to make predictions out of that data sample (i.e. the first n1observations

are used to predict the last n2ones).

The model used to predict the last half-hour return is the linear regression of formula 2.2, stated in section 2.1. To improve the accuracy of the model, the forecasts are estimated recursively. This means that an increasing window is used to re-estimate the model. Hereby the first 1200 observations are used to forecast the 1201th observation and the first 1201 observations are used to forecast the 1202th observations etc. This model assumes that the error term is a white noise process and therefore must be stationary. An Augmented Dickey–Fuller (ADF) test is used to check whether the data is stationary.

Once predictions are made, an objective measurement of forecast accuracy has to be specified. A most desirable measurement is the Mean Abosolute Scaled Error (MASE). Its mathematical expression is as follows: M ASE = 1 T XT t=1( |et| 1 T −1 PT t=2|Yt− Yt−1| ) (4.3)

Whereby etis the forecast error in period t, defined as Yt− ˆYtwith Ytthe actual value and ˆYtthe

forecasted value. The advantage of this statistic compared to the widely adopted Root Mean Squared Error is the independent characteristic of the scale of the data of the mase (e.g. this can be used to compare forecast across data sets with different scales). Using this statistic and the expected higher volatility of the first dataset compared to the second one, the second hypothesis is constructed as: Is the MASE of the

(22)

out-of-sample last half-hour return predictions of the first 1200 observations significantly lower than the MASE for the last 376 ones?

As stated earlier, the first data set contains the first 1200 observations. Of these 1200 observations, the first 800 ones are used for the out-of-sample predictions of the last 400 observations. The second data set contains the last 376 observations. Of these 376 observations, the first 250 ones are used for the out-of-sample predictions of the last 126 observations.

The same methodology used for the first hypothesis can be used to test the second hypothesis. Similarly the moving block bootstrap technique is applied to both data sets. Rather than simulating the distribution of the variance, the distribution of the MASE is simulated. The results are two vectors of the estimates of the MASE distributions of both data sets. A wilcoxon signed-rank test test can then test for the second hypothesis.

(23)

Chapter

5

Results

This chapter will present the results of the empirical analysis of the two hypotheses, as constructed in the previous chapter.

5.1

Is the level of volatility different?

This section discusses to what extend statistical proof is found for the first hypothesis that questions whether the variance of the closing returns of the first 1200 observations is significantly higher than the variance of the last 376 ones.

As explained in the previous chapters, moving block bootstrap simulations are performed. The distributions of the variances of the both data sets are simulated with the help of the moving block bootstrap. Subsequently, a Wilcoxon signed-rank test is performed, which uses both obtained simulated distributions of the variances. From the p-values of the test result for each block size, it can be concluded whether there is a significant difference in the variance of both data sets. As a reminder, the first data set contains the first 1200 observations, while the second data set contains the last 376 observations.

As mentioned in section 4.1, the accuracy of the moving block bootstrap procedure is dependent on the chosen block size. Therefore, the procedure of the above paragraph is performed for each block length that is defined in section 4.1. The QQ-plots and histograms of the simulated distributions of both data sets are shown in Appendix A.

As mentioned before, time series financial return data is often characterized with excess Kurtosis. From the QQ-plots and histograms of the simulated distribution of the variance of the last half-hour returns of both data sets, the following can be concluded: The distributions of the estimator of the variance of the last half-hour return are strongly not normally distributed. Therefore, the standard asymptotic results based on the assumptions of the asymptotic normally distributed estimator do not apply. As stated before,

(24)

bootstrapping does not assume normality and is therefore more suitable in this situation.

The result of the Wilcoxon signed-rank tests are shown in Appendix B. The null hypothesis of this test is that the variance of the two pairs of observations is the same. Subsequently, the alternative hypothesis states that the variance of the first 1200 observations is bigger than the variance of the last 376 observations. The resulting p-values of the three different fixed block lengths of L = 1, n1/6and n1/3are all approximately zero. Thereafter the first hypothesis can be answered, based on the moving block bootstrap procedure with the above fixed block lengths. From these p-values it can be concluded that on 99 percent significance level the variance of the closing returns of the first 1200 observations is significantly higher than the variance for the last 376 ones.

5.2

Is the forecast accuracy different?

This section discusses to what extend statistical proof is found for the second hypothesis, which questions whether the MASE of the closing returns of the first 1200 observations is significantly lower than the variance of the last 376 ones. As discussed earlier, the model used for these predictions assumes that the error term is a white noise process and therefore must be stationary. Therefore the aforementioned ADF test is performed to test for the stationarity of the data. The null hypothesis states that there is a unit root and the alternative hypothesis claims that the data is stationary. The test results are shown in Appendix B. It can be concluded from the p-value of approximately 0.01 that there is statistical proof found that the data is stationary using a significance level of 99 percent.

For the moving block bootstrap procedure, the distributions of the MASE’s of the both data sets are simulated with the help of the moving block bootstrap. Subsequently, a Wilcoxon signed-rank test is performed, which uses both obtained simulated distributions of the MASE’s. From the p-value of the test result for each block size, it can be concluded whether there is a significant difference in the MASE of both data sets. The MASE is a formulaic representation which uses the forecast error for which the mathematical expression is mentioned in section 4.3. A lower MASE means that the forecasted closing returns are closer to the real closing returns. From the above steps it can be concluded that the methodology used to test both hypotheses is very similar. The main difference is that the distribution of the variance is simulated for the first hypothesis versus the MASE that is simulated for the second one.

Appendix B shows the QQ-plots and histograms of the simulated distributions of the MASE’s of the last half-hour returns of both data sets for the three different block sizes. It can be seen that none of the simulated distributions is normally distributed. Again, it can be concluded that the standard asymptotic results do not apply, based on the assumptions of the asymptotic normally distributed estimator.

(25)

Subsequently, the Wilcoxon signed-rank tests is performed of which its results are shown in Appendix B. The null hypothesis of this test is that the MASE of the two pairs of observations is the same. Subsequently, the alternative hypothesis states that the MASE of the first 1200 observations is smaller than the variance of the last 376 observations. Contrary to the results of the first hypothesis, the p-values of the test results of each block length are not all the same. For the fixed block lengths of L = n1/6and n1/3the p-values are approximately zero. However, the block lengths of L = 1 is approximately 0.27.

Using these results, the second hypothesis does not hold in all cases, since the results are different depending on the chosen block length. For block lengths L = n1/6, it be concluded that on 99 percent significant level, the MASE of the closing returns of the first 1200 observations is significantly lower than MASE variance for the last 376 ones. However, for the block length of L = 1, no statistical proof is found that the MASE of the closing returns of the first 1200 observations is significantly lower than MASE variance for the last 376 ones.

5.3

Hypotheses applied to USD/RUB

As mentioned above, the hypotheses concerning the EUR/HUF currency pair are studied with its data set split into two groups whereby the size of the two groups are not equal. Splitting the data into two equal groups causes problems for that data set, as explained before. However those problems do not occur for the currency pair used by Elaut and Frömmel (2018), namely the USD/RUB currency pair. The reason why the aforementioned problems do not arise for this data set can be explained. Figure 5.1 below on the closing returns over-time demonstrates that the first half of the observations has a lower variability than the last half. Using this information it can be tested whether the results of the two hypotheses are different when applying them to the currency pair USD/RUB. The next sections discuss the results.

(26)

Before constructing the hypotheses more information about the data is required. The data structure is similar to EUR/HUF and the same manipulations as described in chapter three and Appendix C are performed. However the data is split equally, resulting in one group containing the first 801 observations while the second group contains the last 801 ones. It can be seen in figure 5.1 that the variance of the first half of the observations is strongly lower than the variance of the last half. However, a statistical test is required to confirm a significant difference.

Applying the above to the first hypothesis for the EUR/HUF currency pair, the following hypothesis can be constructed: Is the variance of the closing returns of the first 801 observations significantly lower than the variance of the last 801 ones for the USD/RUB currency pair? Once this is tested statistically, it can then be examined if the data set with the lower variance has a lower forecast accuracy. This is executed by applying the second hypothesis of the EUR/HUF currency pair to the USD/RUB currency pair: is the MASE of the closing returns of the first 801 observations is significantly higher than MASE variance for the last 801 ones?

5.3.1 First hypothesis applied to USD/RUB

For both hypotheses of the USD/RUB currency pair, the same steps are performed as for the EUR/HUF currrency pair except for one thing: The data for the USD/RUB is splitted equally. Since the methodology of the hypotheses testing is explained already, the results can be discussed. The null hypothesis of the Wilcoxon signed rank test states that the variance of the two pairs of observations is same. Subsequently, the alternative hypothesis states that the variance of the first 801 observations is smaller than the variance of the last 801 observations.

The resulting p-values for the three block lengths are approximately zero. Therefore, using the three chosen block lengths, it can be concluded that statistical proof is found that the variance of the closing returns of the first 801 observations is significantly lower than the variance of the last 801 ones for the USD/RUB currency pair.

5.3.2 Second hypothesis applied to USD/RUB

Similar to the methodology used for the EUR/HUF currency pair an Augmented Dickey–Fuller is performed for the USD/RUB currency pair, to test if the data is stationary. The resulting p-value is 0.01, as can be seen in Appendix B. Therefore, there is statistical proof found that the data is stationary on a 99 percent significance level. Subsequently, the same steps as the ones executed for the second hypothesis of the EUR/HUF currency pair can be executed. The Wilcoxon signed rank test is executed, whereby the 20

(27)

null hypothesis states: the MASE of the two pairs of observations is same. Subsequently, the alternative hypothesis states that the MASE of the first 801 observations is higher than the MASE of the last 801 observations.

Surprisingly, all three p-values resulting from the aforementioned test are the approximately zero. That means that for the chosen fixed block lengths, statistical proof is found that the MASE of the closing returns of the first 801 observations is significantly higher than MASE variance for the last 801 ones. Thus, what conclusions can be drawn from chapter five in its entirety?

(28)
(29)

Chapter

6

Conclusion

The concluding chapter of this thesis discusses to what extent the last half-hour returns can be predicted out-of-sample more accurately for volatile periods than for significantly less volatile ones for the currency pair EUR/HUF by using the first half-hour returns. The main statement above is divided into two hypotheses, which together complement each other in answering the most important question of this thesis. The first hypothesis is meant to test whether there is a significant difference in the level of volatility between the two. Subsequently, the purpose of the second hypothesis is to test whether the forecast accuracy of the volatile data set is higher than the one for the low volatile data set.

The findings of the penultimate chapter are used to comment on the test results of the hypotheses. These show statistical proof that the variance of the first data set is significantly higher than the one for the second data set. The test results are obtained by using fixed block sizes of Ln= 1, n1/6and n1/3. Since

the results of the moving block bootstrap technique is heavily dependant on the chosen size, it cannot be concluded that the hypothesis holds for other block sizes than the ones tested.

The second hypothesis does not hold for each of the three above block sizes. However two out of three of the used block sizes show statistical proof that the forecast accuracy of the volatile data set is significantly higher than the one for the data set characterized with a significantly lower volatility. Contrary to these results whereby block sizes of Ln = n1/6 and n1/3 were tested, there is statistical

proof for a significant difference between forecast accuracy of both data sets the test results of block size Ln = 1. Concluding from these results, both hypotheses hold for two out of three chosen block

lengths. However, they do not hold for the least favorable block length Ln= 1, whereby the replication

of correlation within the data is lost.

When applying both hypotheses to a different financial instrument on the foreign exchange market, namely the USD/RUB currency pair, both hypotheses hold for each block length. The high volatility period of this currency pair is of equal length as the low one, whereas the EUR/HUF currency pair is

(30)

characterized with a high volatility period length of roughly three times the low one.

Based on the different outcomes, future research is necessary to complement this thesis in a number of ways. Variations in the model used to forecast returns can be explored. Other methods than the MASE can be used as a measurement of forecast accuracy. Lastly, a more advanced technique to determine the optimal block length can impact the validity of the moving block bootstrap results. Lastly, using a more advanced technique to determine the optimal block length can impact the validity of the moving block bootstrap results. However, two out of three times both hypotheses hold. This means that in these cases the forecast accuracy of the volatile group is significantly higher than the one for the significantly less volatile group.

(31)

Appendix

A

Figures

(a) block length 1 first 1200 observations (b) block length 1 last 376 observations

(c) block length n1/6first 1200 observations (d) block length n1/6last 376 observations

(e) block length n1/3first 1200 observations (f) block length n1/3last 376 observations

(32)

(a) block length 1 first 1200 observations (b) block length 1 last 376 observations

(c) block length n1/6first 1200 observations (d) block length n1/6last 376 observations

(e) block length n1/3first 1200 observations (f) block length n1/3last 376 observations

Figure A.2: Simulated distribution of MASE: plot and QQ plot for EUR/HUF currency pair.

(33)

(a) block length 1 first 801 observations (b) block length 1 last 801 observations

(c) block length n1/6first 801 observations (d) block length n1/6last 801 observations

(e) block length n1/3first 801 observations (f) block length n1/3last 801 observations

(34)

(a) block length 1 first 801 observations (b) block length 1 last 801 observations

(c) block length n1/6first 801 observations (d) block length n1/6last 801 observations

(e) block length n1/3first 801 observations (f) block length n1/3last 801 observations

Figure A.4: Simulated distribution of MASE: plot and QQ plot for USD/RUB currency pair.

(35)

Appendix

B

Tables

Table B.1: Results Wilcoxon signed rank tests EUR/HUF variance: p-values for different block lengths Block length 1 p-value 0.00

Block length n1/6 p-value 0.00 Block length n1/3 p-value 0.00

Table B.2: Results ADF test EUR/HUF

p-value 0.01

Dickey-Fuller statistic -10.573

Table B.3: Results Wilcoxon signed rank tests EUR/HUF MASE: p-values for different block lengths Block length 1 p-value 0.27

Block length n1/6 p-value 0.00 Block length n1/3 p-value 0.00

Table B.4: Results Wilcoxon signed rank tests USD/RUB variance: p-values for different block lengths Block length 1 p-value 0.00

Block length n1/6 p-value 0.00 Block length n1/3 p-value 0.00

Table B.5: Results ADF test USD/RUB

p-value 0.01

(36)

Table B.6: Results Wilcoxon signed rank tests USD/RUB MASE: p-values for different block lengths Block length 1 p-value 0.00

Block length n1/6 p-value 0.00 Block length n1/3 p-value 0.00

(37)

Appendix

C

Stata code

# Shows m a n i p u l a t i o n s p e r f o r m e d on raw d a t a t o o b t a i n c l e a n d a t a . # M a n i p u l a t i o n 1 # k e e p t h e o b s e r v a t i o n s when t h e m a r k e t o p e n s and c l o s e s . # C u r r e n c y p a i r EUR/ HUF s p e c i f i c k e e p i f s t r p o s ( g m t t i m e , " 0 6 : 2 9 : 0 0 " ) ! =0 | s t r p o s ( g m t t i m e , " 2 0 : 3 0 : 0 0 " ) ! =0

# C u r r e n c y p a i r USD/ RUB s p e c i f i c , n o t e t h e d i f f e r e n t o p e n i n g− and c l o s i n g t i m e k e e p i f s t r p o s ( g m t t i m e , " 0 7 : 2 9 : 0 0 " ) ! =0 | s t r p o s ( g m t t i m e , " 2 0 : 2 0 : 0 0 " ) ! =0 # M a n i p u l a t i o n 2 # Remove l o w t r a d i n g v o l u m e d a y s drop i f volume < 0 . 1 # M a n i p u l a t i o n 3 # Remove o b s e r v a t i o n s w h e r e b y o n l y o p e n i n g o r c l o s i n g p r i c e s a r e a v a i l a b l e ( e i t h e r t h e c l o s i n g r e t u r n s o f o p e n i n g r e t u r n s c a n n o t be c a l c u l a t e d # T h i s m a n i p u l a t i o n i s p e r f o r m e d i n E x c e l u s i n g d a t a f i l t e r s , # w h e r e b y o n l y o b s e r v a t i o n s w i t h b o t h c l o s i n g and o p e n i n g p r i c e s on t h e same day a r e a v a i l a b l e a r e k e p t .

(38)
(39)

Appendix

D

R code

Code for hypothesis 1, bootstrap first dataset

# make s u r e t o i n s t a l l a l l p a c k a g e s f i r s t and t o p e r f o r m a l l c o d e o f # " b o o t s t r a p t s e r i e s 1 " f i r s t and t h a n " b o o t s t r a p t s e r i e s 2 " # i n s t a l l and c h e c k t h e b o x o f t h e " b o o t s t r a p " p a c k a g e # i n s t a l l and c h e c k t h e b o x o f t h e " b o o t " p a c k a g e # i n s t a l l and c h e c k t h e b o x o f t h e "NB" p a c k a g e # i n s t a l l and c h e c k t h e b o x o f t h e " f o r e c a s t " p a c k a g e # v a r i a n c e f u n c t i o n myfunc1 <− f u n c t i o n ( d a t a s e t 1 ) { x <− var ( d a t a s e t 1 [ , 2 ] ) r e t u r n ( x ) } # b l o c k l e n g t h : n ^ ( 1/ 3 ) # l 1 <− 1 # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 6 ) ) # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 3 ) ) l 1 <− round (NROW( d a t a s e t 1 ) ^ ( 1 / 6 ) ) # b o o t s t r a p p i n g f u n c t i o n b o o t s 1 <− t s b o o t ( t s e r i e s = d a t a s e t 1 , s t a t i s t i c = myfunc1 , R = NROW( d a t a s e t 1 ) , l = l 1 , sim = " f i x e d " )

(40)

# d e s i r e d v e c t o r o f t h e e s t i m a t i o n s o f t h e v a r i a n c e a r e r e t r i e v e d w i t h b o o t s 1 [ 2 ] # u n l i s t v e c t o r t o a v e c t o r v e c t o r 1 <− u n l i s t ( b o o t s 1 [ 2 ] ) # p e r f o r m w i l c o x o n t e s t w i l c o x . t e s t ( v e c t o r 1 , v e c t o r 2 ) w i l c o x . t e s t ( v e c t o r 1 , v e c t o r 2 , a l t e r n a t i v e = c ( " g r e a t e r " ) ) Code for hypothesis 1, bootstrap second dataset

# e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # w o r k i n g d i r e c t o r y s e t w d ( " ~ / E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l " ) # o p e n d a t a s e t 1 f r o m e x c e l # d a t a s e t 1 1199 o b s . o f 2 v a r i a b l e s l i b r a r y ( r e a d x l ) d a t a s e t 1 <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l / d a t a s e t 1 . x l s x " ) # f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f sample f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n myfunc5 <− f u n c t i o n ( d a t a s e t 1 ) { h1 <− 1199 − 801 +1 f c a s t 1 <− v e c t o r ( mode = " l i s t " , l e n g t h = h1 ) f o r ( i i n 1 : h1 ) { # s t a r t r e c u r s i v e r e g r e s s i o n r e c u r s 1 <− lm ( c l o s i n g r e t u r n ~ o p e n r e t u r n , d a t a = d a t a s e t 1 [ 1 : ( 8 0 0 − 1 + i ) , ] ) f c a s t 1 [ [ i ] ] <− p r e d i c t ( r e c u r s 1 , n e w d a t a = d a t a s e t 1 [ ( 8 0 0 + i ) , ] ) 34

(41)

} y1 <− d a t a s e t 1 [ 8 0 1 : 1 1 9 9 , 2 ] y1 <− a s . m a t r i x ( y1 ) f c a s t 1 <− u n l i s t ( f c a s t 1 ) mase1 <− mase ( y1 , f c a s t 1 ) r e t u r n ( mase1 ) } # b l o c k s i z e s # l 1 <− 1 # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 6 ) ) # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 3 ) ) l 1 <− 1 # b o o t s t r a p p i n g f u n c t i o n b o o t s 5 <− t s b o o t ( t s e r i e s = d a t a s e t 1 , s t a t i s t i c = myfunc5 , R = NROW( d a t a s e t 1 ) , l = l 1 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 5 <− u n l i s t ( b o o t s 5 [ 2 ] ) )

Code for hypothesis 2, bootstrap first dataset

# e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # w o r k i n g d i r e c t o r y s e t w d ( " ~ / E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l " ) # o p e n d a t a s e t 1 f r o m e x c e l # d a t a s e t 1 1199 o b s . o f 2 v a r i a b l e s l i b r a r y ( r e a d x l ) d a t a s e t 1 <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l / d a t a s e t 1 . x l s x " )

(42)

# f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f sample f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n myfunc5 <− f u n c t i o n ( d a t a s e t 1 ) { h1 <− 1199 − 801 +1 f c a s t 1 <− v e c t o r ( mode = " l i s t " , l e n g t h = h1 ) f o r ( i i n 1 : h1 ) { # s t a r t r e c u r s i v e r e g r e s s i o n r e c u r s 1 <− lm ( c l o s i n g r e t u r n ~ o p e n r e t u r n , d a t a = d a t a s e t 1 [ 1 : ( 8 0 0 − 1 + i ) , ] ) f c a s t 1 [ [ i ] ] <− p r e d i c t ( r e c u r s 1 , n e w d a t a = d a t a s e t 1 [ ( 8 0 0 + i ) , ] ) } y1 <− d a t a s e t 1 [ 8 0 1 : 1 1 9 9 , 2 ] y1 <− a s . m a t r i x ( y1 ) f c a s t 1 <− u n l i s t ( f c a s t 1 ) mase1 <− mase ( y1 , f c a s t 1 ) r e t u r n ( mase1 ) } # b l o c k l e n g t h s # l 1 <− 1 # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 6 ) ) # l 1 <− r o u n d (NROW( d a t a s e t 1 ) ^ ( 1 / 3 ) ) l 1 <− 1 # b o o t s t r a p p i n g f u n c t i o n b o o t s 5 <− t s b o o t ( t s e r i e s = d a t a s e t 1 , s t a t i s t i c = myfunc5 , R = NROW( d a t a s e t 1 ) , l = l 1 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 5 <− u n l i s t ( b o o t s 5 [ 2 ] ) 36

(43)

Code for hypothesis 2, bootstrap second dataset # e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # w o r k i n g d i r e c t o r y s e t w d ( " ~ / E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l " ) # o p e n d a t a s e t 2 f r o m e x c e l # d a t a s e t 2 1199 o b s . o f 2 v a r i a b l e s l i b r a r y ( r e a d x l ) d a t a s e t 2 <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l / d a t a s e t 2 . x l s x " ) # f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f sample f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n myfunc6 <− f u n c t i o n ( d a t a s e t 2 ) { h2 <− 377 − 251 + 1 f c a s t 2 <− v e c t o r ( mode = " l i s t " , l e n g t h = h2 ) f o r ( i i n 1 : h2 ) { # s t a r t r e c u r s i v e r e g r e s s i o n r e c u r s 2 <− lm ( c l o s i n g r e t u r n ~ o p e n r e t u r n , d a t a = d a t a s e t 2 [ 1 : ( 2 5 0 − 1 + i ) , ] ) f c a s t 2 [ [ i ] ] <− p r e d i c t ( r e c u r s 2 , n e w d a t a = d a t a s e t 2 [ ( 2 5 0 + i ) , ] ) } y2 <− d a t a s e t 2 [ 2 5 1 : 3 7 7 , 2 ] y2 <− a s . m a t r i x ( y2 ) f c a s t 2 <− u n l i s t ( f c a s t 2 ) mase2 <− mase ( y2 , f c a s t 2 ) r e t u r n ( mase2 ) } # b l o c k s i z e s # l 2 <− 1

(44)

# l 2 <− r o u n d (NROW( d a t a s e t 2 ) ^ ( 1 / 6 ) ) # l 2 <− r o u n d (NROW( d a t a s e t 2 ) ^ ( 1 / 3 ) ) l 2 <− 1 # b o o t s t r a p p i n g f u n c t i o n b o o t s 6 <− t s b o o t ( t s e r i e s = d a t a s e t 2 , s t a t i s t i c = myfunc6 , R = NROW( d a t a s e t 2 ) , l = l 2 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 6 <− u n l i s t ( b o o t s 6 [ 2 ] ) # w i l c o x o n t e s t w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 , a l t e r n a t i v e = c ( " g r e a t e r " ) ) w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 )

USDRUB variance first 801 observations # p a c k a g e : # b o o t , b o o t s t r a p , f o r e c a s t , t s e n s e m b l e r # c l e a r c o n s o l e : c t r l + l on k e y b o a r d # c l e a r w o r k s p a c e : rm ( l i s t = l s ( ) ) # o p e n d a t a l i b r a r y ( r e a d x l ) USDRUB <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / USDRUB / C l e a n e d e x c e l d a t a / USDRUB 2007 2018 / USDRUB . x l s x " , s h e e t = " f i r s t 8 0 1 " ) # e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f sample f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n 38

(45)

myfunc1 <− f u n c t i o n (USDRUB) { x <− var (USDRUB [ , 2 ] ) r e t u r n ( x ) } # b o o t s t r a p p i n g f u n c t i o n # b l o c k l e n g t h : n ^ ( 1/ 3 ) # l 1 <− 1 # l 1 <− r o u n d (NROW( USDRUB ) ^ ( 1 / 6 ) ) # l 1 <− r o u n d (NROW( USDRUB ) ^ ( 1 / 3 ) ) l 1 <− round (NROW(USDRUB) ^ ( 1 / 6 ) )

b o o t s 5 <− t s b o o t ( t s e r i e s = USDRUB, s t a t i s t i c = myfunc1 , R = NROW(USDRUB) , l = l 1 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 5 <− u n l i s t ( b o o t s 5 [ 2 ] ) # p l o t p l o t ( b o o t s 5 )

USDRUB variance last 801 observations # p a c k a g e :

# b o o t , b o o t s t r a p , f o r e c a s t , t s e n s e m b l e r

# c l e a r c o n s o l e : c t r l + l on k e y b o a r d # c l e a r w o r k s p a c e : rm ( l i s t = l s ( ) )

(46)

l i b r a r y ( r e a d x l ) USDRUB2 <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / USDRUB / C l e a n e d e x c e l d a t a / USDRUB 2007 2018 / USDRUB . x l s x " , s h e e t = " l a s t 8 0 1 " ) # e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # v a r i a n c e f u n c t i o n myfunc2 <− f u n c t i o n (USDRUB2) { x <− var (USDRUB2 [ , 2 ] ) r e t u r n ( x ) } # b o o t s t r a p p i n g f u n c t i o n # b l o c k l e n g t h : n ^ ( 1/ 3 ) # l 2 <− 1 # l 2 <− r o u n d (NROW( USDRUB2 ) ^ ( 1 / 6 ) ) # l 2 <− r o u n d (NROW( USDRUB2 ) ^ ( 1 / 3 ) ) l 2 <− round (NROW(USDRUB2 ) ^ ( 1 / 6 ) )

b o o t s 6 <− t s b o o t ( t s e r i e s = USDRUB2 , s t a t i s t i c = myfunc2 , R = NROW(USDRUB2 ) , l = l 2 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 6 <− u n l i s t ( b o o t s 6 [ 2 ] ) # p l o t p l o t ( b o o t s 6 ) # w i l c o x t e s t 40

(47)

w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 , a l t e r n a t i v e = c ( " g r e a t e r " ) ) w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 )

USDRUB forecast out of sample MASE first 801 observations # p a c k a g e : # b o o t , b o o t s t r a p , f o r e c a s t , t s e n s e m b l e r # c l e a r c o n s o l e : c t r l + l on k e y b o a r d # c l e a r w o r k s p a c e : rm ( l i s t = l s ( ) ) # o p e n d a t a l i b r a r y ( r e a d x l ) USDRUB <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / USDRUB / C l e a n e d e x c e l d a t a / USDRUB 2007 2018 / USDRUB . x l s x " , s h e e t = " f i r s t 8 0 1 " ) # e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f sample f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n myfunc5 <− f u n c t i o n (USDRUB) { # l a s t o b s e r v a t i o n o f f i r s t h a l f d a t a s e t b e g i n 2 <− 401 # f i r s t o b s e r v a t i o n o f s e c o n d h a l f d a t a s e t e n d 1 <− 402 # l a s t o b s e r v a t i o n o f s e c o n d h a l f d a t a s e t e n d 2 <− 801 n <− e n d 2 − e n d 1 +1 f c a s t 1 <− v e c t o r ( mode = " l i s t " , l e n g t h = n ) f o r ( i i n 1 : n ) { # s t a r t r e c u r s i v e r e g r e s s i o n r e c u r s 1 <− lm ( c l o s i n g r e t u r n ~ o p e n r e t u r n , d a t a =USDRUB [ 1 : ( b e g i n 2 −1+ i ) , ] ) f c a s t 1 [ [ i ] ] <− p r e d i c t ( r e c u r s 1 , n e w d a t a = USDRUB [ ( b e g i n 2 + i ) , ] )

(48)

} y1 <− USDRUB[ e n d 1 : end2 , 2 ] y1 <− a s . m a t r i x ( y1 ) f c a s t 1 <− u n l i s t ( f c a s t 1 ) mase1 <− mase ( y1 , f c a s t 1 ) r e t u r n ( mase1 ) } # b o o t s t r a p p i n g f u n c t i o n # b l o c k l e n g t h : # l 1 <− 1 # l 1 <− r o u n d (NROW( USDRUB ) ^ ( 1 / 6 ) ) # l 1 <− r o u n d (NROW( USDRUB ) ^ ( 1 / 3 ) ) l 1 <− round (NROW(USDRUB) ^ ( 1 / 3 ) )

b o o t s 5 <− t s b o o t ( t s e r i e s = USDRUB, s t a t i s t i c = myfunc5 , R = NROW(USDRUB) , l = l 1 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 5 <− u n l i s t ( b o o t s 5 [ 2 ] ) # p l o t f o r e c a s t and r e a l v a l u e s p l o t ( x , y1 , t y p e = " l " , c o l = " r e d " ) l i n e s ( x , y2 , c o l = " g r e e n " ) # make t i m e s e r i e s m y t s <− t s (USDRUB) m y t s 2 <− t s ( f c a s t 1 ) p l o t ( m y t s [ e n d 1 : end2 , 2 ] , t y p e = " l " , c o l = " r e d " ) 42

(49)

l i n e s ( myts2 , c o l = " g r e e n " )

USDRUB forecast out of sample MASE last 801 observations # p a c k a g e : # b o o t , b o o t s t r a p , f o r e c a s t , t s e n s e m b l e r # c l e a r c o n s o l e : c t r l + l on k e y b o a r d # c l e a r w o r k s p a c e : rm ( l i s t = l s ( ) ) # o p e n d a t a l i b r a r y ( r e a d x l ) USDRUB2 <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / USDRUB / C l e a n e d e x c e l d a t a / USDRUB 2007 2018 / USDRUB . x l s x " , s h e e t = " l a s t 8 0 1 " ) # e n a b l e and c h e c k b o x o f p a c k a g e " t s e n s e m b l e r " # f u n c t i o n t o u s e i n b o o t s t r a p t o c a l c u l a t e f o r e c a s t e r r o r ( f r o m o u t o f s a m p l e f o r e c a s t i n g ) # r u n f u n c t i o n o n c e b e f o r e r u n n i n g b o o t s t r a p f u n c t i o n , s o R knows t h e f u n c t i o n myfunc6 <− f u n c t i o n (USDRUB2) { # l a s t o b s e r v a t i o n o f f i r s t h a l f d a t a s e t b e g i n 2 <− 401 # f i r s t o b s e r v a t i o n o f s e c o n d h a l f d a t a s e t e n d 1 <− 402 # l a s t o b s e r v a t i o n o f s e c o n d h a l f d a t a s e t e n d 2 <− 801 n <− e n d 2 − e n d 1 +1 f c a s t 1 <− v e c t o r ( mode = " l i s t " , l e n g t h = n ) f o r ( i i n 1 : n ) { # s t a r t r e c u r s i v e r e g r e s s i o n r e c u r s 1 <− lm ( c l o s i n g r e t u r n ~ o p e n r e t u r n , d a t a =USDRUB2 [ 1 : ( b e g i n 2 −1+ i ) , ] ) f c a s t 1 [ [ i ] ] <− p r e d i c t ( r e c u r s 1 , n e w d a t a = USDRUB2 [ ( b e g i n 2 + i ) , ] ) } y1 <− USDRUB2[ e n d 1 : end2 , 2 ]

(50)

y1 <− a s . m a t r i x ( y1 ) f c a s t 1 <− u n l i s t ( f c a s t 1 ) mase1 <− mase ( y1 , f c a s t 1 ) r e t u r n ( mase1 ) } # b o o t s t r a p p i n g f u n c t i o n # b l o c k l e n g t h : n ^ ( 1/ 3 ) # l 2 <− 1 # l 2 <− r o u n d (NROW( USDRUB2 ) ^ ( 1 / 6 ) ) # l 2 <− r o u n d (NROW( USDRUB2 ) ^ ( 1 / 3 ) ) l 2 <− round (NROW(USDRUB2 ) ^ ( 1 / 3 ) )

b o o t s 6 <− t s b o o t ( t s e r i e s = USDRUB2 , s t a t i s t i c = myfunc6 , R = NROW(USDRUB2 ) , l = l 2 , sim = " f i x e d " ) # u n l i s t v e c t o r t o a v e c t o r v e c t o r 6 <− u n l i s t ( b o o t s 6 [ 2 ] ) # w i l c o x t e s t w i l c o x 1 s i d e d <− w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 , a l t e r n a t i v e = c ( " g r e a t e r " ) ) w i l c o x 2 s i d e d <− w i l c o x . t e s t ( v e c t o r 5 , v e c t o r 6 ) # p l o t f o r e c a s t and r e a l v a l u e s p l o t ( x , y1 , t y p e = " l " , c o l = " r e d " ) l i n e s ( x , y2 , c o l = " g r e e n " ) # make t i m e s e r i e s m y t s <− t s (USDRUB2) 44

(51)

m y t s 2 <− t s ( f c a s t 1 )

p l o t ( m y t s [ e n d 1 : end2 , 1 ] , t y p e = " l " , c o l = " r e d " ) l i n e s ( myts2 , c o l = " g r e e n " )

ADF test for both currency pairs # p a c k a g e f o r ADF t e s t l i b r a r y ( t s e r i e s ) # p a c k a g e t o o p e n e x c e l d a t a l i b r a r y ( r e a d x l ) # o p e n d a t a # f o r USD/ RUB USDRUBALL <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / USDRUB / C l e a n e d e x c e l d a t a / USDRUB 2007 2018 / USDRUB . x l s x " , s h e e t = " S h e e t 3 " ) m y t s e r i e <− t s (USDRUBALL) a d f . t e s t ( m y t s e r i e [ , 2 ] ) # f o r EUR/ HUF e u r h u f _ 2007 _ 2018 _ 30 _ m i n u t e s _ r e a d y <− r e a d _ e x c e l ( " E c o n o m e t r i e / S c r i p t i e / D a t a / EURHUF / F i n a l / e u r h u f 2007 2018 30 m i n u t e s r e a d y . x l s x " , s h e e t = " a l l ( 2 ) " ) m y t s e r i e 2 <− t s ( e u r h u f _ 2007 _ 2018 _ 30 _ m i n u t e s _ r e a d y ) a d f . t e s t ( m y t s e r i e 2 [ , 2 ] )

(52)
(53)

Bibliography

[1] Bank for International Settlements. (2013), Triennial Central Bank Survey, p. 12.

[2] Campbell, J. Y. and Thompson, S. B. (2008). Predicting excess stock returns out of sample: Can anything beat the historical average?. The Review of Financial Studies, 21(4), 1509-1531. doi:10.1093/rfs/hhm055

[3] Chen, C. (2013). The predictability of opening returns for the returns of the trading day: Evidence from Taiwan futures market. Elsevier, 25(C), 272-281 doi:10.1016/j.iref.2012.07.012

[4] Elaut, G. , Frömmel, M. and Lampaert, K. (2018). Intraday momentum in FX markets: Disen-tangling informed trading from liquidity provision. Journal of Financial Markets, 37(C), 35-51. doi:10.1016/j.finmar.2016.09.002

[5] Gao, L. , Han, Y., Li, S. Z. and Zhou, G. (2017). Market intraday momentum. The Review of Financial Studies., 1-46. doi:http://dx.doi.org/10.2139/ssrn.2440866

[6] Investing.com. (2018). Forex and World Market Hours, Retrieved from:

https://www.investing.com/tools/market-hours

[7] Lahari, S. N. and Furukawa (2007). A nonparametric plug-in rule for selecting optimal block lengths for block bootstrap methods. Elsevier, 4(3), 292-321. doi:10.1016/j.stamet.2006.08.002

[8] Palkandaras, V., Gupta, R., Wohar, M. E. (2017). The depreciation of the pound post-Brexit: Could it have been predicted? Finance Research Letters, 21, 206-213. doi:10.1016/j.frl.2016.12.003

[9] Politis, D.N. and Romano, J.P. (1994). The stationary bootstrap. Journal of the American Statistical Association Journal of the American Statistical Association, 18, 1303-1313.

[10] Ruiz, E., Pascual, L. (2002). Bootstrapping Financial Time Series Journal of Economic Surveys, 16(3), 271-300. doi:10.1111/1467-6419.00170

(54)

[11] Welch, I. and Goyal, A. (2008). A comprehensive look at the empirical performance of equity premium prediction. The Review of Financial Studies, 21, 1455-1508. doi:10.1093/rfs/hhm014

Referenties

GERELATEERDE DOCUMENTEN

Using the sources mentioned above, information was gathered regarding number of inhabitants and the age distribution of the population in the communities in

The prior international experience from a CEO could be useful in the decision making of an overseas M&amp;A since the upper echelons theory suggest that CEOs make

A method for decomposition of interactions is used to identify ‘smaller’ interactions in a top-down analysis, or the ‘smaller’ interactions can be grouped in more complex ones in

Do employees communicate more, does involvement influence their attitude concerning the cultural change and does training and the workplace design lead to more

It can be concluded that the CSV measures in panel A and panel B do contain information about the subsequent short-term momentum strategy, while the VDAX measure

To answer the question whether an active portfolio strategy based on the implied volatility spread earns abnormal returns, it is necessary to have an expected return and

Linear plant and quadratic supply rate The purpose of this section is to prove stability results based on supply rates generated by transfer functions that act on the variables w

It states that there will be significant limitations on government efforts to create the desired numbers and types of skilled manpower, for interventionism of