commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rosie Chandler <rosie.chand...@btopenworld.com>
Subject Using the cumulative probability distribution method
Date Mon, 29 May 2006 08:17:46 GMT
I'm trying to use the cumulativeProbability method on
a normal distribution, but I can't get it to work
(sorry, but I'm new to Java and I just need to use it
to complete one task.  Here is my code:

===============================
import org.apache.commons.math.distribution.*;

public class testProj 
{
	public static void main(String[] args) 
	{
		DistributionFactory factory =
DistributionFactory.newInstance();
		NormalDistribution NormDistn =
factory.createNormalDistribution();
		
		double value = NormDistn.cumulativeProbability(1.0);
		System.out.println(value);
	}
}

===================================

The error I get is:

unreported exception
org.apache.commons.math.MathException; must be caught
or declared to be thrown

But I don't know how to do this.  Help would be much
appreciated.

Rosie


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


Mime
View raw message