Publications by Brian Lee Yung Rowe
New version of R package futile released
The latest version of futile was released to CRAN yesterday. This release broke out the various functions into self-contained sub-packages with the base futile package hanging around as a wrapper to ensure loading of the most recent stable sub-packages (similar to the relationship that kde has to kdegraphics, kdepim, etc.). Current sub-systems av...
1218 sym 16 img
Duck typing with quantmod
This is a short example of using duck typing in a guard statement in the futile.paradigm. We are implementing a simple function to calculate the daily volatility of the returns with the help of quantmod. vol.symbol %when% (has.Cl(symbol)) vol.symbol <- function(symbol, window) { r <- Delt(Cl(symbol)) v <- rollapply(r, window, function(x) sd(x...
1708 sym R (495 sym/4 pcs) 16 img
R/Finance 2011
I will be speaking at R/Finance 2011 in Chicago at the end of April regarding the futile.paradigm, my R language extension for functional dispatching. The focus of the talk will be on why analytical applications are particularly suited to functional programming and how to leverage the futile.paradigm to achieve declarative code in R. My presentat...
811 sym 16 img
Calculating DV01 using futile.paradigm
Here’s a short example of using the futile.paradigm for calculating the DV01 of a bond. The basic idea is to layout the type definitions and then create the functions to do the calculations. require(futile.paradigm) create.Bond <- function(T, par, coupon, yield, periods, freq) { list(par=par, coupon=coupon, yield=yield, periods=periods, freq...
922 sym R (1100 sym/3 pcs) 16 img
Teaser: Running R as a map/reduce job from Riak
Alliterations aside, here is a preview of something I’ve been tinkering with. My goal is to be able to run R code as a phase within a Riak map/reduce job. In a multi-cultural world filled with distinct languages, it should be obvious that one size does not fit all. In the case of erlang, statistics is not its strong suit. Writing a sparse matri...
2094 sym R (688 sym/3 pcs) 16 img
Random matrix theory and APT’s daily global model
Someone emailed me recently and asked about how APT uses random matrix theory in their factor model. Another question I was asked is whether my package tawny could be used to replace APT or any other multi-factor model. The short answer is no. The slightly longer answer is that if you want to estimate a covariance matrix to use for portfolio opti...
2841 sym R (271 sym/2 pcs) 24 img
Penny pinching yields pennies
A Greek Professor of Economics has written up a thought-provoking series of articles on complexity fetishism. As part of his argument, Professor Varoufakis discusses the fallacy of using an analytic-synthetic approach to modeling economics. To highlight this problem, he presents an admittedly stylized example: Imagine a table piled up with ten th...
3230 sym R (123 sym/2 pcs) 20 img
What’s new in futile.paradigm 2.0.4
Well this certainly took a while but the latest installment of my functional dispatching library for R is finally released and pushed to CRAN. As a major point release, it has some breaking changes, although the older style of 1.x is supported via an option (more later). The 2.x series of futile.paradigm introduces a cleaner syntax that doesn’t...
2148 sym R (531 sym/5 pcs) 16 img
What’s new in futile.matrix 1.1.2
This is an exciting release of futile.matrix, which in some ways the package grows up and finds its purpose. It now includes a suite of functions for generating random matrices and can be used in conjunction with RMTstat. In short, futile.matrix has two purposes: Investigating the properties of random matrices Fitting distributions and finding t...
3367 sym R (1200 sym/4 pcs) 24 img
Zero rates with futile.paradigm
Here’s a short example of calculating zero rates and discount factors from cash rates using futile.paradigm. Of note is how type conversions are handled and how the core function implementation focuses strictly on the calculation while overloaded versions focus on the type conversions. discount_factor %when% (day.count %isa% Act360) discount_fa...
845 sym R (1613 sym/2 pcs) 16 img