## 2 dimensions of portfolio diversity

July 16, 2012
By

Portfolio diversity is a balancing act. Previously The post “Portfolio diversity” talked about the role of the correlation between assets and the portfolio.  The current post fills a hole in that post. The 2 dimensions asset-portfolio correlation Each asset in the universe has a correlation with the portfolio.  If there are any assets that have … Continue reading...

## Project Euler — problem 14

July 16, 2012
By

It’s Monday today! It’s work day! And I’ve already worked on computer for two hours. Time for a break, which is the 14th problem of Project Euler. The following iterative sequence is defined for the set of positive integers: n n/2 (n … Continue reading →

## Map biodiversity records with rgbif and dismo packages in R

July 15, 2012
By

In the earlier post we generated maps from GBIF biodiversity records using maps and ggplot2 packages. We used world map with country borders for that. Now we will generate maps with google maps as base layer using dismo package. Like earlier we download data for Danaus chrysippus from GBIF using occurrencelist function into a data

## Map biodiversity records with rgbif and dismo packages in R

July 15, 2012
By

In the earlier post we generated maps from GBIF biodiversity records using maps and ggplot2 packages. We used world map with country borders for that. Now we will generate maps with google maps as base layer using dismo package. Like earlier we download data for Danaus chrysippus from GBIF using occurrencelist function into a data

## A simple Approximate Bayesian Computation MCMC (ABC-MCMC) in R

July 15, 2012
By

Approximate Bayesian Computing and similar techniques, which are based on calculating approximate likelihood values based on samples from a stochastic simulation model, have attracted a lot of attention in the last years, owing to their promise to provide a general statistical technique for stochastic processes of any complexity, without the limitations that apply to “traditional”…

## Sourcing an R Script from Dropbox

July 14, 2012
By

Working on my R bootcamp materials and I thought it would be handy to get the bootcamp computers setup by sourcing an R script that will install all necessary non-core packages in it. The problem? How to deploy this script efficiently. A quick method w...

## Trends in AL run scoring (using R)

July 14, 2012
By

I have started to explore the functionality of R, the statistical and graphics programming language. And with what better data to play than that of Major League Baseball?There have already been some good examples of using R to analyze baseball data. The most comprehensive is the on-going series at The Prince of Slides (Brian Mills, aka...

## Visualization of a Twitter retweet network: art or useful data visualization?

July 14, 2012
By

This is a Twitter retweet network. When people tweet, they may get retweeted by other people, repeating the message for their followers to view. Each retweet is a one-way flow of information that links the first person to each person who retweeted them (forwarded the original tweet into their own network). So, in this visualization

## Expected Shortfall Portfolio Optimization in R using nloptr

July 14, 2012
By

I have previously done examples of QP optimization in for financial portfolios.  I am not a huge fan of variance optimization in finance.  Return distributions are not normal, are often skewed, and are usually leptokurtic.  In plain spea...

## Using R for classification in small-N studies

July 14, 2012
By

Rick Davies just wrote an interesting post which combined thoughts on QCA (and multi-valued QCA or mvQCA) and classification trees with thoughts on INUS causation and classification trees. The question was something like: how can we look at a small-to-medium set of cases (like a dozen or a hundred countries or development programs) and tease

## Using R for classification in small-N studies

July 14, 2012
By

Rick Davies just wrote an interesting post which combined thoughts on QCA (and multi-valued QCA or mvQCA) and classification trees with thoughts on INUS causation and classification trees. The question was something like: how can we look at...

## Linear programming in R: an lpSolveAPI example

July 14, 2012
By

First of all, a shout out to R-bloggers for adding my feed to their website! Linear programming is a valuable instrument when it comes to decision making. This post shows how R in conjunction with the lpSolveAPI package, can be used to build a linear programming model and to analyse  Read more »

## Linear programming in R: an lpSolveAPI example

July 14, 2012
By

First of all, a shout out to R-bloggers for adding my feed to their website! Linear programming is a valuable instrument when it comes to decision making. This post shows how R in conjunction with the lpSolveAPI package, can be used to build a linear programming model and to analyse its results. The lpSolveAPI package provides a complete implementation of the lp_solve...

## Smartphone operating system share mosaic plot

July 13, 2012
By

(This article was first published on Actuarially (Matt Malin), and kindly contributed to R-bloggers) Smartphone operating system share mosaic plot Author: Matt Malin The increasing dominance of smartphones across the market is a very common topic in technology and news sites, with analysis of operating system share and phone types often shown in the media. Stumbling across this article...

## Processing Public Data with R

July 13, 2012
By

I use R aplenty in analysis and thought it might be worthwhile for some to see the typical process a relative newcomer goes through in extracting and analyzing public datasets In this instance I happen to be looking at Canadian air pollution statistics. The data I am interested in is available on the Ontario Ministry

## Applications of R at Google

July 13, 2012
By

At a talk I saw at the useR!2012 conference last month, Googler Karl Millar estimated that there are at least 200 active R users at Google, plus another 300+ occasional users participating in Google's internal R support list. But what are all these Google employees doing with R? A post from the Google Research team published on Google+ yesterday...

## influence.ME updated to version 0.9

July 13, 2012
By

Influence.ME is an R extension package for R that provides tools for detecting influential data in multilevel regression models. It is developed by Rense Nieuwenhuis (that’s me), Manfred te Grotenhuis, and Ben Pelzer. Recently, a new version (0.9) was uploaded ...

## Analysing time course microarray data using Bioconductor: a case study using yeast2 Affymetrix arrays

July 13, 2012
By

A few years ago I was involved in analysing some time-course microarray data. Our biological collaborators were interested in how we analysed their data, so this lead to a creation of tutorial, which in turn lead to a paper. When we submitted the paper, one the referees “suggested” that we write the paper using Sweave;

## Dynamical systems: Mapping chaos with R

July 13, 2012
By
$Dynamical systems: Mapping chaos with R$

Chaos. Hectic, seemingly unpredictable, complex dynamics. In a word: fun. I usually stick to the warm and fuzzy world of stochasticity and probability distributions, but this post will be (almost) entirely devoid of randomness. While chaotic dynamics are entirely deterministic, their sensitivity to initial conditions can trick the observer into seeing iid. In ecology, chaotic

## Examples and resources on association rule mining with R

July 13, 2012
By

by Yanchang Zhao, RDataMining.com The technique of association rules is widely used for retail basket analysis, as well as in other applications to find assocations between itemsets and between sets of attribute-value pairs. It can also be used for classification … Continue reading →

## R for Ecologists: Making MATLAB-like Graphs in R

July 13, 2012
By

I’ve decided that my blog should become a brain dump for my experience/troubles/solutions to programming in R. I’ve met many people who want to learn but don’t have the time or patience to sit down and figure it out from … Continue reading →

## 1-Month Reversal Strategy

July 12, 2012
By

Today I want to show a simple example of the 1-Month Reversal Strategy. Each month we will buy 20% of loosers and short sell 20% of winners from the S&P 500 index. The loosers and winners are measured by prior 1-Month returns. I will use this post to set the stage for my next post

July 12, 2012
By

Conrad released version 3.2.4 of Armadillo yesterday. It contains a workaround for g++ 4.7.0 and 4.7.1 which have a regression triggered by the Armadillo codebase for small fixed-sized matrices. The corresponding RcppArmadillo package 0.3.2.4 arrived ...

## Napa Valley wine tasting map: interactive version

July 12, 2012
By

Got some great reactions to the Napa Valley wine tasting map made with the ggmap package I posted on Monday. A couple of people asked if similar maps could be made for other wine regions (like Australia's Hunter Valley, or the Walla Walla region in Washington): provided you have a list of winery addresses, tweaks to the same R...

## Using discrete-event simulation to simulate hospital processes

July 12, 2012
By

Discrete-event simulation is a very useful tool when it comes to simulating alternative scenario’s for current of future business operations. Let’s take the following case; Patients of an outpatient diabetes clinic are complaining about long waiting times, this seems to have an adverse effect on patient satisfaction and patient retention.  Read more »

## GenABEL: an annoying error after the import of PLINK data format

July 12, 2012
By

In the previous post we saw how much convenient could be GenABEL in the management of genotypic/phenotypic data. We introduced the import of genotypic data from an Illumina format file: > convert.snp.illumina(inf = "gen.illu", out = "gen.raw", strand = "file") … Continue reading →

## Creating Williams designs with even number of products

July 12, 2012
By

A Williams design is a special Latin square with the additional property of first order carry over (each product is followed equally often by each other product). In R the package crossdes can be used to create them. > williams(4)    &nbsp...