Friday, January 26, 2018

How to plot the yield curve using SGS data

Where do you get the necessary data to plot the yield curve? How do you plot the data points? How do you interpret the yield curve? These are some questions that have been on my mind for quite a long time. I have been reading the financial blogosphere and was secretly hoping for someone to address this topic. I've waited and waited to no avail.

As I'm thinking of doing some mathematical modelling with bond data in the future, I decided to force myself to search for answers to my own questions.

First, head over to the Monetary Authority of Singapore (MAS) website. Scroll down to the bottom of the page.

Singapore government bonds

Click on the link titled "SGS: Singapore Government Securities" (circled in red in the above screenshot). You will be brought to the Singapore Government Securities (SGS) page.

Singapore Government Securities

Once you are at the SGS page, click on the "Statistics" link (circled in red in the above screenshot).

Singapore Bond Price and Yield

At the Statistics page, select the "Historical Prices" link (circled in red in the above screenshot).

Singapore bond yield

You will be brought to the above page (see screenshot above). The page details the various parameters that you can tweak. Once your selections have been made, you can display the resultant dataset either on the page (by clicking on the "display" button) or in a csv file format (by clicking on the "download" button).

I'll briefly go through the parameters. "Start Year" and "Start Month" refer to the earliest data points you want in your dataset while "End Year" and "End Month" refer to the latest data points you want in your dataset. The "Frequency" parameter has one of four values for you to select from: (a) Daily, (b) Weekly, (c) Monthly, or (d) Yearly. Depending on your frequency selection, the dataset you end up with could be very huge (e.g. daily data) or very small (e.g. yearly data).

Next, we will look at the checkboxes. These checkboxes are used to select the variables that you want in your dataset. Each variable is defined in terms of its tenure (e.g. 1-year, 2-year, 5-year, etc) and either its yield or price. You are allowed to select however many variables you want in your dataset.

To digress a bit, if you display variables with similar tenure (e.g. 10-year Bond Yield and 10-year Bond Price) across a period of time, you will notice that yield and price are negatively correlated to one another. For newbies, this will help you to internalize the fact that as bond prices head up, yield decreases and vice versa.

Let's go back to actually getting the data that is required to plot our yield curve. Let's leave the Year/Month/Frequency as it currently is (2017, Jan, 2018, Jan, Yearly). Next, select the checkboxes of "2-Year Bond Yield", "5-Year Bond Yield", "10-Year Bond Yield", "20-Year Bond Yield", and "30-Year Bond Yield." (I am following the recommendations of an Investopedia article here). Click on the "Download" button, download the file, and open the file with a spreadsheet program like Microsoft Excel.

singapore yield curve data

You will end up with the above dataset. If you had chosen to display the dataset on SGS website instead of downloading it, you will realize that the time-related variables refer to the end of the period. Hence, in our above screenshot, year 2017 (row 6, column A) refers to the end of 2017 while year 2018 (row 7, column A) refers to the end of 2018. As 2018 has just started, it would most probably refer to the current yield. Columns B, C, D, E, and F reflects the yields of the 2-Year, 5-Year, 10-Year, 20-Year, and 30-Year bonds, respectively.

sg yield curve data

Highlight the data, navigate to the "Insert" tab, and select the "Line" graph option.

singapore yield curve

And there you have it. Two yield curves, with the 2017 and 2018 referring to the end of 2017 and current yield in 2018 (26 January 2018), respectively. Do note that yield curves are static snapshots, much like your balance sheet.

As for interpreting yield curves, do refer to this article by Investopedia.

Cheers!

No comments:

Post a Comment