[R] Moving quantile()?

Rob Steele freenx.10.robsteele at xoxy.net
Thu Nov 26 23:01:09 CET 2009


Charles C. Berry wrote:
> On Thu, 26 Nov 2009, Rob Steele wrote:
> 
>> Is there a faster way to get moving quantiles from a time series than to
>> run quantile() at each step in the series?
> 
> 
> Yes.
> 
> Run
> 
>     help.request()
> 
> Since you have already done the first 4 items below (right?) you will
> answer 'y', but when you get to the fifth one (which you evidently have
> not done), you will have to answer 'n'.
> 
> ----
> 
> Checklist:
> Have you read the posting guide? (y/n) y
> Have you checked the FAQ? (y/n) y
> Have you checked An Introduction to R? (y/n) y
> Have you checked the NEWS of the latest development release? (y/n) y
> Have you looked on RSiteSearch? (y/n) n
> 
> ----
> 
> This will start a browser with the RSiteSearch URL loaded.
> 
> Now comes the tricky part --- you have to type something into the
> 'Query' box and then click on 'Search'. Perhaps
> 
>     moving quantiles
> 
> will work??
> 
> It did for me, and the function I found by that strategy seems to be
> faster than
> 
>     apply(embed(x[1:10000],100),1,quantile,.75)
> 
> by about 3 orders of magnitude.
> 
> HTH,
> 
> Chuck


runquantile() in library caTools.

Beautiful.  Thanks!  Btw, love your music.




More information about the R-help mailing list