├── .DS_Store ├── LICENSE ├── Misc ├── Cubic Spline.png ├── NS_equation.png ├── Nelson Seigel.png ├── Predicted_NS.png └── Predicted_cubic_spline_values.png ├── Project_report.pdf ├── README.md └── Yield_curve_interpolation.ipynb /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 SuP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Misc/Cubic Spline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Misc/Cubic Spline.png -------------------------------------------------------------------------------- /Misc/NS_equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Misc/NS_equation.png -------------------------------------------------------------------------------- /Misc/Nelson Seigel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Misc/Nelson Seigel.png -------------------------------------------------------------------------------- /Misc/Predicted_NS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Misc/Predicted_NS.png -------------------------------------------------------------------------------- /Misc/Predicted_cubic_spline_values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Misc/Predicted_cubic_spline_values.png -------------------------------------------------------------------------------- /Project_report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supreeth8/Term_structure_modeling/0f5d8e1e35a54939f7ae43061c6330a6d97e64d3/Project_report.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Term Structure Modelling 2 | Yield curve Interpolation using Cubic Spline and Nelson Seigel model. 3 | 4 | 5 | ## Introduction 6 | The aim of this project is to calibrate the daily yield curves based on the benchmak 7 | bonds of the Australian market for the month of December 2018. The yield curve will 8 | be generated using the non parametric Cubic Spline Method and the parametric Nelson 9 | Siegel Method for each day throughout the month based on the daily reference data of 10 | the "Constant Maturity Treasury Rates" or CMTs sourced from Bloomberg(BBG). 11 | 12 | ## Cubic Spline 13 | As mentioned earlier, the Cubic Spline is an non parametric model which relies on the third order polynomial equations for the interpolation of the existing market reference data with a smooth curve which is usually prone to over-fitting of the data. The model constructed is based on the assumption that the CMTs are on zero coupon bonds with the mentioned expiration and hence have no intermediate payments. 14 | 15 | ## Nelson Siegel 16 | The Nelson Siegel is a parametric model with parameters β0,β1,β2 which are optimized to reduced the mean square error between the actual and estimated prices. Though the curve generated from this method doesn’t always pass through the existing points, it is considered a better approximation taking in to regard the additional information it conveys through the parameter values. This model defines the yield curve by the function- 17 | ![Img1](https://github.com/supreeth8/Term_structure_modeling/blob/master/Misc/NS_equation.png) 18 | > where, `β0 = Level/ Inflation`, 19 | `β1 = Slope/ Business Cycle`, 20 | `β2 = Curvature/ Interest Rate Volatility`, 21 | `λ = Time Constant`,`t = Maturity` 22 | 23 | ## Execution 24 | 1. Step 1 - Data Collection: We have downloaded the Australian Bonds data for month of December 2018 from Bloomberg terminal. Our program reads the excel files downloaded using pandas library. For bonds having tenor as 12, 20 and 30 years, we have same maturity date for different yields as tenor 10, 15 and 15 years respectively. So, we removed these data points to reduce complexity in yield curve fitting. 25 | 2. Step2-ImportDatatoPython:Afunctiontoretrieveallthenecessaryinputdata(yields, time to maturity in months, bond prices, coupons, schedule of all cash flows) from the .xlsx files to our python code was written. 26 | 3. Step3-CubicSplineGeneration:UsingtheCubicSplinelibraryfunctionscipy.interpolate from module to get (n-1) piece-wise cubic equations between (n) points and plot the yield curve obtained. In addition to this, an extension of the program which runs on the entire data for the month of December 2018 has also been inculcated. 27 | 4. Step 4 - Nelson Siegel Optimization: Initialize parameters with a starting value of β0 = 1,β1 = 1,β2 = 1 and the Time constant λ= 0.0605 for all calculations and the optimum value of βs are estimated. All calculations for factor-loadings are done with time to maturity taken in units of months. The Optimization is done in order to reduce the error difference between the Actual and Predicted values of the Bond prices which are calculated taking in to account every cash flow payment (unlike Cubic Spline) discounted with its corresponding yield value derived from the NS equation. In addition, similar extensions of the program to run on the entire data and also calculate the progression of the βs throughout the 31 Day period have also been inculcated. 28 | 29 | ## Result 30 | ### Cubic Spline 31 | 32 | ![Cubic Spline](https://github.com/supreeth8/Term_structure_modeling/blob/master/Misc/Cubic%20Spline.png) 33 | 34 | Values predicted 35 | 36 | 37 | ![Values](https://github.com/supreeth8/Term_structure_modeling/blob/master/Misc/Predicted_cubic_spline_values.png) 38 | 39 | 40 | ### Nelson Seigel 41 | ![NS](https://github.com/supreeth8/Term_structure_modeling/blob/master/Misc/Nelson%20Seigel.png) 42 | 43 | Values predicted 44 | 45 | 46 | ![values_predicted](https://github.com/supreeth8/Term_structure_modeling/blob/master/Misc/Predicted_NS.png) 47 | 48 | [Report](https://github.com/supreeth8/YieldCurve_interpolation/blob/master/Project_report.pdf) 49 | 50 | 51 | #### Other creaters 52 | - [Harnish Patel](https://www.linkedin.com/in/patel-harnish/) 53 | - [Goutham Bacha](https://www.linkedin.com/in/gouthambacha/) 54 | - [Laukik Tated ](https://www.linkedin.com/in/laukiktated/) 55 | - [Pridhvi Raj](https://www.linkedin.com/in/pridhviraj-r-596a00173/) 56 | --------------------------------------------------------------------------------