[R] Moving quantile()?
Charles C. Berry
cberry at tajo.ucsd.edu
Thu Nov 26 21:38:53 CET 2009
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
>
> Thanks,
> Rob
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901
More information about the R-help
mailing list