[R-SIG-Finance] Réf. : Re: R-project and the risk measurement for mutual and hedge funds

Joshua Reich josh at gghc.com
Thu Jun 7 14:51:37 CEST 2007


The approach I take is somewhat similar. I am a big fan of PL/R (http://www.joeconway.com/plr/) which allows you to embed R code within SQL stored procedures in the Postgres database. This means I can do my analysis within the same database that stores our data. One can then use either R's charting packages or any other package that can talk to an ODBC datasource to make your charts.

Josh 

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Sylvain BARTHELEMY
Sent: Thursday, June 07, 2007 8:40 AM
To: 'R-SIG-Finance'
Subject: Re: [R-SIG-Finance]Réf. : Re: R-project and the risk measurement for mutual and hedge funds


A didn't know about this Sweave pack and it is a really interesting topic.

Another simple way to produce the report would be to store the quantitative results of your risk analysis in an Microsoft Access database (using the excellent RODBC package) and to create as many Access Reports as you need.
It is less 'elegant' than what explains Brian, but it can be done easily and it is very flexible.

---
Sylvain Barthélémy
Head of Quantitative Research, TAC
www.tac-financial.com | www.sylbarth.com


-----Message d'origine-----
De : r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] De la part de Brian G.
Peterson
Envoyé : jeudi 7 juin 2007 13:58
À : Fabrice McShort
Cc : R-SIG-Finance
Objet : Re: [R-SIG-Finance] Réf. : Re: R-project and the risk measurement for mutual and hedge funds

Fabrice McShort writes:
> Thanks for your help!
> 
> R project will enable me to have CVaR, Modified Sharpe Ratio, etc. 
> But, I guess that I cannot use R project to produce "automatically" 
> Risk management report and performance attribution for the funds. 
> Is it true? I will be happy to know what software is appropriated
 > for this task?
> 
> PS: I need to produce 500 risk management reports per month!!!
> 
> Thanks!

guillaume.nicoulaud at halbis.com wrote:
 > One convenient way to do that is to build a R - TeX architecture.
 > If your raw data is stored in a database you may build pdf reports  > for as many funds you want in just one click.
 > G


Giullaume is correct.  I'll provide a little more context.

The primary tool that you want is Sweave, which allows you to run R code from inside a LaTeX document.  This is straightforward, but I wouldn't call it simple if you're not familiar with LaTeX and as a newcomer to R.

I would recommend starting by choosing a LaTeX editor that can be used with Sweave, such as Lyx.  There are HOWTO's available online describing how to configure Lyx for use with Sweave.

Then, you'll construct your risk report.  Basically, I'd look at the charts and tables in the PerformanceAnalytics package for ideas on how you might build R functions to compile statistics you need for your report into tabular data and for charts that you may wish to display. 
Many of the charts and tables in PerformanceAnalytics may be appropriate starting places for your mutual fund reports because many of them were developed for analysis of portfolios of hedge funds. I also mention it because as one of the authors, I'm most familiar with it.

You'll probably want to use Lyx or some other LaTeX editor to help you lay out your Sweave document into a nice printable report structure.  As Guillaume mentioned, if your historical data is stored in a database, you can automate the task of loading the data and generating one report per fund.  If your historical data is in files or available via a web download interface, this could be automated also.  Ask the list if you run into specific problems on this that you are having trouble sorting through yourself.

Once you have a layout that works, running Sweave in an automated or semiautomated fashion for producing the reports is pretty straightforward.  There was an R News article specifically on this topic a while back that I'm sure a little Google searching could help you locate.

Hopefully this adds a little more context to Guillaume's suggestion. 
The list will be happy to help with specifics as you get closer.  Please consider sharing the LaTeX/noweb document that you develop with the community.  I'm sure others would benefit from your experience.

Regards,

    - Brian

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. 
-- If you want to post, subscribe first.

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. 
-- If you want to post, subscribe first.



More information about the R-SIG-Finance mailing list