FrozenQuant

In the far reaches of the North there lives a quant programming in R

banner

Principal Components Part Three

It’s hard to let a good thing go but this is the final post on PCA for a while. It’s about time…past time…you are thinking. There are still a couple of interesting things to explore and we can do so using R (of course!) along with the interest data we get from our friends at the St. Louis Fed. Being the giving person that I am, the code for this post is in this gist.

(31 May, 2016 - 4 min)

Principal Components Part Two

Everything is better with data, and a post on principal components is no exception. Principal components analysis is often used with interest rates and it is probably the most well-known example of where one can use the technique. But often the story ends with a justification of using shift/slope/curvature to describe yield curve movements and that’s it. Not today! Armed with R and some data, we’ll dive in deeper. The code in this post can be downloaded from this gist, where it’s a little better organized.

(30 Apr, 2016 - 7 min)

Principal Components Part One

This post lets me combine a few of my favorite things: Interest rates, the singular value decomposition, eigen-things and maybe something from Attilio Meucci’s book Risk and Asset Allocation. Not to mention principal components analysis. I find most descriptions of PCA to be confusing, and that most authors do not try to convey an intuitive explanation of the concept. What’s different about this post? My goal is to try to explain the topic using data (i.

(22 Mar, 2016 - 5 min)

A Different Kind Of Value

Viktor Frankl is my favorite existentialist. Why? Because he talked about work and suffering a lot? Because he made it through a concentration camp with a constructive view of humanity and its potential to achieve value? For whatever reason, I recently picked up my yellowed copy of The Doctor and the Soul, which has passages underlined in several colors of pen, a worn spine and many dogeared pages. A few of his words are apropos as ever.

(1 Jan, 2016 - 2 min)

Treasury Rates and Nominal GDP

Back when I started in fixed income there was a saying that rates (meaning the 10-year Treasury rate) follow nominal GDP. Even though this isn’t good for short-term prediction because the variation can be significant, GDP is published with revisions, etc. I still like the idea that rates will account for inflation plus some premium for letting the USA borrow the valuable commodity called money. It also makes sense to me that the amount of the premium would vary with the overall health of the economy, so that when things are great the compensation is larger and when things are slow, much less.

(28 Feb, 2014 - 2 min)

Visiting the Asset Liability Efficient Frontier

This post is a bad idea, a little like that last round of shots after a long night of drinking: probably doesn’t need to be done and likely to leave a bad impression somewhere. In this case, though, the harm is from posting something that is only interesting to a handful of people on Earth rather than getting lost on the way home from the bar. That said, I am interested in managing asset-liability portfolios and I recently re-read William Sharpe and Lawrence Tint’s 1990 paper called “Liabilities- A New Approach” where they lay out their formulas for the efficient frontier incorporating liabilities and discuss liability hedging credits, which are an adjustment to the efficient frontier due to the correlation of assets and liabilities.

(21 Jan, 2014 - 5 min)

Posting on WordPress from R: A Few Small Hurdles

In case it might help someone (or more likely, when I forget what I learned) here are a few things I picked up as I did the post below. I think it’s pretty cool that you can do this, and props to Yihui Xie, the author of knitr, and RStudio who have made R incredibly better. As Yihui documented in this post, the first step is to download the RWordPress package from Omegahat.

(27 Dec, 2013 - 2 min)

Using R Markdown to Monitor a Faber Strategy

Faber Strategy Monitor This post was created in R using Markdown and posted directly to WordPress. It creates a table of data and a set of price charts for tracking funds used in Mebane Faber’s trend following strategy. Data is gathered from Yahoo Finance using the API in the quantmod package, then rendered into a web page using RStudio and knitr, with the help of googleVis and ggplot2. This particular implementation of the Faber strategy comes from his book The Ivy Portfolio.

(26 Dec, 2013 - 3 min)

The Skinny Boxplot

Often when I look at a time series chart I want to know more about the distribution of the data. Sometimes it seems like the pattern jumps out at you but other times it’s hard to tell where the median is or how skewed the data is. I have gotten into the habit of putting a box plot next to the time series, but found that this was hard to do in R.

(14 Dec, 2013 - 3 min)