# Monthly Archives: August 2013

## Golf Scramble Simulation in R

August 14, 2013
By

Golf Scramble Simulation Golf Scramble SimulationThis is a simulation of a standard best-ball golf scramble. Conventional wisdom has it that the best golfer (A) should hit last, the idea being that one of the lesser golfers may have a decent shot already so the...

## 7Twelve Back-test

August 14, 2013
By

I recently came across the The 7Twelve Portfolio strategy. I like the catchy name and the strategy report, “An Introduction to 7Twelve.” Following is some additional info about the The 7Twelve Portfolio strategy that I found useful: On Israelsen’s 7Twelve Portfolio The 7/12 Allocation Today I want to show how to back-test the The 7Twelve

## The stats of Australian Rules Football

August 14, 2013
By

Australian Rules Football (AFL) isn't what Americans know as football. Nor is it what Europeans know as football (and the rest of the world calls soccer). Nor is it rugby. Here's what AFL looks like: As a unique game in its own right, it deserves its own kind of data analysis, and the blog MAFL online has it covered....

## Fun with R and HMM’s

August 14, 2013
By

I’m always intrigued by techniques that have cool names: Support Vector Machines, State Space Models, Spectral Clustering, and an old favorite Hidden Markov Models (HMM’s). While going through some of my notes, I stumbled onto a fun experiment with HMM’s … Continue reading →

## Using Emacs and ESS to edit bash shell scripts

August 14, 2013
By

I just found an emacs script that allows ESS-like behavior while interacting with a shell process.  So you can edit a shell script and run lines/regions just like you are used to while working R (or other languages).   You just need to copy t...

## Shiny

August 14, 2013
By

I’ve been learning about some new data visualisation tools in R. My three favourite so far are GoogleVis, rCharts and Shiny. Here is a Shiny app I made showing the monthly employment flows of the Australian labour force.

## gridSVG Multi-line Data Bind with d3–US Treasury Yields

August 14, 2013
By

If you have not read the other posts on gridSVG and d3, I recommend reading those before progressing to this one. Facets or strips are one of my favorite features of lattice and ggplot2, so of course I want to extend our d3 reverse data bind to support these small multiples.  Let’s see one way of accomplishing...

## How do I re-arrange??: Ordering a plot revisited

August 14, 2013
By

Back in October of last year I wrote a blog post about reordering/rearanging plots. This was, and continues to be, a frequent question on list serves and R help sites. In light of my recent studies/presenting on The Mechanics of … Continue reading →

## predictNLS (Part 1, Monte Carlo simulation): confidence intervals for ‘nls’ models

August 14, 2013
By
$predictNLS (Part 1, Monte Carlo simulation): confidence intervals for ‘nls’ models$

Those that do a lot of nonlinear fitting with the nls function may have noticed that predict.nls does not have a way to calculate a confidence interval for the fitted value. Using confint you can obtain the error of the fit parameters, but how about the error in fitted values? ?predict.nls says: “At present se.fit

## Exposure as a possible explanatory variable

August 13, 2013
By
$Y_i$

Iin insurance pricing, the exposure is usually used as an offset variable to model claims frequency. As explained many times on this blog (e.g. here), and in my notes, if we have to identical drivers, but one with an exposure of 6 months, and the other one of one year, it should be natural to assume that, on average,...