**We think therefore we R**, and kindly contributed to R-bloggers)

Let me start by plotting the daily interest rates from the term structure starting February 2003.

Daily term structure rates |

Next we simply plot the monthly standard deviation of the interest rates by at different maturities.

Things are straightforward till now but when I plot the standard deviation of the interest rate spread things get a little strange. Well, to start with we know that spread is already a first differenced variable, in the sense that it is basically the difference between interest rate at 2 different maturities. So, apriori we would not expect it to be a non-stationary series. Let us examine how the plot of the interest rate spread volatility looks like. For simplicity and sake of exposition we plot only the (3-1) month spread volatility.

(3-1) month interest rate spread volatility |

Now this series turns out to be non-stationary when passed through the adf.test(). This counter-intuitive observation was difficult for me to digest so I delved into the problem to figure out what could possibly be going wrong. To start with my sample size was not very large (~90 obs) which could lead to the wrong rejection of the null of stationarity. Secondly, there is a structural change to be suspected in the series approximately near September 09. Now keeping this in mind when we ran the adf.test() for the sample before Sept’09 and after Sept’09, surprisingly, we find that both the samples are non-stationary. Looking at the plot one would not suspect such a result. From a casual visual inspection it seems that the series is stationary before Sept’09 but could be non-stationary post Sept’09. So to solve this puzzle, we break the sample into pre-Sept’09 and post Sept’09 and do some simple visualizations.

(3-1) month Interest rate spread volatility for the entire sample |

Now if we look at the adf.test() results the high p-value suggests that the series, both pre and post the break, is no where near to being an I(0) series.

Interest rate spread volatility for the split sample |

When we visualize the series pre and post break the intuition becomes clear as the movement of the series appear to be quite random and the constant mean property of a stationary series seems to be violated (Refer to this previous post for a similar discussion). The reason why a split sample visualization made more sense here was because the movements post Sept’09 were so large that the actual dynamics (which are actually quite random) were not visible in the same plot, thus giving the false impression of stationarity in the pre break period. However, this simple split sample visualization makes the results seem quite intuitive.

**leave a comment**for the author, please follow the link and comment on their blog:

**We think therefore we R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...