Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Creating a Moving Average Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51655] Re: Creating a Moving Average Function
  • From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
  • Date: Wed, 27 Oct 2004 23:43:41 -0400 (EDT)
  • References: <clnemu$obb$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Have a look at what ListCorrelate can do for you. Padding with zeros is only 
one of the possibilities that it can handle.

Steve Luttrell

"Gregory Lypny" <gregory.lypny at videotron.ca> wrote in message 
news:clnemu$obb$1 at smc.vnet.net...
> Hello Everyone,
>
> I'd like to create some custom moving average functions that retain the
> same length as the original series by padding the lost observations
> with zeros.  I can get the moving average part of the function to work
> but not the padding part.
>
> This part without padding works:
>
> MA[theSeries_, theWindowSize_] = MovingAverage[theSeries,
>     theWindowSize];
>
> But adding the padding causes it to fail:
>
> MA[theSeries_, theWindowSize_] = PadLeft[MovingAverage[theSeries,
>     theWindowSize], 1000];
>
> Any suggestions would be most appreciated.
>
> Greg
> 



  • Prev by Date: Re: Creating a Moving Average Function
  • Next by Date: Re: Re: More on Delete Problems
  • Previous by thread: Re: Creating a Moving Average Function
  • Next by thread: Re: Creating a Moving Average Function