Category Archives: R language

Some quibbles about “The R Book” by Michael Crawley

A friend recently bought The R Book and I said I would tell him of problems that I’ve noticed with it.  You can eavesdrop. Page 4 The word “library” is used instead of “package”.  This (common)  error substantially raises the blood pressure of some people — probably to an unwarranted extent. An R package is … Continue reading

Posted in Book review, R language | Tagged , | 10 Comments

Bear hunting

When were there bear and bull markets in US stocks since 1950? Smoothing While we’d really like to estimate the expected return at each point in time, finding bear markets is ambitious enough.  The plan starts by smoothing the daily returns through time, as in Figure 1. Figure 1: Smoothed returns with a 4 year … Continue reading

Posted in Quant finance, R language | Tagged , , | 1 Comment

Joy of Stats coming soon

The Joy of Stats really is a joy.  It will be shown on BBC4, apparently scheduled for December 7.  (That date comes from Hans Rosling on twitter, I haven’t found scheduling evidence at the BBC.) I saw its debut at the Royal Statistical Society on World Statistics Day. Here is a five minute excerpt: You … Continue reading

Posted in R language, Statistics | 8 Comments

Yet another inferno

Many from the R world will know The R Inferno. Abstract: If you are using R and you think you’re in hell, this is a map for you. A newly minted inferno is The 9 circles of scientific hell. Most amusing to me is Circle 4: p-value fishing, the punishment of which is brilliant. As … Continue reading

Posted in R language, Statistics | Leave a comment

Were stock returns really better in 2007 than 2008?

We know that the S&P 500 was up a little in 2007 and down a lot in 2008.  So on the surface the question seems really stupid.  But randomness played a part.  Let’s have a go at deciding how much of a part. Figure 1: Comparison of 2007 and 2008 for the S&P 500. Statistical … Continue reading

Posted in Quant finance, R language | Tagged , | 2 Comments

R is a name you need to know

As if that is news to some of you. Forbes has a Mean Business blog post by Steve McNally titled “Names You Need to Know in 2011: R Data Analysis Software”. The post includes several links to why R is wonderful. It also includes a pretty — but seemingly useless — statistical graph.  Correct me … Continue reading

Posted in R language, Statistics | 3 Comments

The ARORA guessing game

The game ARORA (A random or real array) is a website that gives you two time series at a time. Your job is to guess which series is real market data and which is permuted data.  It’s fun — try it. With some practice you will probably be able to guess which is which well … Continue reading

Posted in Fund management in general, R language | Tagged , , | Leave a comment

Ideas for World Statistics Day

World Statistics Day is 2010 October 20.  If you work with data or you should, then you are a statistician and this is a day for you. Try the Monty Hall problem on your mother. Start reading Bad Science.  I mean the book, but here’s the blog. Take a step towards breaking your spreadsheet addiction … Continue reading

Posted in R language, Statistics | Tagged | 5 Comments

American TV does cointegration

Fringe provides an excellent example of cointegration.  This is a television show in which there are two adjacent universes.  The universes are almost alike but not exactly. Now, everyone knows that history is chaotic.  If a butterfly does an extra flap of its wings, then that difference spreads out to change subsequent events everywhere.  But … Continue reading

Posted in Quant finance, R language | Tagged , , | 1 Comment

A tale of two returns

It was the best of times, it was the worst of times. As you may have guessed, this is a mashup of a novel by Charles Dickens and an explanation of financial returns. The key plot element of A Tale of Two Cities is that there are two men, Charles Darnay and Sydney Carton, who … Continue reading

Posted in Quant finance, R language | Tagged , , , , , , , , , , , , | 48 Comments