[R-SIG-Finance] Ranking XTS based on quantiles

Joshua Ulrich josh.m.ulrich at gmail.com
Thu Oct 31 13:22:01 CET 2013


On Thu, Oct 31, 2013 at 6:39 AM, Raghuraman Ramachandran
<optionsraghu at gmail.com> wrote:
>
> R GuRus
>
> I have an xts object called vols
>
> head(vols)
>                 [,1]
> 2011-07-12 0.2985884
> 2011-07-13 0.2873109
> 2011-07-14 0.2780244
> 2011-07-15 0.2739429
> 2011-07-18 0.2609898
> 2011-07-19 0.2868996
>
> and I wanted to have a column next to each in everyrow that ranks the vols
> based on quantiles.
>
You haven't provided enough information. For a given row, which
observations do you want to use to calculate quantiles?  Please
provide a minimal reproducible example and the output you expect.

> quantile(vols)
>        0%       25%       50%       75%      100%
> 0.0562344 0.1536431 0.2194198 0.3043755 1.3428146
>
> Can you help please?
>
> Thanks
> Raghu
>

--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com



More information about the R-SIG-Finance mailing list