## Binomial Pricing Trees in R

Binomial Tree Simulation The binomial model is a discrete grid generation method from \(t=0\) to \(T\). At each point in time (\(t+\Delta t\)) we can move up with probability \(p\) and down with probability \((1-p)\). As the probability of an … Continue reading →

## Universal portfolio, part 6

June 10, 2012
By

The final table in Universal Portfolios introduces leverage.  It indirectly also shows the dangers of rebalancing on margin, while Kin Ark increases 4.2 times, at 50% margin it goes to nothing.The code below reproduces Table 8.4, again a...

## R becomes a critical tool in government departments

June 10, 2012
By

Situation and Outlook for Primary Industries (2012) just published by New Zealand’s Ministry for Primary Industries (click to download page) demonstrates well that R is a limitless tool for analysis and graphing, and the capability of using R is growing in … Continue reading →

## An R function for finding coordinates of NZ localities

June 10, 2012
By

Over the course of my PhD, I will be doing a fair amount of georeferencing. This involves obtaining geographic coordinates for localities where weevil specimens have been collected. When I'm the one who has collected them, this is fairly straightforward—Google Maps has made obtaining coordinates a breeze. When it's a museum specimen, however, things get a little tricky....

## R/Python Web Apps

June 10, 2012
By

I have a little delinquent on this whole blogging thing but here is a talk I gave to the DC R Group. On a twisted and Rpy2 web application framework that I built for my company. Enjoy http://bit.ly/NW0Neg J

## FloraWeb Plant Species Report via R

June 10, 2012
By

For German-spoken users I added the function floraweb_scrape.R that allows you to conveniently collect species data and print to a PDF-file (see this example output). The function accesses data provided by the  web-site FloraWeb.de (BfN - Bundesministerium für Naturschutz).You can use it as an interactive version (RTclTk) which I have put to a Github repository

## Classifying the UCI mushrooms

In my last post, I considered the shifts in two interestingness measures as possible tools for selecting variables in classification problems.  Specifically, I considered the Gini and Shannon interestingness measures applied to the 22 categorical mushroom characteristics from the UCI mushroom dataset.  The proposed variable selection strategy was to compare these values when computed from only edible mushrooms...

## Testing recommender systems in R

June 10, 2012
By
$Testing recommender systems in R$

Recommender systems are pervasive. You have encountered them while buying a book on barnesandnoble, renting a movie on Netflix, listening to music on Pandora, to finding the bar visit (FourSquare). Saar for Revolution Analytics, had demonstrated how to get started with some techniques for R here. We will build some using Michael Hahsler’s excellent package

## Universal portfolio, part 5

June 9, 2012
By

The first three tables in Universal Portfolios presents the same information in numerical form as some of the plots.  The following code generates all three tables by defining a function then calling it with suitable parameters.  Th...

## ggplot2: Creating a custom plot with two different geoms

June 9, 2012
By

This past week for work I had to create some plots to show the max, min, and median of a measure across the levels of a qualitative variable, and show the max and min of the same variable within a … Continue reading →

## LondonR meeting (June 19th)

June 9, 2012
By

Mango Solutions announces the next LondonR meeting which will take place on June 19th. The meeting is free and open to anyone interested in R.  If you would like to attend please register in advance via email [email protected] Date:                     Tuesday 19th June 2012 Venue:                 The Counting House, 50 Cornhill, London, London EC3V 3PD (note change of usual...

## Rcpp vs. R implementation of cosine similarity

June 9, 2012
By

While speeding up some code the other day working on a project with a colleague I ended up trying Rcpp for the first time. I re-implemented the cosine distance function using RcppArmadillo relatively easily using bits and pieces of code I found scattered around the web. But the speed increase was not as much as I expected comparing the...

## I’m following you in Twitter…are you following me back?

If you spend some time on Twitter, you might have some followers and some people that you follow...the more time you spend, the more people you're going to interact with...Sometimes, you just realized that you're following some many people that might o...

## Project Euler — problem 8

June 9, 2012
By

The eight problem of Project Euler: Find the greatest product of five consecutive digits in the 1000-digit number. … The solution is as straightforward as the problem, although the 1000-digit number needs some format changes before product calculation. ?View Code … Continue reading →

## Converting Sweave LaTeX to knitr LaTeX: A case study

June 9, 2012
By

The following post documents the steps I needed to take in order to convert a project using Sweave LaTeX into one using knitr LaTeX. Additional Resources It is fairly straightforward to convert a document from Sweave LaTeX to knitr LaTeX. Yihui Xie on...

## NBA Playoffs Update 5 (5-4)

June 9, 2012
By

This is the sixth post in my series on predicting the NBA playoffs with an algorithm. After the Boston loss in their last game, the algorithm is now 5-4 in the playoffs. Hopefully it is correct tonight! Open Sourcing the CodeI have had a couple of re...

## Visualizing Euro 2012 with ggplot2

June 9, 2012
By

After scanning this paper by Zeileis, Leitner & Hornik, I thought it would be interesting to see how the victory odds for each team changes as Euro 2012 progresses. To do this, I am going to collect the daily inverse odds of a tournament victory offered by a popular betting site for each team. Here

## NBA Playoffs Update 5 (5-4)

June 9, 2012
By

This is the sixth post in my series on predicting the NBA playoffs with an algorithm. After the Boston loss in their last game, the algorithm is now 5-4 in the playoffs. Hopefully it is correct tonight! Open Sourcing the Code I have had a couple ...

## NBA Playoffs Update 5 (5-4)

June 9, 2012
By

This is the sixth post in my series on predicting the NBA playoffs with an algorithm. After the Boston loss in their last game, the algorithm is now 5-4 in the playoffs. Hopefully it is correct tonight! Open Sourcing the CodeI have had a couple of req...

## knitr Performance Report 4

June 8, 2012
By

please see knitR Performance Report 3 (really with knitr) and dprint, knitr Performance Report–Attempt 3, knitr Performance Report-Attempt 2 and knitr Performance Report-Attempt 1 Here is another iteration of the ongoing performance reporting attempt...

## OpenCPU at useR 2012

June 8, 2012
By

OpenCPU will be presented at useR 2012 in Nashville! Have a look at the abstract and the conference program. In the presentation we will introduce 3 inter-related projects which build on R: OpenCPU An open source framework for web development with R. Ohmage An open source system for large scale participatory sensing using mobile phones. ...

## Evaluation of Tactical Approaches

June 8, 2012
By

Tactical approaches are often chosen based on the best cumulative return which implicitly incorporates significant hindsight bias.  Just because an approach dominates for a period of time does not indicate that it will be the best approach.  ...

## R starter resources

June 8, 2012
By

I’m hardly the first person you would want to talk to about learning statistics in R. But if you’re bent on teaching yourself R, and you’ve ended up at my blog, here are some resources I found useful. (No opinions here about whether R is good/bad better/worse than Excel, Minitab, Matlab, Octave, SPSS, Stata, SAS,

## Data Mining with R

June 8, 2012
By

Earlier this week, Revolution Analytics' Joe Rickert gave a webinar Introduction to R for Data Mining. You can watch the replay below: If you're already familiar with R and the basics of data mining, you might want to skip ahead to the 13-minute mark where Joe's live demo begins. There you'll see practical examples of using R for decision...

## The world’s top seven airlines in the style of…

June 8, 2012
By

The world’s top seven airlines in the style of NASA’s earth at night. (via Mapping the World’s Biggest Airlines | Spatial Analysis)

## Reproducible Research Using Sweave and LaTeX

June 8, 2012
By

Here are the slides given during the Montreal R User Group workshop on April 30, 2012. RR-MtlRUsers.beamer

## RSMC 2011 Typhoon Tracks

June 8, 2012
By

While at Puerto Princesa Airport in Palawan and waiting for my flight back to Manila, I opened my laptop and started doing what I usually do (practice may skills in R) on my idle time. With some inspirations from spatialanalysis.co.uk, I tried to make ...

## R, the master troll of statistical languages

June 8, 2012
By

Warning: what follows is a somewhat technical discussion of my love-hate relationship with the R statistical language, in which I somehow manage to waste 2,400 words talking about a single line of code. Reader discretion is advised. I’ve been using R to do most of my statistical analysis for about 7 or 8 years now–ever