[R-SIG-Finance] R / Risk measurement and the problem of data

Brian G. Peterson brian at braverock.com
Wed Jun 20 21:01:08 CEST 2007


Fabrice McShort wrote:
> Dear Experts,I come back to you for one question. 

Another poster has already given an opinion on the "from scratch" cost
including all data, etc.  I'll focus my remarks more on R, to try to
help you figure out what you may have the ability to build in-house and
what you may wish to source externally.

> We decided to use R Project for our risk management (reporting) 
> system. Because, our funds use derivative instruments, we will 
> need to use many packages such as 'Performance Analytics Package'
> 'VaR package' 'fOptions package', etc.

> So, my question is what type of database we will need?

There is a way of reading this question "what database platform should
we use?".  the answer to the platform question is that R can connect to
all modern SQL databases.  To contain the cost, you may wish to consider
MySQL, but any of the major commercial database engines would work as well.

Your question may also be read "what type of data do we need to store,
and what type of data model?"  This interpretation of your question is
more complex.

Clearly, you need instrument reference data, and historical
price/valuation data.  I would suggest that you develop your model data
fields (loosely) based on your input data.  Clearly, you need a place to
store any data that is relevant to your analysis.


> Bloomberg data, Bara data, Datastream, etc. 

I assume that you will already have subscriptions to this data.

There is a package RBloomberg, for getting data from Bloomberg, and
several discussions in the list archive here about using it.

For Barra data and Datastream, your approach will depend on how you get
the data.  Do you have a custom application and need to export it?  Is
it web page data with a login and password?  For data from subscription
websites, you could use get.hist.quote or curl to download the data
directly to R, or you could use some other language ranging from PHP to
Visual Basic to get the data and put it directly in your data model.

> Other point: Is the system (R) is able to use these principal 
> sources of data? This problem is very important in order
> to have a good estimation of the final cost of the system!

The data itself will be reformatted for access in your functions.  You
will download the data you need, and probably store it in your data model.

R can access the database, and can use RBloomberg or curl or
get.hist.quote-style download mechanisms to access the data from your
data sources.

> I will be happy to have your opinions about this point.Thanks!Fabrice

I hope this helps your thinking.

Regards,

    - Brian



More information about the R-SIG-Finance mailing list