Class DistBeta
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistContinuous
nl.tudelft.simulation.jstats.distributions.DistBeta
- All Implemented Interfaces:
Serializable
The Beta distribution. For more information on this distribution see
https://mathworld.wolfram.com/BetaDistribution.html
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDistBeta(StreamInterface stream, double alpha1, double alpha2) constructs a new beta distribution. -
Method Summary
Modifier and TypeMethodDescriptiondoubledraw()draws the next stream value according to the probability of this this distribution.doubleReturn the first shape parameter α1 for the distribution.doubleReturn the second shape parameter α2for the distribution.doublegetProbabilityDensity(double x) returns the probability density value of a value x.voidsetStream(StreamInterface stream) Replace the random number stream.toString()
-
Constructor Details
-
DistBeta
constructs a new beta distribution.- Parameters:
stream- StreamInterface; the stream.alpha1- double; the first shape parameter α1 for the distributionalpha2- double; the second shape parameter α2for the distribution- Throws:
IllegalArgumentException- when alpha1 <= 0.0 or alpha2 <= 0.0
-
-
Method Details
-
draw
public double draw()draws the next stream value according to the probability of this this distribution.- Specified by:
drawin classDistContinuous- Returns:
- the next double value drawn.
-
getProbabilityDensity
public double getProbabilityDensity(double x) returns the probability density value of a value x.- Specified by:
getProbabilityDensityin classDistContinuous- Parameters:
x- double; the value for which the density function needs to be calculated- Returns:
- double; the probability density for value x
-
getAlpha1
public double getAlpha1()Return the first shape parameter α1 for the distribution.- Returns:
- double; the first shape parameter α1 for the distribution
-
getAlpha2
public double getAlpha2()Return the second shape parameter α2for the distribution.- Returns:
- double; the second shape parameter α2for the distribution
-
setStream
Replace the random number stream. -
toString
-