[R-sig-finance] Portfolio performance metrics/ratios

Sankalp Upadhyay sankalp.upadhyay at gmail.com
Mon Oct 10 23:28:13 CEST 2005


As I had written, these are portfolio performance metrics - those that
an investor or evaluator of a fund would calculate given the return
series. So in that sense there is not much statistics in it and
functions are standard and straight forward - this is the reason I
thought that some package must contain them,

Anyways, it is done now. e.g.

sortino <- function(returns, MAR = 0) {
	if (length (returns) <= 1) NA
	else mean (returns - MAR) / downDeviation(returns, MAR)
}

trackingError <- function (portfolio, benchmark) {
	if (length (portfolio) != length (benchmark)) NA
	else if (length (portfolio) <= 1) NA
	else sd (portfolio - benchmark)
}

informationRatio <- function (portfolio, benchmark) {
	if (length (portfolio) != length (benchmark)) NA
	else if (length (portfolio) <= 1) NA
	else mean (portfolio - benchmark) / trackingError (portfolio, benchmark)
}

In case anyone needs these let me know - there are a lot of them. I
can clean them up and send it,
Thanks for the help,

Sankalp

On 10/10/05, Spencer Graves <spencer.graves at pdf.com> wrote:
>           Have you considerred RMetrics (www.rmetrics.org)?  If yes, and if you
> would still like more help from this list, I suggest you review the
> Posting Guide for r-help (www.R-project.org/posting-guide.html) and
> submit a more specific question, preferably with some code that
> illustrates what you are trying to do and helps describe where you would
> like further assistance.
>
>           spencer graves
>
> Sankalp Upadhyay wrote:
> > Hi,
> >
> > I am looking for a package that can calculate portfolio performance
> > metrics and ratios from a time series of returns or asset values. Is
> > there such a package? one that can give comparison ratios with
> > benchmarks also?
> > The closest seems to be tseries that has maxdrawdown, sharpe and
> > sterling ratios. I have started writing own code based on that but
> > there are a lot of ratios and performance analysis metrics.
> > Am I missing some package that can help?
> >
> > Thanks,
> >
> > Sankalp
> >
> > _______________________________________________
> > R-sig-finance at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
> --
> Spencer Graves, PhD
> Senior Development Engineer
> PDF Solutions, Inc.
> 333 West San Carlos Street Suite 700
> San Jose, CA 95110, USA
>
> spencer.graves at pdf.com
> www.pdf.com <http://www.pdf.com>
> Tel:  408-938-4420
> Fax: 408-280-7915
>


--
--
Sankalp Upadhyay
Investment Analyst
Roulac Global Funds



More information about the R-sig-finance mailing list