Category Archives: Data

Download and parse EDHEC hedge fund indexes

In our pre-conference workshop, Brian Peterson and I worked with the EDHEC hedge fund indexes as a way to demonstrate how to use PortfolioAnalytics within the context of long-term allocation problems.

Although they are not investible, these indexes are probably more representative than most given that they are, in fact, meta-indexes. Other indexes might be preferable when considering a specific portfolio, however.

Here’s how to parse the data. Unfortunately, there’s no good way to download the data directly (as far as I can figure), so you’ll have to have to log in (registration is free) and download the data manually. The code shown here only requires PerformanceAnalytics.

Here’s a parser for once you have the history.csv file in a local directory.
Continue reading

Download and Parse NAREIT Data

This is the first post of a series that describes how to download and parse specific data sets into R. These kinds of scripts can be functionalized further, but I doubt that these will ever find their way into a formal package. They are intended to be helpful to those facing similar tasks, but as demonstration scripts they will not be supported.

This is a script for downloading and parsing a monthly total return series of the FTSE NAREIT U.S. Real Estate Index. The spreadsheet can be downloaded from their website manually, but as you will see later, we don’t have to. Download the spreadsheet if you want to look at how it is structured.

This script can be found in the /inst/parser directory of FinancialInstrument on R-Forge.

After I parse the data, I want to store it and make it available for other R sessions to use. To do that, I’m going to use FinancialInstrument to register the location of the data so that I can retrieve it with getSymbols, much like I might do to retrieve data from Yahoo.

Let’s take a look at the script…
Continue reading