You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/11/17 12:14:29 UTC

DO NOT REPLY [Bug 24747] New: - wrong results and stack overflow error from BivariateRegression

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24747>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24747

wrong results and stack overflow error from BivariateRegression

           Summary: wrong results and stack overflow error from
                    BivariateRegression
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Math
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: skarupo@mail.ru


Example:

import java.util.*;
import org.apache.commons.math.stat.*;

public class RegressionTest
{


	public static void main(String[] args)
	{
	
	
		BivariateRegression br1 = new BivariateRegression();
		BivariateRegression br2 = new BivariateRegression();
		
		
		Random random = new Random(1);
		
		int n = 100;
		
		for (int i = 0; i < n; i++)
		{
		
		
			br1.addData(((double)i)/(n-1), i); //perfectly correlated example
			br2.addData(((double)i)/(n-1), random.nextDouble()); //uncorrelated example
			
		
		
		
		}
		
		
		System.out.println(br1.getSignificance()); //should return 0, but returns NaN instead
		System.out.println(br2.getSignificance()); //should return 1, but some sequences cause stack overflow error!
		
	
	
	}




}

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