org.jscience.mathematics.statistics
Class DiscreteArcsineDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.DiscreteArcsineDistribution
All Implemented Interfaces:
java.io.Serializable

public class DiscreteArcsineDistribution
extends Distribution
implements java.io.Serializable

This class models the discrete arcsine distribution. The distribution governs the last zero in a symmetric random walk on an interval.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
DiscreteArcsineDistribution()
          This default constructor creates a new discrete arcsine distribution with 10 steps.
DiscreteArcsineDistribution(int n)
          This general constructor creates a new discrete arcsine distribution with a specified number of steps.
 
Method Summary
 double getDensity(double x)
          This method computes the probability density function.
 double getMaxDensity()
          This method computes the maximum value of the density function.
 double getMean()
          This method computes the mean of the distribution.
 int getSteps()
          This method gets the steps, the number of steps.
 void setSteps(int n)
          This method sets the steps, the number of steps, and then defines the default domain.
 double simulate()
          This method simulates a value from the distribution, by simulating a random walk on the interval and computing the time of the last zero.
 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 org.jscience.mathematics.statistics.Distribution
getCDF, getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, getVariance, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscreteArcsineDistribution

public DiscreteArcsineDistribution(int n)
This general constructor creates a new discrete arcsine distribution with a specified number of steps.

Parameters:
n - the number of steps

DiscreteArcsineDistribution

public DiscreteArcsineDistribution()
This default constructor creates a new discrete arcsine distribution with 10 steps.

Method Detail

setSteps

public void setSteps(int n)
This method sets the steps, the number of steps, and then defines the default domain.

Parameters:
n - the number of steps

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. The maximum value is the value at 0, one of the modes of the distribution.

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

getSteps

public int getSteps()
This method gets the steps, the number of steps.

Returns:
the number of setps

getMean

public double getMean()
This method computes the mean of the distribution.

Overrides:
getMean in class Distribution
Returns:
the mean

simulate

public double simulate()
This method simulates a value from the distribution, by simulating a random walk on the interval and computing the time of the last zero.

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

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