Re: Moving Window Function

2009-06-24 Thread Rich Hickey
On Wed, Jun 24, 2009 at 2:20 AM, Christophe Grand wrote: > On Tue, Jun 23, 2009 at 11:59 PM, Daniel Lyons > wrote: >> >> But if I try it with your original number (10x bigger than mine) I run out >> of Java heap space. Which didn't happen before either, because the lists >> weren't materialized.

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
On Tue, Jun 23, 2009 at 11:59 PM, Daniel Lyons wrote: > > But if I try it with your original number (10x bigger than mine) I run out > of Java heap space. Which didn't happen before either, because the lists > weren't materialized. > > So range is cheating here? How's that? > Range, like most sp

Re: Moving Window Function

2009-06-23 Thread Daniel Lyons
On Jun 23, 2009, at 2:38 PM, Christophe Grand wrote: > On Tue, Jun 23, 2009 at 9:14 PM, Daniel Lyons > wrote: > > Wish it were so, because I like your theory better than my reality: :) > > > Drat! Stupid reality! > > Now I have to bend it to make my theory valid. > > range is wily, it bit me b

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
On Tue, Jun 23, 2009 at 9:14 PM, Daniel Lyons wrote: > > Wish it were so, because I like your theory better than my reality: :) > Drat! Stupid reality! Now I have to bend it to make my theory valid. range is wily, it bit me before. It's a specialized seq. Can we try with a regular lazy-seq?

Re: Moving Window Function

2009-06-23 Thread Daniel Lyons
On Jun 23, 2009, at 12:41 PM, Christophe Grand wrote: > On Tue, Jun 23, 2009 at 8:02 PM, Daniel Lyons > wrote: > > > On Jun 23, 2009, at 11:37 AM, Kyle Schaffrick wrote: > > > As an aside, I also notice you prefer 'reduce to 'apply when using > > arithmetic functions, yet I've seen both in the

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
Hi Kyle! On Tue, Jun 23, 2009 at 7:37 PM, Kyle Schaffrick wrote: > But, I still sometimes find it challenging to spot patterns that can be > replaced and simplified with HOFs and other functional idioms, [...] > > I wonder if anyone has a guide or tips or rules of thumb to help with > this, or i

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
On Tue, Jun 23, 2009 at 8:02 PM, Daniel Lyons wrote: > > > On Jun 23, 2009, at 11:37 AM, Kyle Schaffrick wrote: > > > As an aside, I also notice you prefer 'reduce to 'apply when using > > arithmetic functions, yet I've seen both in the wild. I'm just > > guessing > > you prefer to make it explici

Re: Moving Window Function

2009-06-23 Thread Daniel Lyons
On Jun 23, 2009, at 11:37 AM, Kyle Schaffrick wrote: > As an aside, I also notice you prefer 'reduce to 'apply when using > arithmetic functions, yet I've seen both in the wild. I'm just > guessing > you prefer to make it explicit that you're doing a reduction, but I > wonder if one is better

Re: Moving Window Function

2009-06-23 Thread Kyle Schaffrick
On Tue, 23 Jun 2009 18:23:01 +0200 Christophe Grand wrote: > I think you could simplify your code by using map twice. What about: > (untested) > > (defn weighted-moving-average >"Generate a lazy sequence consisting of weighted moving averages >over the input sequence. The weighting is

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
> > On Mon, 22 Jun 2009 23:36:25 -0700 (PDT), Sean Devlin > > wrote: > > > Hey all, > > > Does anyone know of a moving window function? I'm curious if there > > > are any tools like this for digital signals processing, 30-day > > > moving averag

Re: Moving Window Function

2009-06-23 Thread Kyle Schaffrick
On Tue, 23 Jun 2009 10:20:52 -0400 Kyle Schaffrick wrote: > > On Mon, 22 Jun 2009 23:36:25 -0700 (PDT), Sean Devlin > wrote: > > Hey all, > > Does anyone know of a moving window function? I'm curious if there > > are any tools like this for digital signa

Re: Moving Window Function

2009-06-23 Thread Kyle Schaffrick
On Mon, 22 Jun 2009 23:36:25 -0700 (PDT), Sean Devlin wrote: > Hey all, > Does anyone know of a moving window function? I'm curious if there > are any tools like this for digital signals processing, 30-day moving > averages, etc. If you need weighted moving averages, this

Re: Moving Window Function

2009-06-23 Thread Sean Devlin
e > > On Tue, Jun 23, 2009 at 8:36 AM, Sean Devlin wrote: > > > > > Hey all, > > Does anyone know of a moving window function?  I'm curious if there > > are any tools like this for digital signals processing, 30-day moving > > averages, etc. > > > Se

Re: Moving Window Function

2009-06-23 Thread Christophe Grand
If understand what you are looking for, I think partition can be useful: (map avg (partition 30 1 daily-data)) Christophe On Tue, Jun 23, 2009 at 8:36 AM, Sean Devlin wrote: > > Hey all, > Does anyone know of a moving window function? I'm curious if there > are any tools like

Moving Window Function

2009-06-22 Thread Sean Devlin
Hey all, Does anyone know of a moving window function? I'm curious if there are any tools like this for digital signals processing, 30-day moving averages, etc. Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G