Showing posts with label dimple. Show all posts
Showing posts with label dimple. Show all posts

Friday, June 6, 2014

Dispelling Myths of Momentum | AQR Research Factory

In a recent working paper from the prolific AQR Research Factory, the authors seek to dispel ten common myths of momentum investing.  To their credit, they use the fine data publicly available from Kenneth French and use fairly simple metrics to make compelling arguments against the myths and for the momentum factor.  I replicated most of the calculations in R, and then in a blend of replication, summary, and discussion on process, used rCharts, Gmisc, and slidify to create the following writeup.  I hope others find it useful, and it serves a purpose much greater than a re-creation.

For another very detailed summary of the paper, see the post from Gary Antonacci of Optimal Momentum.

 

image

To make sure this gets seen by those who might not read the paper, I will copy the thanks section below.

Thanks specifically:

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: http://ssrn.com/abstract=2312432

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.

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.

http://charliepark.org/slopegraphs/

http://charliepark.org/a-slopegraph-update/

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

image

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

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.

image

Monday, January 27, 2014

Emerging Currencies with rCharts + FRED

I liked this chart a lot.

I thought I would show how we can semi-replicate it in R with rCharts.  Here it is with the currencies that are on FRED with dimplejs.

… and here with nvd3.

Code to replicate from Github Gist:

Tuesday, January 21, 2014

What Do the Odds Say? Buy Stocks Begin of Year?

At some point in 2013, I read (can’t remember where) that 2012 was a rare year for the S&P 500  where no day’s closing  price was lower than the closing price  for the first day.  So if you bought on the first day of 2012, you never had a loss for the entire year.  Well, the same thing happened 2013, so I just had to do some analysis.  Below is a dimple.js chart built using rCharts with the minimum close price for the year divided by the close price for the first day of that year.

data source: Yahoo! Finance, Standard & Poors

Wednesday, January 15, 2014

Popularity Contest

Although I am sure most of the bloggers that discuss R on R-bloggers are not all that concerned with popularity, I thought it would be interesting to analyze (with R and rCharts, of course) the popularity of these bloggers using Feedly’s API.

 

After building the chart, I got to thinking about these two excellent posts about the nature of blog popularity.

How many more R-bloggers posts can I expect? by Markus Gesmann

Blog posts' half life - why bother? by Bruce McPherson

Clearly not posting for a month (me) is not the way to fame and glory as Google search becomes the most common referrer.

image

Also, is Bruce McPherson onto something when he points out that the nature of a blog does not lend to permanence?  Should every blog, especially educational ones, also have a different view of the same content that lends itself better to permanence?

For those that missed me, I’m back.

R code to get Feedly API data and build dimplejs chart: Github repo

Thursday, October 24, 2013

ISO Popularity on Flickr Explore

Not finance, but I figured there might be some out there interested in the pictures from Flickr’s Explore.  In addition to amazing photography, there is an abundance of information.  In the short post below, I use R with rCharts, slidify, and Rflickr to take a look at the distribution of ISO speeds over the last 3 days' of pictures.

image

Wednesday, September 25, 2013

Ode to Systematic Clusters

Extending the d3 remixes of the fine work at Systematic Investor, I thought it woud be fun to do some dimple.js and nvd3 scatterplots of clusters of PIMCO mutual funds.  As always, I welcome thoughts, comments, and suggestions.  Click here or on the screenshot below.

screenshot

Thursday, September 12, 2013

rCharts | PerformanceAnalytics Tables + Systematic Investor Cluster

I thought a good extension of the last post d3-ify Systematic Investor Cluster Weight would be to analyze the returns with every table that PerformanceAnalytics offers.  Since d3 interactive charts are way more fun than tables, let’s plot each table with dimplejs and rCharts. Click here or on the screenshot below to see the result.

screenshot_return

Thursday, June 27, 2013

dimple d3 and rCharts

I put together a quick tutorial combining my two favorite things: finance and interactive visualizations.  I show how to use the new dimplejs d3 library with rCharts to create some nice interactive plots of US Treasury yield data.   A screenshot is below.  Go here for the tutorial and here for the code to reproduce.

image