Tests for Detection of Granger Causality in Bond Yield Curve Data
Suppose , we have 2 (univariate) time series and , where . First we consider a standard model for , given by ,
....... (1) .
Further, assume also has an model . (This might require a few zero coefficients in one of the AR models) .
Consider another model , .....(2) .
Assume , the errors follow distribution .
Our problem is to check whether the model in (2) is "better" than that in (1) . Here, "better" refers to less residual sum of squares. In other words, we want to see, whether including past values of makes the prediction of present better. In case of univarite and , it's possible to do so by using standard F-test. In such a case, we find that model (2) is better, and we say that Granger causes
Our current problem is to work on the Multivariate extension. It's known that in the case of multivariate time series, standard F-test doesn't work (as becomes 0 or very close to 0). So, we use tools from functional data analysis, like Functional PCA and do Granger causality test on the obtained coefficients . We'd implement these methods on the bond yield curve data of USA & India. Further, we'd look at various different test statistics and do high-dimensional sign test, spatial rank sign test etc. for non-parametric Granger causality tests for high dimensional data (like functional data) .
Further, we'd use Nelson Siegel equations, which are especially designed for modelling yield curves and use it to predict future returns using a method suggested by Diebold and Li (referred as DL method) . Then we check how good the predictions are using various measures like standardised RMSE and standardised absolute error etc.
Keywords: Finance, High dimensional inference, Functional data analysis, Yield Curve modelling
|AR model||Autoregressive model|
|DL forecasting||Diebold and Li's method of forecasting|
|VARMA model||Vector Autoregressive Moving average model|
- We take data from January 2, 2019, to May 10, 2019, for both the countries for this purpose. We use FPCA based Granger causality test, followed by a permutation test to conclude about it .
- Also, using this data, we predict the returns for May 13, 2019, to June 13, 2019, and check how accurate these returns are (using various metrics).
- We compare the power of various tests, such as permutation test, FPCA based test, and spatial tests using simulated datasets.
- We use Nelson-Siegel curves to model the Indian bond yield curve .
Statement of the Problems
- Functional datasets are prevalent in almost all areas of science, e.g. Finance, population studies, disease modeling, behavioral sciences, handwriting recognition, etc. Our present problem concerns 2 financial datasets, US bond yield dataset, and Indian bond yield dataset. We'd try to approximate the functions (infinite dimensional) by a linear combination of few orthogonal basis functions and use various testing (inference) and prediction models on them. This analysis would be helpful to understand whether US bond yields granger cause Indian bond yields and vice-versa, i.e. we'd know whether there is a statistically significant evidence of causality. Further, we can use the coefficients from FPCA to predict the bond yields at a future date using Nelson Siegel curves. This can be used for academic purposes, share market tradings and policy research. One of our main objectives would be carrying out simulation studies to compare powers of various tests like FPCA based test, Spatial sign test, permutation test etc.
- However, for spatial tests, we'd stick to multidimensional setup. The results can be further improved using infinite dimensional setup , but those tests require usage of random variables on Banach space. So for the sake of ease, we stick to multidimensional setup, which as we later see, has pretty decent power.
Objectives of the Research
First, we see whether Indian bond returns granger cause US bond returns (and vice-versa) . We use various tests for this, viz. spatial tests, permutation test, FPCA based test etc. These are all hypothesis testing problems from an inferential perspective. We also discuss the theoretical details of these tests .
Further, we use the available data to estimate the parameters of the Nelson Siegel curve and then use AR(1) models to forecast those parameters and use them to predict future Indian & USA bond yields. Then we compare them with the real data to see how accurate the estimates are .
Also, we use simulation studies to compare powers of various tests .
The current study involves investigation of Granger causality between US & Indian yield curves , but the techniques used here are general and can be used for any country/functional data in general. The prediction methods (Nelson-Siegel curves), or DL method too , are applicable in general for modelling any yield curve .
In the paper "Time series of functional data with application to yield curves" by Sen & Klüppelberg (2019), the results regarding FPCA, parameter estimation, DL method, and consistency have been proved. This paper also discusses the technique for prediction of long term interest rates using short term interst rates using functional regression .
The paper "Determining the order of the functional autoregressive model " by Kokoszka & Reimherr enables us to decide the order of a VAR model by sequential hypothesis testing. The techniques laid out here are essential to determine the order of VAR model when modelling the vector of coefficients from FPCA for Granger causality detection.
Further, discussion regarding NS curves & its application in yield curve modeling has been done in the paper "Estimating the Yield Curve Using the Nelson‐Siegel Model" by Annaert et al. (). Sen & Klüppelberg's paper also discusses how to use the parameters obtained from the NS model for prediction of returns at a future date.
The NS model proposes the following equation for bond yields are various maturities :
where refers to maturity in months .
The coefficients are computed using least square fitting. We know use this equation to model the Indian & USA bond yields and report the error.
In DL method, we obtain estimates for and use AR(1) model to forecast for (May 13 too June 13 ). Then we use these forecasts in the NS model (#) to forecast bond yields at various maturities at future dates.
We'd be using tools and techniques discussed in these papers in the context of the 2019 data of Indian & USA yield curves. We'd use the available data to predict the Indian bond return rates for 1 month future (May 13 to June 13) using NS model coupled with autoregression and find the accuracy by comparing with real data. Further, we use 4 different tests for Granger causality detection, compare the results and investigate their powers through simulation studies .
Concepts of Functional PCA
The data for US & Indian bond returns have been collected from in.investing.com (). The data was downloaded in CSV format and was processed using R ( ) , an open-source statistical computing framework.
We use bond yield data from 2 countries, viz. India and USA. We use daily returns data obtained from in.investing.com for 85 days, from January 1, 2019 to May 10, 2019 (ignoring weekends & holidays). For both the countries, we looked at returns from 3 month, 6 month, 1 year, 2 year, 3 year, 5 year, 7 year, 10 year and 30 year bonds . We assume maturity to be a continuous variable taking values in [0, 30] years.
So, formulating in the language of functional data, we've 2 functional datasets and where and . The first one refers to Indian bond returns and the later one refers to the US bond returns respectively. e.g. refers to the returns from a 0.3 year maturity Indian bond on the 64th day .
FPCA is used for representing a function in the eigen basis, where the basis functions form a set of orthonormal functions in Hilbert space with norm . We now consider a stochastic process (continuous time process ), which is square integrable .
We express , where are orthogonal basis functions and be eigenvalues .
It's known, using .that we can write
Our main target is to represent the variances using a linear combination of a small number of basis functions (very similar to the idea of usual PCA, here we're just dealing with an infinite dimensional case). We use eigen functions corresponding to the largest eigenvalues so that 80-90% of the variance is explained.
We now do reconstruction ......(3) using only "few" basis functions. In our examples on bond yield data , we'd mostly have .
Now, we do FPCA on and . We used R for these computations and found the optimal number of components (Fig. 1) selected is: 8, and the first 3 eigenvalues are: 0.174 , 0.111 and 0.008 for the Indian data. For USA data, the optimal number of components (Fig. 2 ) selected is: 7, and the first 3 eigenvalues are: 0.241, 0.007 and 0.001 .
Methods for testing Granger causality
Granger causality detection using FPCA based test
We take the coefficients estimated in the FPCA model (for convenience, we consider first 4 PC's for both Indian & USA data) .
For each , we have 2 vectors and of dimension 4 ( obtained from Indian FPCA and US FPCA respectively) which gives us coefficients from FPCA. These are examples of multivariate (4 variate to be specific) time series and we perform Granger Causality tests on these by looking at usual VAR (vector autoregressive) models .
Now, Consider an 8 dimensional vector and run a VAR model on it to get fitted vectors, say . The chosen model is VAR (1) for the joint dataset involving both 's and 's . Under , i.e. non-causality ( i.e. USA returns don't Granger cause Indian returns), we run a VAR model using values of for and calculate the fitted vectors, say call them for . Then, we use inbuilt functions in R , to test for Granger causality using and values.
Permutation test for detecting Granger Causality
As already explained above, under , we run a VAR model using values of for and calculate the fitted vectors, say call them for . (This model turned to be VAR(1) by AIC minimisation). From here, we calculate the fitted values by equation (3).
Again, Consider an 8 dimensional vector and run a VAR model on it to get fitted vectors, say . Using these estimates for , we calculate the fitted values using equation (3).
Our idea is to calculate two integrals, which gives us a measure of error, viz.
and for . The first one gives the measurement of error under the null hyptheses of non-causality & the second one does the job under general alternative. We ignored because the fitted value doesn't make sense for the starting point in a VAR model .
R returns the values of the basis function on a workgrid only ( in this case, a discrete set of 51 points ). So, or values can be found from (3) on the workgrid only, but we need values at other points too for computing the integral . To approximate and at each point in by a piecewise smooth function , we use cubic spline interpolation. For itself too, the values are available at a few particular points only . We use cubic splines to approximate at other points too .
Now, considered paired data, . We'd run a paired permutation test with one-sided alternative to test whether the mean of 's and 's are the same .
Spatial Sign Test
Definition : For a non-zero vector , we define spatial sign as .
Observe that, this definition is analogous to the usual sign [positive/negative] for real numbers, i.e. the case .
Given the workgrid , consider the error vectors from the null model ,
for each . Further, consider error vectors from the general model , for each .
Consider the vectors as data (observations) for .
Consider the setup described in Multivariate nonparametrical methods based on spatial signs and ranks: The R package SpatialNP (2007) by Sirki ̈a , Taskinen , Nevalainen and Oja .
We perform spatial sign test to test ,
( Here refers to the multivariate mean of the data , ) .
For spatial tests , given any score function , , under null hypothesis ,
where and . Here , and . For this particular test , used score function is the Spatial sign ( later we'd use signed rank) , i.e. here .
Spatial Signed Rank Test
We use the same test statistics & null asymptotic distribution used in the last section, now with the scoring function,
, where , where refers to the full data for .
Here refers to the average taken over all possible values of . Details are available in Multivariate nonparametrical methods based on spatial signs and ranks: The R package SpatialNP (2007) by Sirki ̈a, Taskinen, Nevalainen and Oja.
Non-Parametric Graph based test
Consider the setup described in section 3 of .
Here, . Consider the error vectors as and as . So , we've 2 group of error vectors .
Under non-causality, both the groups should represent IID realisations from the same distribution.
For , define, if nearest neighbor has the same label as . Otherwise , let .
Define , and under
Then under null, we have . This test is computationally super-intensive for a simulation based study, because, has a very messy theoretical expression and in practice, we need bootstrap based approach to estimate .
Simulation Studies to compare the power of tests
We use simulated data to compare powers of the 4 tests mentioned above .
For the analysis, let the USA data, be kept fixed and Consider the 8 dimensional vectors,
and run a VAR model on them.
It turns out to be a VAR (1) model of the form ..... (**) , where, refers to the noise present. Clearly, in this case, US bond yields "affect" the Indian bond yields, as depends on .
We'd simulate by using a VAR (1) model with the obtained matrix as the premultiplication matrix and noise from a distribution, where is the variance-covariance matrix of the residuals obtained in the model (**) .
Then we can use the reconstruction, and check in how many cases the tests can detect that Granger causes , i.e. reject the null hypthesis. In this way, we can emperically estimate the powers. Due to limited computational power, we'd stick to 50-500 simulations in each case.
Another idea to simulate would be using variants of Nelson Siegel function , but with large and the decaying nature of the second and the third terms of the NS model, the simulation couldn't explain the variation in long term maturities properly. So , this wasn't of any practical use.
RESULTS AND DISCUSSION
FPCA based test
The plots of the functional principal components of India and USA are given below :
The fitted variance-covariance matrices for both the countries are attached as 3D-plots herewith .
Using FPCA based test, we test whether USA returns Granger cause Indian returns. The p-value is 0.0005043, indicating rejection of null hypothesis. In the case of testing whether India Granger causes US returns, we get a p-value 0.01131 , i.e. we reject .
Using spatial sign test, the p-value comes around 1, and using signed rank test, the p-value comes around . So , all of these tests imply rejection of the null hypothesis (non-causality) in testing whether USA returns Granger cause Indian returns .
Spatial Test & Permutation Test
In the case of simulation, the power of the spatial tests come to be around 1 using 100-200 simulations and that of the FPCA based test come to around 0.40- 0.48 using 50-500 simulations. The permutation test yields a very low power (around 0.2) and is not efficient.
The huge power of spatial tests is attributed to its high dimensional nature. Intuitively speaking, in higher dimension, it is much easier to detect whether a bunch of points is centred around origin, than to do the same in lower dimension (which the permutation test kind of does by comparing the difference of integrals, in this case).
The FPCA based test has a decent power, but is far from the spatial test due to the cure of dimensionality, which means that we have considered only the top 4 functional principal components from both countries (while FPC returns 7 & 8 compenents to explain most of the varaince) .
|Test||# of simulations||Emperical power|
|FPCA based test||100||0.37|
|FPCA based test||300||0.393|
|FPCA based test||500||0.408|
|FPCA based test||600||0.373|
|Spatial sign test||100,200,300||~1 in all cases|
|Spatial rank test||100,200,300||~1 in all cases|
NS Model fitting
We estimate the parameter in the NS model and compute the fitted bond returns for the Indian data from Jan 2 to May 10 . The average relative error in predicting each is just about 0.02%. This shows that, the NS curve models the bond yields almost perfectly, since it is custom-designed for applying on yield curves .
Here, we show the plot of the actual bond yields and predicted bond yields by NS equation for different maturities for 3 radomly selected days .
DL method of Forecasting
As mentioned in methods, we use AR(1) models to forecast values of the FPC coefficients & the parameter in the NS model at future dates (May 13-June 13) and use those to find forecasts of Indian bond yields at future dates, i.e. May 13-June 13. The average relative error in the prediction of future Indian bond yields turns out to be just 3.7%, showing that DL method produces good results on the Indian data.
Modified DL Forecasting technique
As mentioned earlier, in DL forecasting, we use AR(1) models to forecast values of the FPC estimates and the parameter in the NS model at future dates (May 13-June 13) and use those to find forecasts of Indian bond yields at future dates, i.e. May 13-June 13 .
Now, we use ARIMA models of the appropriate order, instead of AR models to forecast the parameters of the NS model at future dates. The order of the ARIMA model would be chosen by AIC (Akaike Information Criterion) minimisation .
Here, we report the order of the fitted ARIMA models for 4 parameters :
|Parameter||Order of ARIMA model|
As expected, this method generates only 2.75% average relative error in forecasting the bond yields from May 13 to June 13 , which is less than the above mentioned method. This shows that, using finer models to forecast the parameters of the NS curve leads to better overall forecasts .
- The spatial tests have the highest emperical power among the ones discussed.
- Permutation test is NOT efficient in this context.
- Indian returns Granger cause USA bond returns and vice-versa.
- NS curves fit the Indian bond yield curve very accuartely and explains most of the variance observed in the values.
- DL forecasting method works nicely for short term prediction of bond yields in the Indian market. It can be improved in case we use ARIMA ( of appropriate order) instead of plain AR(1) model for forecasting the FPC coefficients.
✪ Use of infinite dimensional spatial tests in this steup is possible. Such tests have been discussed in the paper "Tests for high-dimensional data based on means, spatial signs and spatial ranks" by Chakrabarty and Chaudhuri ()
✪ In the future, we can take up an extensive study involving many more countries to explore the Granger causality network and its economic & statistical implications.
✪ Use Nelson, Siegel and Stevenson curves instead of the NS model .
✪ All of the techniques used in FPCA can be used in audio waves, where we can use Fourier basis . This can help us in lower dimensional representation in sound waves, i.e. audio compression. Further, the obtained coefficients can be used for speech recognition (using the nearest neighbour or more advanced ML techniques) or for understanding how the voice of a person changes over age (it would be a functional dataset) .
✪ Further, the techniques can be used to understand the growth of tumors from MRI data, or of change in brain waves in Brain-computer interfaces .
1. Time series of functional data with application to yield curves - Sen & Klüppelberg (2019)
2. High-Dimensional, Two-Sample Testing - CMU Stat ML lectures http://www.stat.cmu.edu/~ryantibs/statml/lectures/TwoSample.pdf
3. Tests for high-dimensional data based on means, spatial signs and spatial - Chakraborty and Chaudhuri ranks
4. Determining the order of the functional autoregressive model - Kokoszka & Reimherr
5. R programming language for statistical computations - https://www.r-project.org
6. Functional Autoregression for Sparsely Sampled Data - Daniel R. Kowal, David S. Matteson, and David Ruppert (2016)
7. Likelihood ratio tests for covariance matrices of high-dimensional normal distributions Dandan Jiang , Tiefeng Jiang , Fan Yang (2012)
8. Measurement of Linear Dependence and Feedback Betwveen Multiple Time Series - John Geweke
9. Granger Causality Testing in High-Dimensional VARs: a Post-Double-Selection Procedure Hecq, A., Margaritella, L., Smeekes, S.
10. Wikipedia -
11. Wikipedia -
12. Multivariate nonparametrical methods based on spatial signs and ranks: The R package SpatialNP (2007) by Sirki ̈a , Taskinen , Nevalainen and Oja
I'm eternally grateful to Indian Academy of Sciences and National Academy of sciences for providing me the summer research fellowship for carrying out the research .
I'm also grateful to thank Dr. Rituparna Sen , my guide , for guiding me in this exciting project in mathematical finance. Her guidance on the mathematical as well as computational aspects of this project has been immensly valuable .