commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <stei...@yahoo.com>
Subject Re: [math][patch] New RollingUnivariateImpl
Date Fri, 16 May 2003 19:07:54 GMT

--- "O'brien, Tim" <tobrien@transolutions.net> wrote:
> On Fri, 2003-05-16 at 11:04, Mark R. Diggory wrote:
> > My implementation requires no such thing! ;-) 
> 
> My apologies.
> 
> > Look at it again, it "rolls" around the array simply
> replacing the last value in the window 
> > with the new value in the window and increments the
> index representing 
> > the beginning of the array (when this index reaches the
> end of the array 
> > it gets mod'ed to send it back to the beginning of the
> array. No 
> > elements "move". The array doesn't change size, this is
> an extremely 
> > efficient design.
> 
> It is.
> 
> > Don't get me wrong, but doesn't your implementation
> actually produce an 
> > array that has an unused portion at the beginning?
> 
> See ContractableDoubleArray, storage is reclaimed when
> the internal
> storage exceed the number of elements by the factor
> defined in
> contractionCriteria.
> 
> > I don't see where storage is reclaimed at the beginning
> of the array 
> > because you always copy the array starting at 0. 
> 
> Again, check out ContractableDoubleArray - the contract
> function takes
> care of reclaiming unused space, only if the criteria are
> met.  If your
> contractionCriteria is 2.0, and you have 100 elements,
> you are
> gauranteed that the internal storage array will be
> between 101 and 200
> in length.  Then benefit here is that, memory is
> reclaimed only once
> every one hundred "rolls".
> 
> > I think it really may be wiser to separate the
> functionalities of 
> > Rolling and Expanding, At least until theres a clear
> methodology for the 
> > best implementation of each and a clear means of
> combining them.
> 
> Expandable and Contractable double arrays as a storage
> mechanism for
> Univariates provide a benefit in that they preserve the
> order of the
> values added to Univariate.
> 
> I t might be useful to have a FixedDoubleArray which
> supports the
> rolling functionality described in your patch, but, in
> general, these
> objects provide usefulness outside of Univariate. 
> Essentially, I don't
> want an implementation of Univariate to have to worry
> about storage.

I agree.  A simple FixedDoubleArray will enable the
"rolling" functionality to implemented simply. Computations
can be performed using standard array-based algorithms. 
Retaining the order is good for things like trending,
autocorellation. I also agree that this data structure will
be useful for other things.
> 
> > 
> > 
> > I'll chill now. Cheers,
> > Mark
> > 
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message