[jira] [Updated] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2014-06-01 Thread Benedikt Ritter (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter updated LANG-1014:
--

Affects Version/s: (was: 4.0)

 Adding unwrap and unwrapFull methods to StringUtils
 ---

 Key: LANG-1014
 URL: https://issues.apache.org/jira/browse/LANG-1014
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/25



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2014-06-01 Thread Benedikt Ritter (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter updated LANG-1014:
--

Fix Version/s: Review Patch

 Adding unwrap and unwrapFull methods to StringUtils
 ---

 Key: LANG-1014
 URL: https://issues.apache.org/jira/browse/LANG-1014
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/25



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-01 Thread Venkatesha Murthy TS (JIRA)

 [ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Venkatesha Murthy TS updated MATH-1120:
---

Attachment: percentile-with-estimation-patch

As per earlier discussion ; was advised to take a look at the references for 
possible different types of computation and come up with a draft.

Here is what i have been thinking

There are atleast 9-10 documented approaches (from 
http://en.wikipedia.org/wiki/Quantile ) ofcomputing the percentile and the R 
statistical tool also has a reference implementation of these. All these 
strategies have provided formulaes for choice of the index of the array and an 
estimation technique to compute the estimation. 

These estimation tecniques can be turned in naturally as enum 
EstimationTechnique (R1, R2, etc. where R1,R2 are estimation types as 
elucidated in wikipedia) with the below funtions
int index( double pthQuantile, int N);
double estimate(double[] values, int[] pivotsHeap, double pos, int length)

In addition the Percentile class already does amedian of 3 based pivoting for a 
kth selection. Since pivoting is again a strategy; we could go for a pivoting 
strategy enum along with defaults to median of 3. Further Kth Selection logic 
can now be sub sumed inside the EstimationTechnique as estimate method.

Changes to Percentile:
-
Percentile has one or 2 more constructors to accommodate specifying 
EstimationTechnique during concstruction. The default estimation technique 
being the existing Percentile computation logic Which need not be specified and 
just the existing constructors willl work the same way as it used to be.

Remove the Kth selection private methods and move them under KthSelector class 
(a separate nested class). However medianOf3 is exposed as package level access 
and hence needs to be refactored to use KthSelector class. It could also be 
deprecated as the method is not strictly with percentile logic (as much as 
Kthselection)
Add 2 small methods to getWorkArray and Cached pivots that will need to be 
passed along to estimation tecnhique.

I agree with removing/my earlier suggestion on ExcelPercentile{Test} and would 
like to look foward with opinions on the new approach.

Please let know on the attached percentile-with-estimation-patch




 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: excel-percentile-patch, percentile-with-estimation-patch

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 I do have patch ready with small change needed in Percentile class and a new 
 ExcelPercentile class written with tests closely matching with that of 
 PercentileTest class.
 Please let me know if i could submit this as a patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-01 Thread Venkatesha Murthy TS (JIRA)

 [ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Venkatesha Murthy TS updated MATH-1120:
---

Description: 
The current Percentile implementation assumes and hard-codes the quantile pth 
position as 
p * (N+1)/100 and provides a kth selected value.
However if we need to verify compare/contrast with standard statistical tools 
such as say MS Excel; it would be good to provide an extensible way of morphing 
this selection of position than hard code.
For example in order to generate the percentile closely matching with MS Excel 
the position required may be [p*(N-1)/100]+1.

Please let me know if i could submit this as a patch.

  was:
The current Percentile implementation assumes and hard-codes the quantile pth 
position as 
p * (N+1)/100 and provides a kth selected value.
However if we need to verify compare/contrast with standard statistical tools 
such as say MS Excel; it would be good to provide an extensible way of morphing 
this selection of position than hard code.
For example in order to generate the percentile closely matching with MS Excel 
the position required may be [p*(N-1)/100]+1.

I do have patch ready with small change needed in Percentile class and a new 
ExcelPercentile class written with tests closely matching with that of 
PercentileTest class.
Please let me know if i could submit this as a patch.


 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: excel-percentile-patch, percentile-with-estimation-patch

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (COLLECTIONS-530) Rejecting items on predicate failure without throwing an Exception

2014-06-01 Thread Erik (JIRA)

[ 
https://issues.apache.org/jira/browse/COLLECTIONS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14015107#comment-14015107
 ] 

Erik commented on COLLECTIONS-530:
--

Thanks Thomas, I was not aware of that.
In that case, I agree that this feature should not be added to 
common-collections in the above form.

Alternatively I could write a FilteredCollectionBuilder class like so:

FilteredCollectionBuilderE builder = new 
FilteredCollectionBuilder(predicate);
builder.addIfPredicateAccepts(e);
builder.addAllAcceptedByPredicate(collection);
PredicatedListE list = builder.createPredicatedListFromAcceptedElements(new 
ArrayListE());
PredicatedSetE set = builder.createPredicatedSetFromAcceptedElements(new 
ArrayListE());

Would you be interested in that?

 Rejecting items on predicate failure without throwing an Exception
 --

 Key: COLLECTIONS-530
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-530
 Project: Commons Collections
  Issue Type: Improvement
  Components: List
Affects Versions: 4.0
Reporter: Erik

 The PredicatedList class doesn't allow entries that fail the predicate, but 
 throws an Exception on entry.
 The problem I have with this, is that it places the onus of filtering out 
 invalid entries on the caller.
 I typically add items in a loop. The item added is the result of a method 
 call (which returns null if it can't create one).
 This problem is so common for me that I have created my own FilteredList 
 class that simply ignores invalid entries.
 I would like the PredicatedList class to be capable of rejecting items 
 without throwing an exception.
 I don't mind writing the code for this, but there are a great many ways in 
 which this can be done.
 So I was wondering what the interface should look like.
 Separate FilteredList class.
 Works, but seems a little verbose for the purpose
 New factory method: filteredList(ListT list, Predicate? super T 
 predicate) 
 Nice and simple, but doesn't allow extension; other ways of dealing with 
 predicate failure.
 New factory method with enum: predicatedList(ListT list, Predicate? super 
 T predicate, PredicateFailEnum action)
 More verbose to use and adds an extra class, but allows more alternative ways 
 to deal with predicate failure.
 One more nice thing is that it might be less confusing, 
 because choosing between predicatedList and the above filteredList might not 
 be so obvious.
 New factory method with interface: filteredList(ListT list, Predicate? 
 super T predicate, PredicateFailInterface action)
 Complex, but the most flexible way of dealing with predicate failure.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (MATH-418) add a storeless version of Percentile

2014-06-01 Thread Phil Steitz (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14015162#comment-14015162
 ] 

Phil Steitz commented on MATH-418:
--

The last patch looks good to me, modulo a few typos in the javadoc that I can 
fix in the commit and converting the random data generation to use a fixed seed 
(we like to do that to avoid random test failures).

I will wait a day or two to see if there is other feedback; otherwise will 
commit.  Thanks for the patch!

 add a storeless version of Percentile
 -

 Key: MATH-418
 URL: https://issues.apache.org/jira/browse/MATH-418
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 2.1
Reporter: Luc Maisonobe
 Fix For: 4.0

 Attachments: 30-may-2014-418-psquare-patch, 418-psquare-patch, 
 psquare-patch


 The Percentile class can handle only in-memory data.
 It would be interesting to use an on-line algorithm to estimate quantiles as 
 a storeless statistic.
 An example of such an algorithm is the exponentially weighted stochastic 
 approximation  described in a 2000 paper by Fei Chen ,  Diane Lambert  and 
 José C. Pinheiro Incremental Quantile Estimation for Massive Tracking which 
 can be retrieved from CiteSeerX at 
 [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.105.1580].



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-01 Thread Phil Steitz (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14015167#comment-14015167
 ] 

Phil Steitz commented on MATH-1120:
---

The approach sounds reasonable to me, but the patch fails when I try to apply 
it to the code in trunk.  It also appears to mix formatting changes with code 
modifications.  Please turn off whatever your IDE is doing to reformat the code 
so we can focus on just what is being changed in the patch.

 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: excel-percentile-patch, percentile-with-estimation-patch

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)