edu.uah.math.distributions
Class CircleDistribution

java.lang.Object
  extended by edu.uah.math.distributions.Distribution
      extended by edu.uah.math.distributions.CircleDistribution
All Implemented Interfaces:
java.io.Serializable

public class CircleDistribution
extends Distribution
implements java.io.Serializable

This class models the crcle distribution with a specified radius. This is the distribution of X and Y when (X, Y) has the uniform distribution on a circular region centered at the origin, with the given radius.

Version:
August, 2003
Author:
Kyle Siegrist, Dawn Duehring
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.uah.math.distributions.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
CircleDistribution()
          This default constructor creates a new circle distribution with radius 1.
CircleDistribution(double r)
          This general constructor creates a new circle distribution with a specified radius.
 
Method Summary
 double getCDF(double x)
          This method compute the cumulative distribution functionin in terms of the radius parameter.
 double getDensity(double x)
          This method computes the probability density function,
 double getMaxDensity()
          This method computes the maximum value of the density function, which is the value at 0.
 double getMean()
          This method computes the mean in terms of the radius parameter.
 double getMedian()
          This method computes the median which is 0 regardless of the radius parameter.
 double getQuantile(double p)
          This method computes the quantile function in terms of the radius parameter.
 double getRadius()
          This method returns the radius parameter.
 double getVariance()
          This method computes the variance in terms of the radius parameter.
 void setRadius(double r)
          This method sets the radius parameter and computes the domain of the distribution.
 double simulate()
          This method simulates a value from the distribution.
 java.lang.String toString()
          This method returns a string that gives the name of the distribution and the values of the parameters.
 
Methods inherited from class edu.uah.math.distributions.Distribution
getDomain, getFailureRate, getMGF, getMoment, getMoment, getPGF, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CircleDistribution

public CircleDistribution(double r)
This general constructor creates a new circle distribution with a specified radius.

Parameters:
r - the radius

CircleDistribution

public CircleDistribution()
This default constructor creates a new circle distribution with radius 1.

Method Detail

setRadius

public void setRadius(double r)
This method sets the radius parameter and computes the domain of the distribution.

Parameters:
r - the radius

getDensity

public double getDensity(double x)
This method computes the probability density function,

Specified by:
getDensity in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the probability density at x

getMaxDensity

public double getMaxDensity()
This method computes the maximum value of the density function, which is the value at 0.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum value of the probability density function

getMean

public double getMean()
This method computes the mean in terms of the radius parameter.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method computes the variance in terms of the radius parameter.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMedian

public double getMedian()
This method computes the median which is 0 regardless of the radius parameter.

Overrides:
getMedian in class Distribution
Returns:
the median

getRadius

public double getRadius()
This method returns the radius parameter.

Returns:
the radius

simulate

public double simulate()
This method simulates a value from the distribution. This is done by simulating a point chosen uniformly in the circle of the specified radius, centered at the origin, and then computing the x-coordinate of the point.

Overrides:
simulate in class Distribution
Returns:
a simulated value from the distribution

getCDF

public double getCDF(double x)
This method compute the cumulative distribution functionin in terms of the radius parameter.

Overrides:
getCDF in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the cumulative probability at x

getQuantile

public double getQuantile(double p)
This method computes the quantile function in terms of the radius parameter.

Overrides:
getQuantile in class Distribution
Parameters:
p - a probability in (0, 1)
Returns:
the quantile of order p

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters