Package org.opentrafficsim.core.dsol
Class DistNormalTrunc
- java.lang.Object
-
- nl.tudelft.simulation.jstats.distributions.Dist
-
- nl.tudelft.simulation.jstats.distributions.DistContinuous
-
- org.opentrafficsim.core.dsol.DistNormalTrunc
-
- All Implemented Interfaces:
Serializable
public class DistNormalTrunc extends DistContinuous
The Normal Truncated distribution. For more information on the normal distribution see http://mathworld.wolfram.com/NormalDistribution.htmlThis version of the normal distribution uses the numerically approached inverse cumulative distribution.
(c) copyright 2002-2018 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.- Author:
- Alexander Verbraeck
Wouter Schakel - See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DistNormalTrunc(StreamInterface stream, double min, double max)constructs a normal distribution with mu=0 and sigma=1.DistNormalTrunc(StreamInterface stream, double mu, double sigma, double min, double max)constructs a normal distribution with mu and sigma.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledraw()doublegetCumulativeProbability(double x)returns the cumulative probability of the x-value.doublegetInverseCumulativeProbability(double cumulativeProbability)returns the x-value of the given cumulativePropability.static voidmain(String[] args)Test.doubleprobDensity(double x)StringtoString()
-
-
-
Constructor Detail
-
DistNormalTrunc
public DistNormalTrunc(StreamInterface stream, double min, double max)
constructs a normal distribution with mu=0 and sigma=1. Errors of various types, e.g., in the impact point of a bomb; quantities that are the sum of a large number of other quantities by the virtue of the central limit theorem.- Parameters:
stream- StreamInterface; the numberstreammin- double; minimum x-value of the distributionmax- double; maximum x-value of the distribution
-
DistNormalTrunc
public DistNormalTrunc(StreamInterface stream, double mu, double sigma, double min, double max)
constructs a normal distribution with mu and sigma.- Parameters:
stream- StreamInterface; the numberstreammu- double; the mediumsigma- double; the standard deviationmin- double; minimum x-value of the distributionmax- double; maximum x-value of the distribution
-
-
Method Detail
-
draw
public double draw()
- Specified by:
drawin classDistContinuous
-
getCumulativeProbability
public double getCumulativeProbability(double x)
returns the cumulative probability of the x-value.- Parameters:
x- double; the observation x- Returns:
- double the cumulative probability
-
getInverseCumulativeProbability
public double getInverseCumulativeProbability(double cumulativeProbability)
returns the x-value of the given cumulativePropability.- Parameters:
cumulativeProbability- double; reflects cum prob- Returns:
- double the inverse cumulative probability
-
probDensity
public double probDensity(double x)
- Specified by:
probDensityin classDistContinuous
-
main
public static void main(String[] args)
Test.- Parameters:
args- String[]; args
-
-