> Ahh yes, this way is much slicker, thanks for the example.  I've
> updated the regression fit if anyone is interested:
>
> http://groups.google.com/group/jbooktrader/web/RegressionSlope.java
>
>

For better results, only calculate value when inside this:
if (historyList.size() > nDataPoints) {...}
Otherwise, the calculated slope would take some wild values when the number
of samples is low.



> Quick coding question here, is there any reason to use a linked list
> instead of array list here?  Probably not much of a difference, I
> would guess.
>
>
Removing the first element from an ArrayList is very expensive, because all
the other elements need to be shifted up. Removing the first element from a
LinkedList is cheap, because it simply moves the "head" pointer. On the
other hand, adding elements to LinkedList is probably slower than adding
elements to ArrayList. Best way to find out is to to time the same
optimization job with both ArrayList and LinkedList, and compare the
results.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"JBookTrader" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jbooktrader?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to