| To: | <s-news@wubios.wustl.edu> |
|---|---|
| Subject: | a movjng average median |
| From: | "Leeds, Mark" <mleeds@mlp.com> |
| Date: | Mon, 20 Oct 2003 16:24:25 -0400 |
| Thread-index: | AcOXSCeB/Vmwp+KVRyyaZg+HLhMqLg== |
| Thread-topic: | a movjng average median |
|
does anyone have or
know of an easy way to calculate
the "windowLength" day moving
median given a vector of numbers.
one can use filter
to calculate the "windowLength" day moving average
as shown below but i
can't think of a good way to
do the
median.
"backwardsmovingaverage<-function(series,windowLength)
{
return(
c(filter( series, sides=1,
filter=rep(1/windownlength,windowlength))))
}
thanks.
mark
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: 1) Creating Tables in Splus 2) Looping, Spencer Graves |
|---|---|
| Next by Date: | Re: a movjng average median, Eric Zivot |
| Previous by Thread: | 1) Creating Tables in Splus 2) Looping, angela g. |
| Next by Thread: | Re: a movjng average median, Eric Zivot |
| Indexes: | [Date] [Thread] [Top] [All Lists] |