Economists and Mathematicians have been trying to study the foreign exchange rate for years. From some research paper, Geometric Brownian Motion (GBM) has been proved useful in simulating financial data (Brewer, K., Feng, Y., & Kwan, C, 2012). Gerber, for example, points out in the paper that GBM could be used to model assets and liability (Gerber, H., & Shiu, E., 2003). Motivated by those research papaers, I want to model the motion of foreign exchange rate with time series techniques.
The methods I use to approach the above question are POMP and GARCH model. I compare the log likelihood of the two models to see which one performs better.
In this report, I will focus on the GBP/USD exchange rate.
The question of interests is that whether GBM POMP is suitable for fitting the GBP/USD exchange rate data and provides stable results. Also, by comparing the GBM POMP model and GARCH model, which method would be more appropriate for practical use.
To study the relationships, we attain our data from the website of Federal Reserve System (Foreign Exchange Rate, 2016).
The dataset has two variables, Rate (GBP/USD exchange rate) and Date. It is a daily data recording GBP/USD exchange rate from the year 2000 to present.
The original data has 4244 observations. Some of them are missing values. The missing data represents that the market is closed for that day. I removed all missing values in the dataset. That is to say, we do not consider the closing market days. After removing missing values, we have 4088 observations. Also to note that there are around 260 data points for each year.
For computational purpose, we select only 300 subset of the original data. It records foreign exchange rate around the year 2010 and 2011. The economic market was quite stable at that time.
Figure 1 shows the times series plot of the whole data set. We can see a sharp decrease in the year 2008, which is caused by the Financial Crisis.
Brewer points out in his paper that the Geometric Brownian Motion Model means the logarithm of the data follows a Brownian motion and provided the following equations(Brewer, K., Feng, Y., & Kwan, C, 2016).
The original differential equation is defined as \[ dN = \mu Ndt+\delta Ndz\] where \(N\) is the foreign exchange rate on that day, \(dz=\epsilon \sqrt{dt}\) and \(\epsilon\) is a random draw from the normal distribution with mean 0 and variance \(\sigma\). \(\mu\) and \(\delta\) are usually the drift parameter and the volatility parameter, respectively.
The equation is equivalent to \[ d\log(N) = (\mu -\frac{\delta ^2}{2})dt+\delta dz\]
After solving the differential equation, we get \[ N_{t+\Delta{t}}=N_{t}e^{(\mu -\frac{\delta ^2}{2})\Delta{t}+\delta \epsilon \sqrt{\Delta{t}}}\] Set \(\Delta{t}\) equal to 1, we have \[ N_{t+1}=N_{t}e^{(\mu -\frac{\delta ^2}{2})\frac{1}{n}+\frac{\delta }{\sqrt{n}}\epsilon }\] where \(n\) is the number of days in a year, which is 260 (only accounts for open market days).
There are 3 parameters \(\mu\), \(\delta\) and \(\sigma\).
\(\mu\) is the drift parameter that shows the increasing or decreasing trend.
\(\delta\) is the volatility parameter that measures the deviations from the mean.
\(\sigma\) is the variance of the state parameter \(\epsilon\). By increasing sigma, it will increase the deviations from the mean.
The rprocess is based on the GBM model with two state variables, \(N\) and \(\epsilon\).
The parameters are \(\mu\), \(\sigma\) and \(\delta\).
The initial value of N is drawn from a random poisson distribution with mean 1.5. The initial value of \(\epsilon\) is drawn from a poisson distribution with mean 1.
The rmeasure is defined as Rate being drawn from a random draw from the normal distribution with mean 0 and variance \(N\), which is the state variable.
The detailed implementation is shown below.
dmeas <- Csnippet("lik = dnorm(Rate,0,N,give_log);")
rmeas <- Csnippet("Rate = rnorm(0,N);")
Ne_initializer <- "
N=rpois(1.5);
e=rpois(1);
"
stochStep <- Csnippet("
e = rnorm(0,sigma);
N = N*exp((mu-delta*delta/2)/260+delta/sqrt(260)*e);
")
stopifnot(packageVersion("pomp")>="0.75-1")
pomp(data = dt2,
times="Date",
t0=0,
rprocess=discrete.time.sim(step.fun=stochStep,delta.t=1),
rmeasure = rmeas,
dmeasure=dmeas,
obsnames = "Rate",
paramnames=c("mu","delta","sigma"),
statenames=c("N","e"),
initializer=Csnippet(Ne_initializer)
) -> fx
There are three run levels. The analysis of this report is based on level 3.
Detailed parameters are defined below
run_level = 3
level_Np = c(100,1000,5000)
level_Nmif = c(10,100,300)
level_Nreps_eval = c(4,10,20)
level_Nreps_local = c(10,20,20)
level_Nreps_global = c(10,20,100)
## se
## -576.34332106 0.01696181
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -569.01 -568.96 -568.95 -568.91 -568.83 -568.81
The pairwise plot shows us the geometry of the likelihood surface in a neighborhood (20 units around the maximum likelihood) for each parameter.
I will then perform global search to see if the result is stable and compare the likelihood with the GARCH model.
fx_box <- rbind(
mu = c(-5,10),
delta = c(0.1,1.5),
sigma = c(0.5,3)
)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -587.61 -582.05 -575.61 -575.90 -568.98 -568.82
Parameter estimation requires many and random starting values. Now I draw a starting value uniformly from an interval for each parameter. If the estimation gives stable result with different starting values, then it will provide confidence that an adequate global search has been carried out (Ionizes, E., 2016).
It gives us a best likelihood of -568.82 with a standard error of 0.008.
The likelihood is similar to our local search and the global search provides a quite stable statistic.
By using the pairwise plot, we can get a feeling of how does the geometry of the likelihood surface look like in the neighborhood (10 units around the maximum likelihood) for each parameter.
We can see that the points are clustered and end up with comparable likelihoods though the parameters are drawn from different starting values. It shows that the model gives stable maximization of likelihood.
According to notes from the class, the GARCH(p,q) model has the form \[ Y_n = \epsilon_n \sqrt{V_n},\] where \[ V_n = \alpha_0 + \sum_{j=1}^p \alpha_j Y_{n-j}^2 + \sum_{k=1}^q \beta_k V_{n-k}\] and \(\epsilon_{1:N}\) is white noise (Ionides E., 2016).
From comparing the GARCH(1,0), GARCH(0,1) and GARCH(1,1) model by checking their log likelihoods, I decide to use the GARCH(0,1) model which gives the largest likelihood.
## 'log Lik.' -560.0184 (df=2)
The GARCH(0,1) model gives the log likelihood of -560.0184. It is slightly larger than than the likelihood we get from the POMP model.
The likelihood does not change significantly between the POMP model and GARCH model. However, the GARCH model is difficult to interpret. So personally speaking, I favor the POMP model. But we may still need to use some preliminary results to see if it can be improved to beat the GARCH model.
The QQ-plot shows the residuals are normally distributed.
The ACF plot shows 2 lags slightly falling outside the dashed line. Since most autocorrelation values are within the confidence lines, the do not reject the assumption that errors are independent.
In this report, I use the Geometric Brownian Motion to build a POMP model on the foreign exchange rate (GBP/USD).
The POMP model gives a stable maximum log likelihood of -568.82. It shows that the GBM POMP model is suitable for the GBP/USD exchange rate data.
GARCH(0,1) model is used as a benchmark for comparison. The GARCH(0,1) model gives the log likelihood of -560.0184, which is slightly larger than the POMP model.
Personally speaking, I would favor the POMP model since GARCH is difficult to interpret and does not improve the likelihood significantly. However further preliminary analysis is necessary to improve the POMP model.
The project is based on the course on Time Series Analysis, taught by Professor Ionides at the University of Michigan Winter, 2016. The POMP model and R coding consults examples in the class notes from http://ionides.github.io/531w16/notes13/notes13.html.
[1] Brewer, K., Feng, Y., & Kwan, C. (2012, November). Geometric Brownian Motion, Option Pricing, and Simulation. Retrieved April 21, 2016, from http://epublications.bond.edu.au/cgi/viewcontent.cgi?article=1131&context=ejsie
[2] Foreign Exchange Rates - H.10. (2016). Retrieved April 21, 2016, from https://www.federalreserve.gov/releases/h10/hist/dat00_uk.htm
[3] Geometric Brownian motion. (2016, February 18). In Wikipedia, The Free Encyclopedia. Retrieved 21:37, April 21, 2016, from https://en.wikipedia.org/w/index.php?title=Geometric_Brownian_motion&oldid=705536768
[4] Gerber, H., & Shiu, E. (2003, June). Geometric Brownian Motion Models for Assets and Liabilities: From Pension Funding to Optimal Dividends. Retrieved April 23, 2016, from https://www.researchgate.net/publication/267017769_Geometric_Brownian_Motion_Models_for_Assets_and_Liabilities_From_Pension_Funding_to_Optimal_Dividends
[5] Ionizes, E. (2016, March 22). Practical likelihood-based inference for POMP models. Retrieved April 23, 2016, from http://ionides.github.io/531w16/notes13/notes13.html
[6] Ionides, E. (2016, April 5). Case study: POMP modeling to investigate financial volatility. Retrieved April 23, 2016, from http://ionides.github.io/531w16/notes15/notes15.html