[jira] Resolved: (MATH-408) GLSMultipleLinearRegression has no nontrivial validation tests

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz resolved MATH-408.
--

Resolution: Fixed

Added a non-trivial test in r1044935.  While still not really a full 
verification test, it does at least verify that the GLS impl provided does 
better than OLS for models with error structure conforming to its covariance 
matrix.

 GLSMultipleLinearRegression has no nontrivial validation tests
 --

 Key: MATH-408
 URL: https://issues.apache.org/jira/browse/MATH-408
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0, 2.1
Reporter: Phil Steitz
 Fix For: 2.2


 There are no non-trivial tests verifying the computations for 
 GLSMultipleLinearRegression.  Tests verifying computations against 
 analytically determined models, R or some other reference package / datasets 
 should be added to ensure that the statistics reported by this class are 
 valid.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MATH-402) Complex.ZERO.pow(Complex.ONE) gives NaN in unit tests

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz commented on MATH-402:
--

I am leaning toward closing as WONTFIX.  Going once, going twice...

 Complex.ZERO.pow(Complex.ONE) gives NaN in unit tests
 -

 Key: MATH-402
 URL: https://issues.apache.org/jira/browse/MATH-402
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 1.2, 2.0, 2.1
 Environment: Issue 15 
 http://code.google.com/p/symja/issues/detail?id=15
Reporter: Axel Kramer
 Fix For: 2.2


 Why does this unit test in ComplexTest.java gives NaN?
 I expected to get Complex.ZERO as the result?
 {code:java} 
public void testPowZero() {
TestUtils.assertSame(Complex.NaN,
Complex.ZERO.pow(Complex.ONE));
 ...
}
 {code} 
 I would suggest something like this for the Complex#pow() method:
 {code:java} 
 public Complex pow(Complex x) {
 if (x == null) {
 throw new NullPointerException();
 }
 if (x.imaginary == 0.0) {
   if (real == 0.0  imaginary == 0.0) {
 if (x.real == 0.0){   
   return Complex.ZERO;
 }
   }
   if (x.real == 1.0) {
   return this;
   }
 }
 return this.log().multiply(x).exp();
 }
 {code} 
  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-456) Erf.erf - handle infinities and large values

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-456:
-

Affects Version/s: (was: 3.0)
   2.2

 Erf.erf - handle infinities and large values
 

 Key: MATH-456
 URL: https://issues.apache.org/jira/browse/MATH-456
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.2
Reporter: Josh Milthorpe
Priority: Minor

 {{Erf.erf(double)}} crashes when presented with infinities or large values, 
 as follows:
 {noformat}
 org.apache.commons.math.ConvergenceException: Continued fraction diverged to 
 NaN for value ∞
   at 
 org.apache.commons.math.util.ContinuedFraction.evaluate(ContinuedFraction.java:186)
   at 
 org.apache.commons.math.special.Gamma.regularizedGammaQ(Gamma.java:266)
   at 
 org.apache.commons.math.special.Gamma.regularizedGammaP(Gamma.java:173)
   at org.apache.commons.math.special.Erf.erf(Erf.java:56)
   at TestInfErf.main(TestInfErf.java:9)
 {noformat}
 The following code demonstrates this crash:
 {code}
 import org.apache.commons.math.MathException;
 import org.apache.commons.math.special.Erf;
 public class TestInfErf {
 public static void main(String[] args) {
 try {
 System.out.println(erf(Inf) =  + 
 Erf.erf(Double.POSITIVE_INFINITY));
 System.out.println(erf(-Inf) =  + 
 Erf.erf(Double.NEGATIVE_INFINITY));
 System.out.println(erf(Huge) =  + Erf.erf(1e300));
 } catch (MathException e) { 
 e.printStackTrace(); 
 }
 }
 }
 {code}
 At double precision, erf\(x\) = 1.0 for x  6.0 and erf\(x\) = -1.0 for x  
 -6.0.  Therefore Erf.java could be patched as follows:
 {noformat}
 Index: src/main/java/org/apache/commons/math/special/Erf.java
 ===
 --- src/main/java/org/apache/commons/math/special/Erf.java(revision 
 1043888)
 +++ src/main/java/org/apache/commons/math/special/Erf.java(working copy)
 @@ -48,6 +48,12 @@
   * @throws MathException if the algorithm fails to converge.
   */
  public static double erf(double x) throws MathException {
 +// at double precision, erf(x) = (+/-)1.0 for |x|  6.0
 +if (x  6.0) {
 +return 1.0;
 +} else if (x -6.0) {
 +return -1.0;
 +}
  double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 1);
  if (x  0) {
  ret = -ret;
 {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-448) Frequency get number of unique values

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-448:
-

Fix Version/s: 2.2

 Frequency get number of unique values
 -

 Key: MATH-448
 URL: https://issues.apache.org/jira/browse/MATH-448
 Project: Commons Math
  Issue Type: New Feature
Reporter: Patrick Meyer
Priority: Minor
 Fix For: 2.2

 Attachments: MATH-448.patch, MATH-448.patch

   Original Estimate: 0.25h
  Remaining Estimate: 0.25h

 It is often useful to know the number of unique elements in a frequency 
 table. Could you add a simple method that returns the size of freqTable. It 
 seems like it would be as simple as:
 {code}
 public int getUniqueCount(){
  return freqTable.size();
 }
 {code}
 Given that freqTable is private, there is no way to extend the class and add 
 this method. Thanks!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-449) Storeless covariance

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-449:
-

Fix Version/s: 3.0

 Storeless covariance
 

 Key: MATH-449
 URL: https://issues.apache.org/jira/browse/MATH-449
 Project: Commons Math
  Issue Type: Improvement
Reporter: Patrick Meyer
 Fix For: 3.0

   Original Estimate: 168h
  Remaining Estimate: 168h

 Currently there is no storeless version for computing the covariance. 
 However, Pebay (2008) describes algorithms for on-line covariance 
 computations, [http://infoserve.sandia.gov/sand_doc/2008/086212.pdf]. I have 
 provided a simple class for implementing this algorithm. It would be nice to 
 have this integrated into org.apache.commons.math.stat.correlation.Covariance.
 {code}
 public class StorelessCovariance{
 private double deltaX = 0.0;
 private double deltaY = 0.0;
 private double meanX = 0.0;
 private double meanY = 0.0;
 private double N=0;
 private Double covarianceNumerator=0.0;
 private boolean unbiased=true;
 public Covariance(boolean unbiased){
   this.unbiased = unbiased;
 }
 public void increment(Double x, Double y){
 if(x!=null  y!=null){
 N++;
 deltaX = x - meanX;
 deltaY = y - meanY;
 meanX += deltaX/N;
 meanY += deltaY/N;
 covarianceNumerator += ((N-1.0)/N)*deltaX*deltaY;
 }
 
 }
 public Double getResult(){
 if(unbiased){
 return covarianceNumerator/(N-1.0);
 }else{
 return covarianceNumerator/N;
 }
 }   
 }
 {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-435) Efficient matrix power

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-435:
-

Fix Version/s: 3.0

 Efficient matrix power
 --

 Key: MATH-435
 URL: https://issues.apache.org/jira/browse/MATH-435
 Project: Commons Math
  Issue Type: Improvement
Reporter: Mikkel Meyer Andersen
Assignee: Mikkel Meyer Andersen
 Fix For: 3.0

 Attachments: MATH435-patch1

   Original Estimate: 0.07h
  Remaining Estimate: 0.07h

 For symmetric matrices A it is easy to find A^n also for large n by making an 
 eigenvalue/-vector decomposition.
 In general, if the structure of the matrix is not know and the n'th power is 
 needed, A*A*...*A is way too inefficient. By using a binary representation 
 and powers of 2, powers can be found far faster similar to finding 5^14 as 
 5^14 = 5^8 * 5^4 = ((5^2)^2)^2 * (5^2)^2 = x3 * x2 where x1 = 5^2, x2 = x1^2, 
 and x3 = x2^2, thus saving a lot of computations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-434) SimplexSolver returns unfeasible solution

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-434:
-

Fix Version/s: 2.2

 SimplexSolver returns unfeasible solution
 -

 Key: MATH-434
 URL: https://issues.apache.org/jira/browse/MATH-434
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.1
Reporter: Wayne Witzel
 Fix For: 2.2

 Attachments: SimplexSolverIssues.java, SimplexSolverIssuesOutput.txt


 The SimplexSolver is returning an unfeasible solution:
 import java.util.ArrayList;
 import java.text.DecimalFormat;
 import org.apache.commons.math.linear.ArrayRealVector;
 import org.apache.commons.math.optimization.GoalType;
 import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.linear.*;
 public class SimplexSolverBug {
 
 public static void main(String[] args) throws OptimizationException {
 
 LinearObjectiveFunction c = new LinearObjectiveFunction(new 
 double[]{0.0d, 1.0d, 1.0d, 0.0d, 0.0d, 0.0d, 0.0d}, 0.0d);
 
 ArrayListLinearConstraint cnsts = new 
 ArrayListLinearConstraint(5);
 LinearConstraint cnst;
 cnst = new LinearConstraint(new double[] {1.0d, -0.1d, 0.0d, 0.0d, 
 0.0d, 0.0d, 0.0d}, Relationship.EQ, -0.1d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {1.0d, 0.0d, 0.0d, 0.0d, 
 0.0d, 0.0d, 0.0d}, Relationship.GEQ, -1e-18d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 1.0d, 0.0d, 0.0d, 
 0.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 0.0d, 1.0d, 
 0.0d, -0.0128588d, 1e-5d}, Relationship.EQ, 0.0d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 0.0d, 0.0d, 
 1.0d, 1e-5d, -0.0128586d}, Relationship.EQ, 1e-10d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 1.0d, -1.0d, 
 0.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 1.0d, 1.0d, 
 0.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 1.0d, 0.0d, 
 -1.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d);
 cnsts.add(cnst);
 cnst = new LinearConstraint(new double[] {0.0d, 0.0d, 1.0d, 0.0d, 
 1.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d);
 cnsts.add(cnst);
 
 DecimalFormat df = new java.text.DecimalFormat(0.#E0);
 
 System.out.println(Constraints:);
 for(LinearConstraint con : cnsts) {
 for (int i = 0; i  con.getCoefficients().getDimension(); ++i)
 
 System.out.print(df.format(con.getCoefficients().getData()[i]) +  );
 System.out.println(con.getRelationship() +   + con.getValue());
 }
 
 SimplexSolver simplex = new SimplexSolver(1e-7);
 double[] sol = simplex.optimize(c, cnsts, GoalType.MINIMIZE, 
 false).getPointRef();
 System.out.println(Solution:\n + new ArrayRealVector(sol));
 System.out.println(Second constraint is violated!);
 }
 }
 It's an odd problem, but something I ran across.  I tracked the problem to 
 the getPivotRow routine in SimplexSolver.  It was choosing a pivot that 
 resulted in a negative right-hand-side.  I recommend a fix by replacing
 ...
 if (MathUtils.equals(ratio, minRatio, epsilon)) {
 ...
 with
 ...
 if (MathUtils.equals(ratio, minRatio, 
 Math.abs(epsilon/entry))) {
 ...
 I believe this would be more appropriate (and at least resolves this 
 particular problem).
 Also, you may want to consider making a change in getPivotColumn to replace
 ...
 if (MathUtils.compareTo(tableau.getEntry(0, i), minValue, 
 epsilon)  0) {
 ...
 with
 ...
 if (tableau.getEntry(0, i)  minValue) 
 ...
 because I don't see the point of biasing earlier columns when multiple 
 entries are within epsilon of each other.  Why not pick the absolute 
 smallest.  I don't know that any problem can result from doing it the other 
 way, but the latter may be a safer bet.
 VERY IMPORTANT: I discovered another bug that occurs when not restricting to 
 non-negatives.  In SimplexTableu::getSolution(), 
   ...  
   if (basicRows.contains(basicRow)) 
   // if multiple variables can take a given value
   // then we choose the first and set the rest equal to 0
   coefficients[i] = 0;
   ...
 should be
   ...  
   if 

[jira] Updated: (MATH-437) Kolmogorov Smirnov Distribution

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-437:
-

Fix Version/s: 3.0

 Kolmogorov Smirnov Distribution
 ---

 Key: MATH-437
 URL: https://issues.apache.org/jira/browse/MATH-437
 Project: Commons Math
  Issue Type: New Feature
Reporter: Mikkel Meyer Andersen
Assignee: Mikkel Meyer Andersen
Priority: Minor
 Fix For: 3.0

   Original Estimate: 0.25h
  Remaining Estimate: 0.25h

 Kolmogorov-Smirnov test (see [1]) is used to test if one sample against a 
 known probability density functions or if two samples are from the same 
 distribution. To evaluate the test statistic, the Kolmogorov-Smirnov 
 distribution is used. Quite good asymptotics exist for the one-sided test, 
 but it's more difficult for the two-sided test.
 [1]: http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-456) Erf.erf - handle infinities and large values

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-456:
-

Fix Version/s: 2.2

 Erf.erf - handle infinities and large values
 

 Key: MATH-456
 URL: https://issues.apache.org/jira/browse/MATH-456
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.2
Reporter: Josh Milthorpe
Priority: Minor
 Fix For: 2.2


 {{Erf.erf(double)}} crashes when presented with infinities or large values, 
 as follows:
 {noformat}
 org.apache.commons.math.ConvergenceException: Continued fraction diverged to 
 NaN for value ∞
   at 
 org.apache.commons.math.util.ContinuedFraction.evaluate(ContinuedFraction.java:186)
   at 
 org.apache.commons.math.special.Gamma.regularizedGammaQ(Gamma.java:266)
   at 
 org.apache.commons.math.special.Gamma.regularizedGammaP(Gamma.java:173)
   at org.apache.commons.math.special.Erf.erf(Erf.java:56)
   at TestInfErf.main(TestInfErf.java:9)
 {noformat}
 The following code demonstrates this crash:
 {code}
 import org.apache.commons.math.MathException;
 import org.apache.commons.math.special.Erf;
 public class TestInfErf {
 public static void main(String[] args) {
 try {
 System.out.println(erf(Inf) =  + 
 Erf.erf(Double.POSITIVE_INFINITY));
 System.out.println(erf(-Inf) =  + 
 Erf.erf(Double.NEGATIVE_INFINITY));
 System.out.println(erf(Huge) =  + Erf.erf(1e300));
 } catch (MathException e) { 
 e.printStackTrace(); 
 }
 }
 }
 {code}
 At double precision, erf\(x\) = 1.0 for x  6.0 and erf\(x\) = -1.0 for x  
 -6.0.  Therefore Erf.java could be patched as follows:
 {noformat}
 Index: src/main/java/org/apache/commons/math/special/Erf.java
 ===
 --- src/main/java/org/apache/commons/math/special/Erf.java(revision 
 1043888)
 +++ src/main/java/org/apache/commons/math/special/Erf.java(working copy)
 @@ -48,6 +48,12 @@
   * @throws MathException if the algorithm fails to converge.
   */
  public static double erf(double x) throws MathException {
 +// at double precision, erf(x) = (+/-)1.0 for |x|  6.0
 +if (x  6.0) {
 +return 1.0;
 +} else if (x -6.0) {
 +return -1.0;
 +}
  double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 1);
  if (x  0) {
  ret = -ret;
 {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-353) Constrained version of the Nelder-Mead simplex method and bi-cubic interpolation

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-353:
-

Fix Version/s: 3.0

 Constrained version of the Nelder-Mead simplex method and bi-cubic 
 interpolation
 

 Key: MATH-353
 URL: https://issues.apache.org/jira/browse/MATH-353
 Project: Commons Math
  Issue Type: Wish
Affects Versions: 2.0, 2.1
Reporter: Dimitri Pourbaix
Priority: Minor
 Fix For: 3.0


 The library http://www.ee.ucl.ac.uk/~mflanaga/java/ offers a constrained 
 version of the Nelder-Mead simplex method through the addition of a penalty 
 function.  Such a possibility seems to be missing from commons-math.
 The same library also offers some bi-cubic interpolation which is also absent 
 in commons-math.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-431) New tests: Wilcoxon signed-rank test and Mann-Whitney U

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-431:
-

Fix Version/s: 3.0

 New tests: Wilcoxon signed-rank test and Mann-Whitney U
 ---

 Key: MATH-431
 URL: https://issues.apache.org/jira/browse/MATH-431
 Project: Commons Math
  Issue Type: New Feature
Reporter: Mikkel Meyer Andersen
Assignee: Mikkel Meyer Andersen
Priority: Minor
 Fix For: 3.0

 Attachments: MannWhitneyUTest.java, MannWhitneyUTestImpl.java, 
 WilcoxonSignedRankTest.java, WilcoxonSignedRankTestImpl.java

   Original Estimate: 4h
  Remaining Estimate: 4h

 Wilcoxon signed-rank test and Mann-Whitney U are commonly used non-parametric 
 statistical hypothesis tests (e.g. instead of various t-tests when normality 
 is not present).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-455) [PATCH] Allow Clirr minSeverity to be overridden on the command-line

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-455:
-

Fix Version/s: 2.2

+1 for applying this

 [PATCH] Allow Clirr minSeverity to be overridden on the command-line
 

 Key: MATH-455
 URL: https://issues.apache.org/jira/browse/MATH-455
 Project: Commons Math
  Issue Type: Improvement
Reporter: Sebb
 Fix For: 2.2

 Attachments: MATH-455.patch


 Unfortunately, Maven command-line parameters cannot be used to override 
 configuration options (only to provide defaults), so with the current Math 
 POMs it's not possible to change the minimum Clirr severity without editting 
 pom.xml
 The patch defines a property with the name minSeverity which defines the 
 default value, and uses it in the configuration section.
 This allows the user to override minSeverity on the command-line, and will 
 continue to work even if the minSeverity configuration is ever dropped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (MATH-228) Feature request for one and two sample Kolmogorov-Smirnov test as well as Lilliefors test

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz updated MATH-228:
-

Fix Version/s: (was: 2.2)
   3.0

Still struggling with the distribution, so moving out to 3.0

 Feature request for one and two sample Kolmogorov-Smirnov test as well as 
 Lilliefors test
 -

 Key: MATH-228
 URL: https://issues.apache.org/jira/browse/MATH-228
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 1.2
 Environment: All
Reporter: Anirban Basu
Priority: Minor
 Fix For: 3.0

   Original Estimate: 336h
  Remaining Estimate: 336h

 It would be very helpful to have implementations of one and two sample 
 [Kolmogorov-Smirnov 
 test|http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test] as well as 
 [Lilliefors test|http://en.wikipedia.org/wiki/Lilliefors_test] with 
 MATLAB-style results in future versions of Commons Math.
 For example, Lilliefors test on sample data:
 sampleVector = [0.0033413022337048857, 0.008527692135731013, 
 -0.004902763950955454, 0.033018433100296396, -0.020495504044139023, 
 0.003978726052913162, 0.003847972673931109, 0.009160477945515444, 
 -0.03437653216639, -0.01164235145079795, 0.017180306607011864, 
 -0.01818483009998717, -0.010479811709006803, -0.033991339307749, 
 -0.007057160031600951, -1.2398497120424956E-4, 0.0026913151777877564, 
 0.03580425341677764, -0.006404370278251359, 0.007579083257585828, 
 -0.005912037207256193, 0.01241830354576745, -0.0012524631744377235, 
 -0.005900927958040758, 0.0028847985848513558, 0.005313417226899042, 
 0.018923743379700153, 0.010976836172447269, -0.017847220928846164, 
 0.0024067380689056783, -0.011912393656503872, -0.019985462687391875, 
 0.017318878212931876, 0.003592873590795409, -0.00332615776078915, 
 -0.018222673013956525, -0.021591768336351125];
 [h, p] = lillietest(sampleVector)
 Warning: P is greater than the largest tabulated value, returning 0.5.
In lillietest at 166
   h =
   0
   p =
   0.5000
 This uses Lilliefors test for normality. The test returns that h=0, i.e. the 
 null hypothesis that the data vector obeys Normal distribution.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Resolved: (MATH-448) Frequency get number of unique values

2010-12-12 Thread Phil Steitz (JIRA)

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

Phil Steitz resolved MATH-448.
--

Resolution: Fixed

Thanks for the patch!

I committed a slightly modified version in r1044981.   I made the following 
changes to the patch:

* Changed the javadoc to refer to values to be consistent with the rest of 
the documentation
* Used keyset.size() to compute the result
* Added test cases

 Frequency get number of unique values
 -

 Key: MATH-448
 URL: https://issues.apache.org/jira/browse/MATH-448
 Project: Commons Math
  Issue Type: New Feature
Reporter: Patrick Meyer
Priority: Minor
 Fix For: 2.2

 Attachments: MATH-448.patch, MATH-448.patch

   Original Estimate: 0.25h
  Remaining Estimate: 0.25h

 It is often useful to know the number of unique elements in a frequency 
 table. Could you add a simple method that returns the size of freqTable. It 
 seems like it would be as simple as:
 {code}
 public int getUniqueCount(){
  return freqTable.size();
 }
 {code}
 Given that freqTable is private, there is no way to extend the class and add 
 this method. Thanks!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (VFS-325) Bad handling of hashs (#) in file names when walking a file tree using findFiles()

2010-12-12 Thread Larry Reeve (JIRA)

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

Larry Reeve updated VFS-325:


Attachment: PATCH-vfs-325.tar

Attached is archive submission of patch file and new files to resolve this 
issue.

New files are:
1) core/src/test/java/org/apache/commons/vfs2/provider/local/test/UrlTests.java
This a source file containing new unit tests around URL handling for this issue.

2) core/src/test/resources/test-data/test-hash-#test.txt
A test file to test the FindFiles operation as part of the unit test.


Patched source files are:
1) 
core/src/test/java/org/apache/commons/vfs2/provider/local/test/LocalProviderTestCase.java
Add new URL test cases.

2) core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java
Overrides getURL() method in abstract base class AbstractFileObject.java for 
local files.

3) core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
Exposes VfsComponentContext for use in LocalFile.java

 Bad handling of hashs (#) in file names when walking a file tree using 
 findFiles()
 --

 Key: VFS-325
 URL: https://issues.apache.org/jira/browse/VFS-325
 Project: Commons VFS
  Issue Type: Bug
Affects Versions: 1.0, 1.1, 2.0
 Environment: Windows Seven, JDK 1.6 64 bit
Reporter: Nicolas Guillaumin
 Attachments: PATCH-vfs-325.tar


 Consider a local directory tree containing files with hashs in their name, 
 such as {{test-hash-#.txt}}.
 When walking the tree using FileObject.findFiles(), the file is correctly 
 found and returned, but it's URL is truncated to the #: {{test-hash-}}
 * Calling file.getURL().toString() returns {{file://my/dir/test-hash-}}
 * Calling file.toString() returns the correct URL 
 {{file://my/dir/test-hash-#.txt}}
 * For the sake of testing, calling new 
 URL(http://my/file/with/hash-#.txt;).toString() returns 
 {{http://my/file/with/hash-#.txt}} (It's not an java.net.URL problem)
 I think file.getURL().toString() should return {{test-hash-#.txt}}, otherwise 
 caller have to rely on file.toString() to retrieve the URL of the file, which 
 is probably bad.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (COLLECTIONS-363) TransformedMap is Serializable but its superclass doesn't define an accessible void constructor

2010-12-12 Thread Igor Saprykin (JIRA)

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

Igor Saprykin commented on COLLECTIONS-363:
---

Hello.
It seems to me that addition of constructor really solves the problem. (look 
COLLECTIONS-363.patch attached)

 TransformedMap is Serializable but its superclass doesn't define an 
 accessible void constructor
 ---

 Key: COLLECTIONS-363
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-363
 Project: Commons Collections
  Issue Type: Bug
  Components: Map
Affects Versions: 3.2
Reporter: Sebb

 TransformedMap is Serializable but its superclass doesn't define an 
 accessible void constructor.
 For example, the following test fails:
 {code}
 public void testSerialisation() throws Exception {
 TransformedMapString, String, String, String map = 
 TransformedMap.decorate(
 new HashMapString, String(),  NOPTransformer.String 
 getInstance(), NOPTransformer.String getInstance());
 ByteArrayOutputStream bytes = new ByteArrayOutputStream();
 ObjectOutputStream out = new ObjectOutputStream(bytes);
 out.writeObject(map); // fails with java.io.InvalidClassException: 
 org.apache.commons.collections.splitmap.TransformedMap; no valid constructor
 out.close();
 }
 {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COLLECTIONS-363) TransformedMap is Serializable but its superclass doesn't define an accessible void constructor

2010-12-12 Thread Igor Saprykin (JIRA)

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

Igor Saprykin updated COLLECTIONS-363:
--

Attachment: COLLECTIONS-363.patch

 TransformedMap is Serializable but its superclass doesn't define an 
 accessible void constructor
 ---

 Key: COLLECTIONS-363
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-363
 Project: Commons Collections
  Issue Type: Bug
  Components: Map
Affects Versions: 3.2
Reporter: Sebb
 Attachments: COLLECTIONS-363.patch


 TransformedMap is Serializable but its superclass doesn't define an 
 accessible void constructor.
 For example, the following test fails:
 {code}
 public void testSerialisation() throws Exception {
 TransformedMapString, String, String, String map = 
 TransformedMap.decorate(
 new HashMapString, String(),  NOPTransformer.String 
 getInstance(), NOPTransformer.String getInstance());
 ByteArrayOutputStream bytes = new ByteArrayOutputStream();
 ObjectOutputStream out = new ObjectOutputStream(bytes);
 out.writeObject(map); // fails with java.io.InvalidClassException: 
 org.apache.commons.collections.splitmap.TransformedMap; no valid constructor
 out.close();
 }
 {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.