Package com.imsl.test.example.stat
Class RandomEx1
java.lang.Object
com.imsl.test.example.stat.RandomEx1
- All Implemented Interfaces:
CdfFunction
Generates a pseudorandom sample from a normal distribution and performs a goodness of fit test.
In this example, a normal random sample of size 1000 is generated viaRandom.nextGaussian. Random.setSeed is first used
to set the seed. After the ChiSquaredTest constructor is called,
the random observations are added to the test one at a time to simulate
streaming data. The Chi-squared test is performed using
Cdf.normal as the cumulative distribution function object to see
how well the random numbers fit the normal distribution.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RandomEx1
public RandomEx1()
-
-
Method Details
-
cdf
public double cdf(double x) Description copied from interface:CdfFunctionPublic interface for the user-supplied cumulative distribution function to be used by InverseCdf.- Specified by:
cdfin interfaceCdfFunction- Parameters:
x- adoublescalar value representing the point at which the inverse CDF is desired.- Returns:
- a
doublescalar value representing the probability that a random variable for this CDF takes a value less than or equal to this value is p.
-
main
- Throws:
Exception
-