Blog Archives

How do I Create the Identity Matrix in R?

June 27, 2012
By
How do I Create the Identity Matrix in R?

I googled for this once upon a time and nothing came up. Hopefully this saves someone ten minutes of digging about in the documentation. You make identity matrices with the keyword diag, and the number of dimensions in parentheses. > diag(3) [,...

Read more »

An unabashedly narcissistic data analysis of my own tweets. The…

April 2, 2012
By
An unabashedly narcissistic data analysis of my own tweets.
The…

pie( table( whence.i.tweet )) qplot( whence ) + coord_polar() pie( log( table( whence )))+RColorBrewer ggplot (see below) plot( density( tweets.len )) qplot(... stat="density") + geom_density qplot(...stat="bin") + geom_text(...) tweeple tweep...

Read more »

Bare-bones intro to Plotting options in R

March 21, 2012
By
Bare-bones intro to Plotting options in R

If you’re using base::plot in R for the first time (for example if you do plot(pima) or plot(faithful) (use ??pima if you can’t find the dataset)) you may have looked at ?plot (2 page help file) or ?par (12 page help file) to figure out what’s go...

Read more »

How Not To Draw a Probability Distribution

March 7, 2012
By
How Not To Draw a Probability Distribution

If I google for “probability distribution” I find the following extremely bad picture: It’s bad because it conflates ideas and oversimplifies how variable probability distributions can generally be. Most distributions are not unimodal. Most dist...

Read more »

lembarrasduchoix asked: thank you for the introduction to…

March 6, 2012
By
lembarrasduchoix asked:
thank you for the introduction to…

lembarrasduchoix asked: thank you for the introduction to Newcomb’s paradox! Could you do a post on your favorite paradoxes?    The decision theory paradoxes I’m familiar with are: Ellsberg Paradox— Theorists encode bothsituations with unknown...

Read more »

"With the the increasing availability of complicated alternative investment strategies to both retail…"

December 10, 2011
By

“With the the increasing availability of complicated alternative investment strategies to both retail and institutional investors, and the broad availability of financial data, an engaging debate about performance analysis and evaluation is as import...

Read more »

"With the the increasing availability of complicated alternative investment strategies to both retail…"

December 10, 2011
By

“With the the increasing availability of complicated alternative investment strategies to both retail and institutional investors, and the broad availability of financial data, an engaging debate about performance analysis and evaluation is as import...

Read more »

Earthquakes

November 30, 2011
By
Earthquakes

> data(quakes)> head(quakes) lat long depth mag stations 1 -20.42 181.62 562 4.8 41 2 -20.62 181.03 650 4.2 15 3 -26.00 184.10 42 5.4 43 4 -17.97 181.66 626...

Read more »

Earthquakes

November 30, 2011
By
Earthquakes

> data(quakes)> head(quakes) lat long depth mag stations 1 -20.42 181.62 562 4.8 41 2 -20.62 181.03 650 4.2 15 3 -26.00 184.10 42 5.4 43 4 -17.97 181.66 626...

Read more »

Error Handling in Lyx & Sweave: using Quantmod (and R, of course)

November 8, 2011
By

I do reports for clients with LyX and Sweave. It took me an extremely long time to get them working, but now that they’re working I can do more in an hour and thus charge more per hour. (Which is, like, the point.) If you’re not familiar, here’s ...

Read more »