Monthly Archives: June 2013

The Fallacy of 1/N and Static Weight Allocation

June 18, 2013
By
The Fallacy of 1/N and Static Weight Allocation

In the last few years there has been a increasing tendency to ignore the value of a disciplined quantitative approach to the portfolio allocation process in favor of simple and static weighting schemes such as equal weighting or some type of adjusted volatility weighting. The former simply ignores the underlying security dynamics, assuming equal risk-return,

Read more »

Create SAS Code from R ‘tree’ Objects

June 18, 2013
By
Create SAS Code from R ‘tree’ Objects

I recently was faced with the desire to port some tree models developed in R to SAS so I could score a large database. To me this makes sense as SAS is better with large files (or at least so as not to offend anyone, I am better with large files in SAS). I started

Read more »

Printing R help files in the console or in knitr documents

June 18, 2013
By

Yesterday, I was creating a knitr document based on a script, and was looking for a way to include content from an R help file. The script, which was a teaching document, had a help() command for when the author wanted to refer readers to R documentation. I wanted that text in my final document, though. There’s no...

Read more »

Resources for getting started with R

June 18, 2013
By
Resources for getting started with R

As we believe you may know, we are having a webinar tomorrow (June 19th, 2013) on Predictive Analytics. During this webinar, you are going to be introduced to R, learn how to build a predictive model and also how to carry insightful analysis through visualization. As learning a new language can be a really difficult

Read more »

BCEA 1.3.0

June 18, 2013
By
BCEA 1.3.0

After months of work (although to be fair, we haven't worked 100% full time on this), Andrea and I are nearly ready to publish the next release of BCEA. Andrea has done a brilliant job and is responsible for most of the good new features (NB: see ...

Read more »

R GIS: Terrain Analysis for Polygons as Simple as it Gets!

June 18, 2013
By
R GIS: Terrain Analysis for Polygons as Simple as it Gets!

library(rgdal)library(raster)alt gadm gadm_sub plot(alt)plot(gadm_sub, add=T)asp slo > extract(slo, gadm_sub, fun = mean, na.rm = T, small = T, df = T) ID slope1 1 9.9590532 2 1.0474433 3 7.4561654 4 1.6737865 5 11.946553> extract(asp, gadm_sub, fun = mean, na.rm = T, small...

Read more »

The Green Number Effect

June 18, 2013
By
The Green Number Effect

Following up on a suggestion from my previous post, here are the statistics for medal count versus age. Every point on the plot is the number (see colour legend on right) of athletes who have achieved a given number of medals by a particular age. There is clear evidence of a Green Number Effect: many

Read more »

Quickly read Excel worksheets into R (Windows only…sorry)

June 18, 2013
By

I suppose most companies use the Microsoft Office suite of programs, and my office is no exception. It easy to import data from an API or a database into R, but importing data from an Excel workbook is a different story. There are a few R packages for reading Excel files, but I’ve had problems

Read more »

Job opening! Come work with us!

June 18, 2013
By

Postdoctoral position in statistical modeling of social networks A full-time postdoctoral position is available beginning Fall 2014 in the research group of Tian Zheng and Andrew Gelman working on statistical analysis and modeling of social network data, in close cooperation with our experimental collaborators. Four key papers of this project so far are: http://www.stat.columbia.edu/~gelman/research/published/overdisp_final.pdf http://nersp.osg.ufl.edu/~ufruss/documents/mccormick_salganik_zheng10.pdf The post Job...

Read more »

Use R to Bulk-Download Digital Elevation Data with 1" Resolution

June 18, 2013
By

Here's a little r-script to convenientely download high quality digital elevation data, i.e. for the Alps, from HERE:require(XML)dir.create("D:/GIS_DataBase/DEM/")setwd("D:/GIS_DataBase/DEM/")doc urls names for (i in 1:length(urls)) download.file(urls, names) # unzip all files in dir and delete them afterwardssapply(list.files(pattern = "*.zip"), unzip)unlink(list.files(pattern = "*.zip"))p.s.: Also check raster::getData which pulls SRTM data at 90m resolution for a location / region!

Read more »