# Monthly Archives: October 2012

## Unit testing in R

October 23, 2012
By

Commentary R is a statistical programming language, with a strong focus on mathematical operations. When writing code that is math-heavy, unit testing becomes very appealing- while equations may look correct on paper, one minor error can ruin the output. R programming is also different to CRUD or enterprise software in that the R in-memory data

## Bayes for President!

October 23, 2012
By

I couldn't resist getting sucked into the hype associated with the US election and debates, and so I thought I had a little fun of my own and played around a bit with the numbers. [OK: you may disagree with the definition of "fun" $-$ but then again, i...

## analyze the general social survey (gss) with r

October 23, 2012
By

the general social survey (gss) has served as america's mood ring since 1972.  data-driven social scientists can compare political beliefs by demography, look at attitude trends, make emile durkheim and max weber (pronounced durk-veber) proud.&nbs...

## Benchmarking matrix creation

October 23, 2012
By

Sometimes it is useful to take a vector, or one column/row of a matrix, and build a new matrix of identical copies of that vector. There are lots of different ways to do this, but I just discovered a new, and very straightforward way to do this with m...

## The basics of Value at Risk and Expected Shortfall

October 23, 2012
By

Value at Risk and Expected Shortfall are common risk measures.  Here is a quick explanation. Ingredients The first two ingredients are each a number: The time horizon — how many days do we look ahead? The probability level — how far in the tail are we looking? Ingredient number 3 is a prediction distribution of … Continue reading...

## On Volatility Proxy

October 23, 2012
By

Volatility is unobserved. Hence we need to use observed quantity as a proxy. Every once in a while I still see people using squared daily return as a proxy. However, there is ample evidence that it is a bad one. … Continue reading

## Presidential Debates 2012

October 23, 2012
By

I have been playing with the beta version of qdap utilizing the presidential debates as a data set. qdap is in a beta phase lacking documentation though I’m getting there. In previous blog posts (presidential debate 1 LINK and VP … Continue reading

## It Takes 2 Lines of R Code to Discover Interesting Biology

October 23, 2012
By

The following biological phenomenon demonstrates just how elegant R code can be. In vertebrate genomes, a methyl group (-CH3) can be added to nucleotides. Such process of methylation is commonly associated with gene suppression. Most of the cytosines in the … Continue reading

## googleVis 0.3.0/0.3.1 is released: It’s faster!

October 23, 2012
By

Version 0.3.0 of the googleVis package for R has been released on CRAN on 20 October 2012. With this version we have been able to speed up the code considerably. The transformation of R data frames into JSON works significantly faster. The execution of the gvisMotionChart function in the World Bank demo is over 35 times...