| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uah.math.distributions.Distribution
edu.uah.math.distributions.WalkPositionDistribution
public class WalkPositionDistribution
This class models the distribution of the position at time n for a random walk on the interval [0, n].
| Field Summary | 
|---|
| Fields inherited from class edu.uah.math.distributions.Distribution | 
|---|
| CONTINUOUS, DISCRETE, MIXED | 
| Constructor Summary | |
|---|---|
| WalkPositionDistribution()This default constructor creates a new WalkPositionDistribution with time parameter 10 and probability p = 0.5. | |
| WalkPositionDistribution(int n,
                         double p)This general constructor creates a new distribution with specified time and probability parameters. | |
| Method Summary | |
|---|---|
|  double | getDensity(double x)This method computes the density function. | 
|  double | getMaxDensity()This method returns the maximum value of the density function. | 
|  double | getMean()This method computes the mean. | 
|  double | getProbability()This method returns the probability parameter. | 
|  double | getSteps()This method returns the number of steps in the random walk. | 
|  double | getVariance()This method computes the variance. | 
|  void | setParameters(int n,
              double p)This method sets the time and probability parameters. | 
|  void | setProbability(double p)This method sets the probability parameter. | 
|  void | setSteps(int n)This method sets the number of steps. | 
|  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 | 
|---|
| getCDF, getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public WalkPositionDistribution(int n,
                                double p)
n - the number of stepsp - the probabiltiy of a step in the positive directionpublic WalkPositionDistribution()
| Method Detail | 
|---|
public void setParameters(int n,
                          double p)
n - the number of stepsp - the probability of a step in the positive directionpublic double getDensity(double x)
getDensity in class Distributionx - a number in the domain of the distribution
public double getMaxDensity()
getMaxDensity in class Distributionpublic double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic void setSteps(int n)
n - the number of stepspublic double getSteps()
public void setProbability(double p)
p - the probability of a step in the positve direcitonpublic double getProbability()
public double simulate()
simulate in class Distributionpublic java.lang.String toString()
toString in class Distribution| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||