2014 Winter Olympics: Home Court Advantage – Russia

August 22, 2012
By
2014 Winter Olympics: Home Court Advantage – Russia

"Russia is a riddle wrapped in a mystery inside an enigma."  -- Winston Churchill, radio address in 1939 A couple of weeks ago, Graph of the Week published an article describing the significant improvement in medals won by the host...

Read more »

London 2012 Olympics — world record in women 400-metre medley

August 22, 2012
By
London 2012 Olympics — world record in women 400-metre medley

I’ve been going through the medal statistics in London 2012 Olympics recently. I was planning to present some extra charts, such as medal-per-milli-population or medal-vs-GDP. However, it’s a little boring to present the same kind of charts. Thus, I’d like to look into some particular … Continue reading →

Read more »

Did the Kigadi Ebola outbreak threaten to become an (inter)national epidemic?

August 22, 2012
By
Did the Kigadi Ebola outbreak threaten to become an (inter)national epidemic?

We want to evaluate the seriousness of the threat posed by the recent ebola outbreak in western Uganda. The outbreak appeared in Kigadi, a small village in the Kibaale district. The disease was first confirmed by the government on 28 … Continue reading →

Read more »

What you get and what you should be getting: checking numerical code

August 22, 2012
By
What you get and what you should be getting: checking numerical code

Whenever I write numerical code I spend half my time debugging my algebra, painstakingly uncovering one sign mistake after another in my calculations. Usually I have computed by hand the gradient or the integral of some nasty function, and I have to check it against a

Read more »

ggplot2 maps with insets

August 22, 2012
By
ggplot2 maps with insets

Here's a quick demo of creating a map with an inset within it using ggplot. The inset is achieved using the gridExtra package. Install libraries, set directory, read file setwd("/Users/ScottMac/Dropbox/CANPOLIN_networks_ms/data") # change ...

Read more »

DataGotham

August 21, 2012
By

As some of you may know already, I’m co-organizing an upcoming conference called DataGotham that’s taking place in September. To help spread the word about DataGotham, I’m cross-posting the most recent announcement below: We’d like to let you know about DataGotham: a celebration of New York City’s data community! http://datagotham.com This is an event run

Read more »

ARMA Models for Trading

August 21, 2012
By
ARMA Models for Trading

In this tutorial I am going to share my R&D and trading experience using the well-known from statistics Autoregressive Moving Average Model (ARMA). There is a lot written about these models, however, I strongly recommend Introductory Time Series with R, which I find is a perfect combination between light theoretical background and practical implementations in

Read more »

Creating beautiful reports from R with knitr

August 21, 2012
By
Creating beautiful reports from R with knitr

People use the R language every day to create the elements of reports: tables, charts, analyses, and forecasts. But assembling all of that information into a print-ready document laid out with text can a hassle. You can cut-and-paste all of the elements into Word, but then what do you do when the data file gets updated at the last...

Read more »

Can Anyone Become a Data Scientist? Oxdata Believes So

August 21, 2012
By
Can Anyone Become a Data Scientist? Oxdata Believes So

Data science is a sophisticated and complex discipline, but since it's still an emerging field, its practitioners come from a wide variety of backgrounds. Typically, though, a background in working with large data sets in a research setting is advantageous. This is why you may be mingling with a former physicist or immunologist at the next data hackathon...

Read more »

London 2012 Olympics — Medals per event

August 21, 2012
By
London 2012 Olympics — Medals per event

It’s almost midnight. Before I go sleeping, I’d like to post the chart about ”medals per event” on 2012 Olympics. As some visitors suggested, I searched for the competition information for each athlete. Finally, thankful to the mighty Guardian datablog, I find the … Continue reading →

Read more »

My #ACSPhilly #skolnik2012 slides for “Semantic pipelines to molecular properties”

August 21, 2012
By

(This article was first published on chem-bla-ics, and kindly contributed to R-bloggers) To leave a comment for the author, please follow the link and comment on his blog: chem-bla-ics. R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics...

Read more »

Sigma motion visual illusion in R

August 21, 2012
By
Sigma motion visual illusion in R

Michael Bach, who is a professor and vision scientist at the University of Freiburg, maintains a fascinating site about visual illusions. One visual illusion really surprised me: the sigma motion. The sigma motion displays a flickering figure of bla...

Read more »

Adaptive Asset Allocation – Sensitivity Analysis

August 20, 2012
By
Adaptive Asset Allocation – Sensitivity Analysis

Today I want to continue with Adaptive Asset Allocation theme and examine how the strategy results are sensitive to look-back parameters used for momentum and volatility computations. I will follow the sample steps that were outlined by David Varadi on the robustness of parameters of the Adaptive Asset Allocation algorithm post. Please see my prior

Read more »

Getting Started with R and Hadoop

August 20, 2012
By
Getting Started with R and Hadoop

Last week's meeting of the Chicago area Hadoop User Group (a joint meeting the Chicago R User Group, and sponsored by Revolution Analytics) focused on crunching Big Data with R and Hadoop. Jeffrey Breen, president of Atmosphere Research Group, frequently deals with large data sets in his airline consulting work, and R is his "go-to tool for anything data-related"....

Read more »

plot.xts with Moving Average Panel

August 20, 2012
By
plot.xts with Moving Average Panel

(for all plot.xts posts, see http://timelyportfolio.blogspot.com/search/label/plot.xts) As another example of all that we can do with the new plot.xts, let’s try to do a price plot with a moving average overlays.  We will use the ETFs shown by M...

Read more »

Welcome Hadley, Winston, and Garrett!

August 20, 2012
By
Welcome Hadley, Winston, and Garrett!

RStudio’s mission from the beginning has been to create powerful tools that support the practices and techniques required for creating trustworthy, high quality analysis. For many years Hadley Wickham has been teaching and working on his own set of tools for R with many of the same core goals. We’ve been collaborating quite a bit

Read more »

Halo Effects and Multicollinearity: Separating the General from the Specific

August 20, 2012
By
Halo Effects and Multicollinearity: Separating the General from the Specific

In the last post, The Relative Importance of Predictors, I showed how difficult it can be to assess the independent contribution that each predictor makes to the overall R-squared when the predictors are highly correlated.  We spent some time looking at one example where the predictors were ratings from an airline satisfaction study.  As is common in such studies,...

Read more »

Mid-August flotsam

August 20, 2012
By
Mid-August flotsam

Reached mid-semester point, with quite a few new lectures to prepare. Nothing extremely complicated but, as always, the tricky part is finding a way to make it meaningful and memorable. Sometimes, and this is one of those times, I sound … Continue reading →

Read more »

Another comparison of heuristic optimizers

August 20, 2012
By
Another comparison of heuristic optimizers

A herd of heuristic algorithms is compared using a portfolio optimization. Previously “A comparison of some heuristic optimization methods” used two simple and tiny portfolio optimization problems to compare a number of optimization functions in the R language. This post expands upon that by using a portfolio optimization problem that is of a realistic size … Continue reading...

Read more »

Heatmap tables with ggplot2

August 20, 2012
By
Heatmap tables with ggplot2

I wrote before about heatmap tables as a better way of producing frequency or other tables, with a solution which works nicely in latex. It is possible to do them much more easily in ggplot2, like this library(Hmisc) library(ggplot2) library(reshape) data(HairEyeColor) P=t(HairEyeColor) Pm=melt(P) ggfluctuation(Pm,type="heatmap")+geom_text(aes(label=Pm$value),colour="white")+ opts(axis.text.x=theme_text(size = 15),axis.text.y=theme_text(size = 15)) Note that ggfluctuation will also take … Continue reading...

Read more »

R for Dummies

August 20, 2012
By

The book R for Dummies was released recently, and was just reviewed by Dirk Eddelbuettel in the Journal of Statistical Software. Dirk is an R luminary, creating such fantastic works as Rcpp. R for Dummies seems to have beaten Dirk's natural disinclination to like anything with "for Dummies" appended to it, receiving a pretty positive review. Here is the last bit: "R

Read more »

Flat forecasts

August 19, 2012
By

About once a week someone will tell me there is a bug in my forecast package for R because it gives forecasts that are the same for all future horizons. To save answering the same question repeatedly, here is my response. A point forecast is (usually) the mean of the distribution of a future observation in the time series,...

Read more »

Using paste( ) to read and write multiple files in R

August 19, 2012
By

This post is a quick tip on how to use the paste( ) function to read and write multiple files. First, let’s create some data. The next step is not necessary, but makes the subsequent code more readable. The following example is silly because you would rarely want to split your data as

Read more »

Horizon plots with ggplot2, sort-of

August 19, 2012
By
Horizon plots with ggplot2, sort-of

The Timely Portfolio blog via R-bloggers has recently published some interesting entries about the value of horizon plots for visual comparison of a number of time series. Very nice it looks too. You can read more about them here. The trick to understanding them is to imagine that each row was orginally a line chart … Continue reading...

Read more »

R for Ecologists: Putting Together a Piecewise Regression

August 19, 2012
By
R for Ecologists: Putting Together a Piecewise Regression

Piecewise regression comes about when you have ‘breakpoints’, where there are clearly two different linear relationships in the data with a sudden, sharp change in directionality. This crops up occasionally in ecology when dealing with, for example, species richness of understory plants … Continue reading →

Read more »

London 2012 Olympics — Medals per hundred players

August 19, 2012
By
London 2012 Olympics — Medals per hundred players

It’s the weekend. I just woke up from a nap. Got my mind freshed. I’d like to continue with my digging into the Olympics medal results. Today, I cited the number of participants from each country (see wikipedia). I want to see how … Continue reading →

Read more »

Linear regression in OpenBUGS

August 18, 2012
By

I always wondered why is it so difficult to find an OpenBUGS example of simple linear regression on the Web. Curiously, such example is even missing in the OpenBUGS help. The only nice example so far is in the book … Continue reading →

Read more »

Parallelization: Speed up Functions in a Package

August 18, 2012
By
Parallelization: Speed up Functions in a Package

Well I bought a new computer a month back (i7 8GB memory). Finally more than one core and a chance to try parallelization. I saw this blog post a while back and was intrigued and was further intriqued when I … Continue reading →

Read more »

Querying a database from within R

August 18, 2012
By
Querying a database from within R

For a while now I have been contemplating pulling data from our postgreSQL db directly from R, but just never actually pulled the trigger until today.  What I found was that it was a lot easier than I ever could have imagined.  My laptop was already on the VPN, so I decided to try it

Read more »