[R] TreynorRatio

R. Michael Weylandt michael.weylandt at gmail.com
Fri Nov 9 15:45:51 CET 2012


On Fri, Nov 9, 2012 at 8:35 AM, sheen maria <sheenmaria6 at gmail.com> wrote:
> Sir,
>   But in this price returns only the closing value (Cl(getsymbols("IBM"))
> i already refer the ?TreynorRatio
>
> But it not specify how to calculate the benchmark return.
> In this case what value i put as benchmark return series.
>

Please keep your replies on list.

You choose the benchmark -- no one else can. For most asset classes,
there are well-defined standards, but ultimately it's the analyst's
job.

To calculate returns, you can use the Return.calculate() function as
you did below.

Note however that you're misusing getSymbols. This would be better

getSymbols("SPY")
r = Return.calculate(SPY)

or this

g = getSymbols("SPY", auto.assign = FALSE)
r = Return.calculate(g)

Michael

>
>
>
> On Fri, Nov 9, 2012 at 1:32 PM, R. Michael Weylandt
> <michael.weylandt at gmail.com> wrote:
>>
>> On Fri, Nov 9, 2012 at 6:46 AM, sheenmaria <sheenmaria6 at gmail.com> wrote:
>> > i read about the performance analytics package
>> >   i have a doubt about the  TreynorRatio
>> >
>> > i have code
>> >
>> >  g=getSymbols("IBM")
>> >> c=Cl(g)
>> >> r=Return.calculate(c)
>> >> SharpeRatio.annualized(r)
>> >                                 IBM.Close
>> > Annualized Sharpe Ratio (Rf=0%) 0.3566339
>> >
>> >> TreynorRatio (ret)
>> > Error in inherits(x, "xts") : argument "Rb" is missing, with no default
>> >
>> > TreynorRatio give the error like this.
>> >   what value i give for the Rb field.  anyboday can help
>>
>> Type
>>
>> ?TreynorRatio
>>
>> to see the documentation. The Treynor ratio is a relative performance
>> metric, so you have to give a benchmark return series as well.
>>
>> Michael
>
>




More information about the R-help mailing list