Monthly Archives: April 2011

Schelling’s Neighborhood Model

April 30, 2011
By
Schelling’s Neighborhood Model

The New York Times has created a beautiful visualization of the Census Bureau's 2005-2009 American Community Survey data. The distribution of racial and ethnic groups in New York City is particularly fascinating:Chinatown appears in red toward the sou...

Read more »

Produce Authentic Math Formulas in R Graphics

April 30, 2011
By
Produce Authentic Math Formulas in R Graphics

I remember a few weeks ago, there was a challenge in the R-help list to make the prime symbol in R graphics. In LaTeX, we simply write $X'$ or $X^\prime$. R has a rough support for math expressions (see demo(plotmath)) and they are certainly unsatisfactory for LaTeX users. In fact we can write native LaTeX

Read more »

Hofstader’s Chaotic Sequence

April 30, 2011
By
Hofstader’s Chaotic Sequence

About a year ago I was reading Godel, Escher, Bach by Douglas Hofstadter. In a section on recursion he presents a sequence that he calls "A Chaotic Sequence" defined as:Q(n) = Q(n - Q(n - 1)) + Q(n - Q(n - 2)) for n > 2Q(1) = Q(2) =1It's sim...

Read more »

Visualizing Terrain Surface Indicies with Scaled Arrows

April 30, 2011
By
Visualizing Terrain Surface Indicies with Scaled Arrows

Hamish Bowman recently posted a new GRASS module (d.barb) that can be used to depict the direction and magnitude components of some vector (e.g. wind field) along a raster surface or at points in space. An example (c/o Hamish): read more

Read more »

Bootstrap Confidence Intervals for Diversity Indices

April 30, 2011
By
Bootstrap Confidence Intervals for Diversity Indices

Here's the bootstrap refinement of the normal asymptotic interval (Mills and Zandvakili, 1997; Dixon et al., 1987; Efron and Tibshirani, 1997) - where Diversity (div, g) is the Simpson Index calculated from the observed sample, k is the number boot...

Read more »

Produce Authentic Math Formulas in R Graphics

April 30, 2011
By
Produce Authentic Math Formulas in R Graphics

I remember a few weeks ago, there was a challenge in the R-help list to make the prime symbol in R graphics. In LaTeX, we simply write $X'$ or $X^\prime$. R has a rough support for math expressions (see demo(plotmath)) and they are certainly unsatisfac...

Read more »

Friday function triple bill: with vs. within vs. transform

April 29, 2011
By
Friday function triple bill: with vs. within vs. transform

When you first learnt about data frames in R, I’m sure that, like me, you thought “This is a lot of hassle having to type the names of data frames over and over in order to access each column”. library(MASS) anorexia$wtDiff <- anorexia$Postwt - anorexia$Prewt #I have to type anorexia how many times? Indeed, any

Read more »

Another Use of LSPM in Tactical Portfolio Allocation

April 29, 2011
By
Another Use of LSPM in Tactical Portfolio Allocation

After the slightly unconventional use of LSPM presented in Slightly Different Use of Ralph Vince’s Leverage Space Trading Model, I thought I should follow up with something that more closely resembles my interpretation of Ralph Vince’s book. LSPM s...

Read more »

Rcpp Workshop slides

April 29, 2011
By

Dirk and I gave a full day Rcpp workshop yesterday in Chicago before the R in Finance conference. The pdfs of the slides are available here: part 1 (intro), part 2 (details), part 3 (modules) and part 4 (applications)

Read more »

Rcpp Workshop slides

April 29, 2011
By

Dirk and I gave a full day Rcpp workshop yesterday in Chicago before the R in Finance conference. The pdfs of the slides are available here: part 1 (intro), part 2 (details), part 3 (modules) and part 4 (applications)

Read more »