Monthly Archives: May 2011

Playing with robots

May 3, 2011
By
Playing with robots

My son would be extremely proud if I tell him I can spend hours building robots. Well, my robots are not as fancy as Dr Tenma's, but they usually do what I ask them to do. For instance, it is extremely simple to build a robot with R, to extract dat...

Read more »

Estimate Gene Diversity

May 3, 2011
By
Estimate Gene Diversity

I provide here an R function to estimate gene diversity of diallelic sites (e.g. SNPs), given allele frequencies at each segregating site. The function takes three input parameters: maf: a numeric value (or vector) representing minor allele frequency at each site. Default is 0.5 nreads: size of each resampling experiment. Default is 10000. nreplicates: Number

Read more »

Loops, Conditionals and Variables: A Basic Simulation in R

May 3, 2011
By
Loops, Conditionals and Variables: A Basic Simulation in R

In this post, I’m going to go over some basics of using conditionals and loops in R. I’ll expand on the example I use here in future posts. The conditionals and loops will be used to create some dummy eye movement data. Background Before I get into the actual code itself, I should probably explain

Read more »

R and the Data Science Toolkit

May 2, 2011
By
R and the Data Science Toolkit

I recently decided to present a talk to the Denver R Users Group (DRUG) on how to make an R package (May 17). There were only two problems: (1) I’ve never made a package and (2) I had nothing in mind … Continue reading →

Read more »

Another review of Introducing … R

May 2, 2011
By
Another review of Introducing … R

The March 2011 issue of JASA contains a review of Introducing Monte Carlo Methods with R by Hedibert Lopes. As in the previous review, the poor quality of the figures is (rightly) pointed out by Hedie. However, the main message of the review remains very positive and, furthermore, Hedie advertises the ‘Og itself in the

Read more »

Commodity Index Estimators

May 2, 2011
By
Commodity Index Estimators

In this post I will show my first try at a commodity index substitute.  Regular readers know my frustration with proprietary data as I try to demonstrate various techniques to users who might not have the resources to pay for the data.  I hav...

Read more »

Ecological SEMs and Composite Variables: What, Why, and How

May 2, 2011
By
Ecological SEMs and Composite Variables: What, Why, and How

I’m a HUGE fan of Structural Equation Modeling. Heck, I’ve even begun teaching short SEM workshops. (seriously, if you want, email me and we’ll talk). For those of you unfamiliar with the technique, it’s awesome for three main reasons. It’s a method of teasing apart direct and indirect interactions in your data. It allows you

Read more »

First Answer to My Own Question-Combine LSPM and Mahalanobis

May 2, 2011
By
First Answer to My Own Question-Combine LSPM and Mahalanobis

I first wanted to thank http://www.fosstrading.com for the very kind and unexpected mention over the weekend.  You will notice almost all of my code contains some credit to Foss Trading for the examples and great packages.  I hate that I coul...

Read more »

ARMA Models for Trading, Part III

May 2, 2011
By
ARMA Models for Trading, Part III

In the last post I showed how to pick the parameters for the ARMA model. The next step is to determine the position at the close. One way to do that is by a one day ahead prediction, if the prediction comes negative (remember the series we are operating on is the daily returns) then

Read more »

Commodities vs. commodity stocks

May 2, 2011
By
Commodities vs. commodity stocks