@PublicationReference(author="David M. Lane",title="Studentized Range Distribution",type=WebPage,year=2011,url="http://davidmlane.com/hyperstat/A47912.html") @PublicationReference(author="Wikipedia",title="Studentized range",type=WebPage,year=2011,url="http://en.wikipedia.org/wiki/Studentized_range") public class StudentizedRangeDistribution extends AbstractClosedFormUnivariateDistribution<java.lang.Double> implements Randomized
Modifier and Type | Class and Description |
---|---|
static class |
StudentizedRangeDistribution.APStat
This is a translation of Fortran code taken from
http://lib.stat.cmu.edu/apstat/, and the comments on the individual functions
in this class are taken directly from the original.
|
static class |
StudentizedRangeDistribution.CDF
CDF of the StudentizedRangeDistribution
|
protected static class |
StudentizedRangeDistribution.SampleRange
Computes the estimate of the Studentized Range for a single sample
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DEGREES_OF_FREEDOM
Default degrees of freedom, 1d/0d.
|
static int |
DEFAULT_NUM_SAMPLES
Number of samples to draw for Monte Carlo estimates, 1000.
|
static int |
DEFAULT_TREATMENT_COUNT
Default treatment count, 2.
|
protected double |
degreesOfFreedom
Number of subjects in each treatment minus one.
|
protected java.util.Random |
random
Random number generator for Monte Carlo simulations
|
protected int |
treatmentCount
Number of comparisons made
|
Constructor and Description |
---|
StudentizedRangeDistribution()
Default constructor
|
StudentizedRangeDistribution(int treatmentCount,
double degreesOfFreedom)
Creates a new instance of StudentizedRangeDistribution
|
StudentizedRangeDistribution(StudentizedRangeDistribution other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
StudentizedRangeDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector |
convertToVector()
Converts the object to a vector.
|
StudentizedRangeDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution.
|
double |
getDegreesOfFreedom()
Getter for degreesOfFreedom
|
java.lang.Double |
getMaxSupport()
Gets the minimum support (domain or input) of the distribution.
|
java.lang.Double |
getMean()
Gets the arithmetic mean, or "first central moment" or "expectation",
of the distribution.
|
double |
getMeanAsDouble()
Gets the mean of the distribution as a double.
|
java.lang.Double |
getMinSupport()
Gets the minimum support (domain or input) of the distribution.
|
java.util.Random |
getRandom()
Gets the random number generator used by this object.
|
int |
getTreatmentCount()
Getter for treatmentCount
|
double |
getVariance()
Gets the variance of the distribution.
|
void |
sampleInto(java.util.Random random,
int sampleCount,
java.util.Collection<? super java.lang.Double> output)
Draws multiple random samples from the distribution and puts the result
into the given collection.
|
void |
setDegreesOfFreedom(double degreesOfFreedom)
Setter for degreesOfFreedom
|
void |
setRandom(java.util.Random random)
Sets the random number generator used by this object.
|
void |
setTreatmentCount(int treatmentCount)
Setter for treatmentCount
|
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sample, sample
public static final int DEFAULT_TREATMENT_COUNT
public static final double DEFAULT_DEGREES_OF_FREEDOM
public static final int DEFAULT_NUM_SAMPLES
protected int treatmentCount
protected double degreesOfFreedom
protected java.util.Random random
public StudentizedRangeDistribution()
public StudentizedRangeDistribution(int treatmentCount, double degreesOfFreedom)
treatmentCount
- Number of comparisons madedegreesOfFreedom
- Number of subjects in each treatment minus one.public StudentizedRangeDistribution(StudentizedRangeDistribution other)
other
- StudentizedRangeDistribution to copypublic StudentizedRangeDistribution clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface Vectorizable
clone
in interface CloneableSerializable
clone
in class AbstractClosedFormUnivariateDistribution<java.lang.Double>
public void sampleInto(java.util.Random random, int sampleCount, java.util.Collection<? super java.lang.Double> output)
Distribution
sampleInto
in interface Distribution<java.lang.Double>
random
- Random number generator to use.sampleCount
- The number of samples to draw. Cannot be negative.output
- The collection to add the samples into.public StudentizedRangeDistribution.CDF getCDF()
UnivariateDistribution
getCDF
in interface ClosedFormUnivariateDistribution<java.lang.Double>
getCDF
in interface UnivariateDistribution<java.lang.Double>
public java.lang.Double getMean()
DistributionWithMean
getMean
in interface DistributionWithMean<java.lang.Double>
public double getMeanAsDouble()
UnivariateDistribution
getMeanAsDouble
in interface UnivariateDistribution<java.lang.Double>
public Vector convertToVector()
Vectorizable
convertToVector
in interface Vectorizable
public void convertFromVector(Vector parameters)
Vectorizable
convertFromVector
in interface Vectorizable
parameters
- The parameters to incorporate.public java.lang.Double getMinSupport()
UnivariateDistribution
getMinSupport
in interface UnivariateDistribution<java.lang.Double>
public java.lang.Double getMaxSupport()
UnivariateDistribution
getMaxSupport
in interface UnivariateDistribution<java.lang.Double>
public double getVariance()
UnivariateDistribution
getVariance
in interface UnivariateDistribution<java.lang.Double>
public int getTreatmentCount()
public void setTreatmentCount(int treatmentCount)
treatmentCount
- Number of comparisons madepublic double getDegreesOfFreedom()
public void setDegreesOfFreedom(double degreesOfFreedom)
degreesOfFreedom
- Number of subjects in each treatment minus one.public java.util.Random getRandom()
Randomized
getRandom
in interface Randomized
public void setRandom(java.util.Random random)
Randomized
setRandom
in interface Randomized
random
- The random number generator for this object to use.