Wednesday, April 23, 2014

All the Factors | More Looks

Well, my last post Exploring Factors with rCharts and factorAnalytics got enough attention to motivate me to pull in some more Asness, Frazzini, Pedersen factors and plot them in some different ways.  The additional factors are US and global UMD (up minus down) and QMJ (quality minus junk) introduced in this paper.

Quality Minus Junk

Asness, Clifford S. and Frazzini, Andrea and Pedersen, Lasse Heje

October 9, 2013

Available at SSRN:

I used rCharts and dimplejs to draw a cumulative line chart.

Then I thought this would be a great opportunity to use the correlation chart spawned by rCharts issue 381.


Of course the next step is to simply merge the BAB (Betting Against  Beta) factors from the previous post, but I’ll leave that to you.  Let me know what you discover.

Monday, April 21, 2014

Exploring Factors with rCharts and factorAnalytics

Fama and French changed the financial world with their factors in 1993.  Another duo Andrea Frazzini and Lasse Heje Pedersen have expanded our world with their Betting Against Beta (BAB) and Quality Minus Junk (QMJ)  factors.  The combined factor set of Fama/French and Frazzini/Pedersen provides substantial insight into the historical performance of equities in the US and around the world.

Fortunately for us, the authors have also made available their factors.  Unfortunately, BAB and QMJ are not updated like the Fama/French SMB and HML.  Still though, combining these factors with the R packages factorAnalytics and rCharts allows us to do some amazing things.  Here is a quick example. Look for more soon.

Tuesday, April 15, 2014

Wealth and Skill | A Talk to Students

I enjoyed talking to University of Alabama students this morning about wealth, skill, and luck.  I tried to synthesize a whole lot of research into something meaningful.  Of course, it would not have been possible without rCharts + Slidify.  Thanks Ramnath. Thanks to my good friend Dr. Underwood for the invitation. Click here or on the screenshot below for the show.


Friday, April 11, 2014

Find it Humorous … “Not So Bad” in the “long-term”

I agree the market selloff has been weak thus far (especially as a frustrated bear).  However, I find it humorous as some widely followed commentators say things like “You’re only down x% ytd.  It’s not that bad”.  I wonder if this selloff gets worse will they extend to a 12 month horizon since last year was so good.  Immediately makes me think of 1987.

  October 19, 1987 : Today was not so bad.  You are only down 3% ytd.


Edit:  Ok, I just had to add an interactive version:


Friday, April 4, 2014

R as a Publishing Engine | CPI Components Use Case

R was certainly not designed to be a publishing engine, but in my workflow, R is the primary method of content creation.  With that in mind, I have been thinking about a very different use case of rCharts in which we might want to include inflexible and not really reusable custom javascript components in our document.  As a quick example after updating my CPI component graph using d3.js and angular, I want to plug it into a document and really only need to modify a couple of parameters.  While someone might want to use this for different data, I doubt it.

rCharts seamless integration with knitr/slidify/Rpres makes this very easy.  I just wonder how popular this will become.


Wednesday, April 2, 2014

xts like endpoints in Javascript

I decided to promote this from a Twitter comment to a blog post.  I had hoped to do a prototype javascript interactive rebalancing visualization of Unsolved Mysteries of Rebalancing integrating this, but I have not had the time, so  I’ll release it into the wild in its current state.  I hope someone can use it.


Friday, March 28, 2014

Slopegraphs | rCharts –> maybe finance versions

Back in 2011, Charlie Park did two very thorough posts on Edward Tufte’s table graphics or slopegraphs.

These type graphics can provide very effective visualizations of finance and economic information.  For my first test though I will stick with cancer survivor data from this post Slopegraphs in R | James Keirstead.  We can use a dimplejs line chart from rCharts as our platform and add some javascript to do something similar.

If you know of any good finance or economics slopegraphs, please let me know and I might just try to recreate them.

Click here or on the image below to see the fully post


Tuesday, March 25, 2014

Interactive Discovery of Research Affiliates JoPM Paper

In my previous post More on Rebalancing | With Data from Research Affiliates , I did some really basic visualizations, but I thought this data would be great for some more powerful interactive discovery using an interesting javascript SQL-like query language objeq along with the d3.js charting library dimple.js.  Next, I hope to extend to use lodash or lazy.js.

This exercise helps me think through a couple of lingering issues:

  1. After we create the plot, do we need to maintain the overhead of a connection with R using something like shiny, or can we port some of the aggregation, filtering, and calculations to javascript as we did in this example?
  2. How can we use the rCharts templates with other languages such as Python, Ruby, and Javascript?
  3. What can we do with some more specific and customized page templates for rCharts?
  4. Is a Lyra-like interface better or will this type interface work for more advanced users?

Help me with your thoughts after you have played with the example shown by the screenshot below.image

Thursday, March 20, 2014

Is It Structurally Broke? bfast breakpoints

The R package bfast enthralls me.  I have posted 3 times on bfast but still did not understand the impact of the h parameter.  Armed now with some d3.js, angular.js, and rCharts I thought I could see it better with a fancy interactive visualization.  Here is the result when applied to the S&P 500 monthly price series since 1950.  You should see it embedded in an iframe below.  For the full effect, click here.

Friday, March 14, 2014

Bond Shop Views with dimplejs and rCharts

I saw this chart in a presentation and thought I could make it better and interactive.  Here is a short article on the iteration process.  Click on the screenshot below or here for the full post.

Note: these are not my views and this is not financial advice.  I did not name the original source of the graphic.  If you are the source, and you happen to see this, let me know if you would like me to name you.