This project aims at analyzing the time series analysis of exchange rate between Euro and USD and comparing several models, including ARMA, SARMA, ARMA errors and ARIMA.
We use the daily data from January 2005 to December 2015. The spectrum does not show obvious business cycle. Then we fit a stationary Gaussian ARMA(1,0) model selected by AIC. However, the residuals have heavy tails and are not normally distributed.
In order to study the trend better, we calculate the monthly average rate based on the daily data. The spectrum also shows little evidence for cycle. Then we attempt SARMA model and ARMA errors model, but some of the coefficients are not significant. After trying ARIMA(0,1,1) model with white noise, we find that it fits best for this dataset. This means that the differenced data can be estimated be a random walk model.
Based on the ARIMA(0,1,1) model, we forecast the exchange rates in 2016, suggesting the US Dollar may become more valuable in relation to Euro.
The exchange rate in finance is the value of one currency in terms of another currency. For example, the exchange rate of Euro-USD is 1.12, meaning that 1 Euro can be exchanged for 1.12 US Dollar. The exchange rates are determined by continuous currency trading in foreign exchange market, which happens in 24 hours a day except weeekends and public holidays.
Exchange rate will change once the values of either of the two currencies fluctuates. The value of currency reflects its demand and supply. When the demand is greater than the avaiable supply, the currency would become more valuable. The demand for a currency is highly correlated to a country’s level of business activity, gross domestic product (GDP), and employment levels.
As the U.S. economy strengthens and the eurozone economy weakens, economists are concerned about whether the USD will surpass the Euro. The fluctuation of exchange rates has triggered currency-related problems for many international companies, which are based on U.S. and have large operations in Europe. Therefore, researching into the time series of Euro-USD exchange rates has practical value for economics.
We use the time series dataset containing daily exchange rates of Euro-USD from January 2005 to December 2015. The dataset is provided by the European Central Bank. The rates are updated only on working day. During the weekends, the rates are typically stable as the major markets are closed and there is very little trading to be reported. Thus we can regard them as continuous data. There are 2816 observations in total.
First we take a look at the historical data.
## Date Year Month USD
## 1 2005-01-03 2005 1 1.3507
## 2 2005-01-04 2005 1 1.3365
## 3 2005-01-05 2005 1 1.3224
## 4 2005-01-06 2005 1 1.3183
## 5 2005-01-07 2005 1 1.3200
## 6 2005-01-10 2005 1 1.3103
The variable USD is the daily exchange rates of Euro-USD. It means the amount of US Dollar which 1 Euro equals to. The larger it is, the less valuable US Dollar will become. They are based on a regular daily concertation procedure between central banks across Europe and worldwide, which normally takes place at 14:15 CET. Now we plot the data on the original scale.
The blue line reflects the fluctuation of exchange rates and the red horizontal line is the mean 1.318574 over 11 years. The maximum value happens around 2008. The global financial crisis depreciated US Dollar and increased the exchange rates. The curve decreases sharply in 2010, since the European debt crisis depreciated Euro. We guess there might exist business cycles over time, so we study into the periodogram.
We use the default non-parametric smoother in R to smooth the periodogram.
The dominant frequency is 0.0003472222 cycles per day, corresponding to a period of about 2880 days. This approximates to the number of total observations, indicating that the data may form a whole cycle.
Now we apply a parametric estimation method via AR model picked by AIC.
The frequency is 0 and means no cycle at all.
We analyze the data with a stationary Gaussian ARMA(p,q) model under the null hypothesis that there is no trend. The hypothesis states that the rates did not substantially changed over the last 11 years. It seems to be somewhat reasonable from the plot in 3.1. We’ll tabulate some AIC values for a range of different choices of p and q. Our goal is to select the smallest model with the lowest AIC score, which can minimizes the prediction error.
MA0 | MA1 | MA2 | MA3 | MA4 | MA5 | |
---|---|---|---|---|---|---|
AR0 | -4600.91 | -8195.12 | -10889.41 | -12779.57 | -14097.41 | -14950.36 |
AR1 | -18994.22 | -18992.26 | -18990.30 | -18988.73 | -18986.75 | -18987.21 |
AR2 | -18992.26 | -18990.83 | -18989.09 | -18987.34 | -18985.43 | -18982.84 |
AR3 | -18990.30 | -18988.37 | -18986.64 | -18985.58 | -18983.48 | -18983.22 |
AR4 | -18988.73 | -18986.37 | -18984.34 | -18996.63 | -18988.77 | -18983.30 |
The result shows that ARMA(4,3) has smallest AIC value -18996.63 while ARMA(1,0) has second smallest AIC value -18994.22. We prefer the simpler model ARMA(1,0), because the difference in AIC is small and the complex model may lead to poor prediction from overfitting. AR(1) is the best smallest model.
##
## Call:
## arima(x = rates$USD, order = c(1, 0, 0))
##
## Coefficients:
## ar1 intercept
## 0.9974 1.3183
## s.e. 0.0014 0.0544
##
## sigma^2 estimated as 6.862e-05: log likelihood = 9500.11, aic = -18994.22
The model is \[ X_n=\phi_1 X_{n-1}+\epsilon_n, \] where \[ \epsilon_n \overset{iid}\sim N[0,\sigma^2]. \] The parameter vector is \[ \theta=(\phi_1,\sigma^2)=(0.9974,6.862\times 10^{-5}). \]
We check the causality of this model. The root of \(1-\phi_1 x\) is 1.002603, which is outside the unit circle. So the AR(1) model is causal.
The MLE of \(\phi_1\) is 0.9974 and the standard error is 0.0014. Then we construct the approximate 95% confidence interval of \(\phi_1\) derived from Fisher information: \[ [0.9974-1.96*0.0014,0.9974+1.96*0.0014]=[0.994656,1.000144]. \]
Now we apply Bootstrap method using fisher information to confirm the result. Below is the histogram and density plot of \(\phi_1\).
The two plots are consistent with the confidence interval via the observed Fisher information.
Now we plot the residuals over time.
Residual plot shows that there might exist trend that occurs monthly. Then we check the assumption of Gaussian white noise.
Constant variance By plotting the residuals v.s. fitted values, we can see the nonlinearity and confirm the constant variance.
Normality The Q-Q plot suggests there might exist heavy tails, so we perform Shapiro-Wilk’s normality on the residuals.
##
## Shapiro-Wilk normality test
##
## data: res_ar1
## W = 0.96604, p-value < 2.2e-16
The p-value is extremely small, so we reject the hypothesis that the residuals are Gaussian.
The AR(1) model is stationary and causal for this dataset. The coefficient is also significant by fisher information. The residuals have constant variance and are uncorrelated, however, they contrast the assumption of Gaussian distribution. There might exist trend that occurs monthly, suggesting more complex model than ARMA.
To study the trend of the exchange rates, we need equally spaced time series data. So we calculate the monthly average rates based on the daily rates. Here is the monthly average data. There are 132 observations in total.
## Year Month USD
## 1 2005 1 1.311929
## 2 2005 2 1.301425
## 3 2005 3 1.320067
## 4 2005 4 1.293790
## 5 2005 5 1.269395
## 6 2005 6 1.216491
We plot the monthly rates over time.
The blue line reflects the fluctuation of exchange rates and the red horizontal line is the mean 1.318697 over 11 years. The mean is slightly different from the one of daily data, because the number of days in each month may differ. The trend is revealed more clearly.
The original spectrum density is quite smooth here, so there is no need to smooth it. The frequency is 0.007407407 cycles per month, so the period is 135 months, which is roughly all the observations of 11 years.
Based on the analysis in 3.3.1, we go with AR(1) for the annual polynomial. And we try ARMA(1,1) for the monthly part. The model can with white noise be expressed as follows: \[ (1-\Phi_1 B^{12})(1-\phi_1 B)(X_n-\mu)=(1+\psi_1 B)\epsilon_n, \] where \(\epsilon_n\) is a white noise process and \(\mu={\mathbb{E}}[X_n]\).
##
## Call:
## arima(x = rates2$USD, order = c(1, 0, 1), seasonal = list(order = c(1, 0, 0),
## period = 12))
##
## Coefficients:
## ar1 ma1 sar1 intercept
## 0.9401 0.3027 -0.0683 1.2986
## s.e. 0.0316 0.0864 0.0937 0.0488
##
## sigma^2 estimated as 0.0008964: log likelihood = 274.46, aic = -538.92
The MLE of \(\Phi_1\) is -0.0683 and the standard error is 0.0937. The 95% confidence interval by Fisher information is \[ [-0.0683-1.96*0.0937,-0.0683+1.96*0.0937]=[-0.251952, 0.115352]. \] Therefore, the coefficient is not significant. After attempting several simple SARMA models, this problem still exist. This suggests that SARMA model is not appropriate for this dataset, because the annual variation is not significant here.
In 4.1, there seems to have evidence for a decreasing trend of monthly exchange rates. So we test for a trend, using a regression model with Gaussian ARMA errors. We consider a table of AIC values for different ARMA(p,q) error specifications.
MA0 | MA1 | MA2 | MA3 | MA4 | MA5 | |
---|---|---|---|---|---|---|
AR0 | -221.13 | -355.81 | -445.56 | -468.46 | -502.79 | -505.34 |
AR1 | -529.10 | -539.62 | -537.79 | -536.09 | -540.21 | -538.21 |
AR2 | -539.86 | -537.90 | -541.52 | -539.84 | -539.33 | -540.56 |
AR3 | -537.86 | -536.09 | -540.03 | -536.53 | -535.04 | -539.88 |
AR4 | -539.18 | -538.51 | -537.43 | -538.56 | -539.83 | -538.05 |
The best smallest model is ARMA(2,0) as follows.
##
## Call:
## arima(x = rates2$USD, order = c(2, 0, 0), xreg = rates2$Time)
##
## Coefficients:
## ar1 ar2 intercept rates2$Time
## 1.2454 -0.3058 26.2536 -0.0124
## s.e. 0.0826 0.0850 22.1521 0.0110
##
## sigma^2 estimated as 0.000891: log likelihood = 274.93, aic = -539.86
Let \(x_{1:N}^*\) denotes the N values of monthly exchange rates, \(t_{1:N}\) denotes the time points by month, where N=132. We have \[ X_n=\alpha+\beta t_n+\epsilon_n, \] for which \(\epsilon_{1:N}\) is a stationary, causal Gaussian(2,0) model statisfying a stochastic difference equation, \[ \epsilon_n=\phi_1\epsilon_{n-1}+\phi_2\epsilon_{n-2}+\omega_n, \] where \(\omega_n\) is a Gaussian white noise with \[ \omega_\sim N[0,\sigma^2]. \]
It is worth noticing that the MLE and standard error of \(\beta\) is -0.0124 and 0.0110. Therefore, the 95% confidence interval of \(\beta\) is \[ [-0.0124-1.96*0.0110,-0.0124+1.96*0.0110]=[-0.03396,0.00916]. \]
It is not significant. This is confirmed by the likelihood ratio test giving p-value of 0.2685249, so we does not reject the null hypothesis that the coefficient of time is zero. Therefore, linear regression over time with ARMA error is not appropriate for the currency exchange rate.
First we take a look at the temporal difference. Let \(Y_n=(1-B)X_n\) and \(y_n^*=x_n^*-x_{n-1}^*\), where \(x_n^*\) is the data of monthly average rates.
It appears to be not stationary, suggesting that ARIMA model may be a reasonable choice.
Similar to 3.3.1, we seek to select a simple model with least AIC. We start with the difference term d=1.
MA0 | MA1 | MA2 | MA3 | MA4 | MA5 | |
---|---|---|---|---|---|---|
AR0 | -530.09 | -539.02 | -537.03 | -535.12 | -537.44 | -535.76 |
AR1 | -538.47 | -537.03 | -540.45 | -533.95 | -537.76 | -538.29 |
AR2 | -536.73 | -535.07 | -533.50 | -535.17 | -536.37 | -536.36 |
AR3 | -536.40 | -534.56 | -534.47 | -535.11 | -537.31 | -536.07 |
AR4 | -534.82 | -539.07 | -537.53 | -533.77 | -536.07 | -532.49 |
The best simplest model is ARIMA(0,1,1) as follows. This model is connected with the exponentially weighted moving average (EWMA) method of forecasting.
##
## Call:
## arima(x = rates2$USD, order = c(0, 1, 1))
##
## Coefficients:
## ma1
## 0.2931
## s.e. 0.0828
##
## sigma^2 estimated as 0.0009268: log likelihood = 271.51, aic = -539.02
The model can be expressed as \[ X_n-X_{n-1}=Y_n=\epsilon_n+\psi_1\epsilon_{n-1} \] where \[ \epsilon_n \overset{iid}\sim N[0,\sigma^2]. \] The parameter vector is \[ \theta=(\psi_1,\sigma^2)=(0.2931,0.0009268). \]
We can see that the differenced data are fitted by a random walk model, which is stationary and invertible. The MA polynomial has the root outside the unit circle. The 95% confidence interval of MA(1) coefficient is \[ [0.2931-1.96*0.0828,0.2931+1.96*0.0828]=[0.130812,0.455388]. \] The coefficient is significant by Fisher information.
Here is the plot of residuals.
We also plot the ACF of residuals. The ACF plot shows most of the correlations fall within the threshold limits, indicating that the residuals are behaving like white noise.
After diagnostic analysis, we use the ARIMA(0,1,1) model to forecast the exchange rates in 2016. The x-axis means the number of months since 2005.
We can estimate that the exchange rates of Euro-USD is showing a decreasing trend in 2016. The US Dollar continues to become more valuable in relation to Euro. It may be driven by continued faster economic growth in the U.S. as compared with Europe.
From the above analysis, we can see that the best way to fit the exchange rate is the ARIMA(0,1,1) model on monthly average data. Many literature work [6]-[7] have outlined that ARIMA model is comparatively accurate model to fit the exchange rate. For further study, we can apply exponential smoothing model to forecast.
[1] http://ionides.github.io/531w16/
[2] http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html
[3] https://en.wikipedia.org/wiki/Exchange_rate
[4] http://www.investopedia.com/articles/forex/041415/will-usd-surpass-eur.asp
[5] https://www.otexts.org/fpp/8/7
[6] http://arxiv.org/pdf/1508.07534.pdf
[7] http://www.cluteinstitute.com/ojs/index.php/JABR/article/viewFile/6840/6915