public class TruncatedDistribution extends ContinuousDistribution
pdf
for any value
outside that range will be 0.pdf(double)
, cdf(double)
, and the invCdf(double)
methods are implemented efficiently, with little overhead per call. All
other methods are approximated numerically, and incur more overhead.Constructor and Description |
---|
TruncatedDistribution(ContinuousDistribution base,
double min,
double max) |
Modifier and Type | Method and Description |
---|---|
double |
cdf(double x)
Computes the value of the Cumulative Density Function (CDF) at the given
point.
|
TruncatedDistribution |
clone() |
double[] |
getCurrentVariableValues()
Returns an array, where each value contains the value of a parameter in the distribution.
|
String |
getDistributionName()
Return the name of the distribution.
|
String[] |
getVariables()
Returns an array, where each value contains the name of a parameter in the distribution.
|
double |
invCdf(double p)
Computes the inverse Cumulative Density Function (CDF-1) at
the given point.
|
double |
max()
The maximum value for which the
#pdf(double) is meant to return
a value. |
double |
min()
The minimum value for which the
#pdf(double) is meant to return
a value. |
double |
mode()
Computes the mode of the distribution.
|
double |
pdf(double x)
Computes the value of the Probability Density Function (PDF) at the given point
|
void |
setUsingData(Vec data)
Attempts to set the variables used by this distribution based on population sample data,
assuming the sample data is from this type of distribution.
|
void |
setVariable(String var,
double value)
Sets one of the variables of this distribution by the name.
|
getDescriptiveName, getFunctionPDF, getIntegrationMax, getIntegrationMin, logPdf, mean, skewness, toString, variance
getFunctionCDF, invCdf, median, sample, sampleVec, standardDeviation
public TruncatedDistribution(ContinuousDistribution base, double min, double max)
public double pdf(double x)
ContinuousDistribution
pdf
in class ContinuousDistribution
x
- the value to get the PDFpublic double cdf(double x)
Distribution
cdf
in class ContinuousDistribution
x
- the value to get the CDF ofpublic double invCdf(double p)
Distribution
invCdf
in class ContinuousDistribution
p
- the probability valuepublic String getDistributionName()
ContinuousDistribution
getDistributionName
in class ContinuousDistribution
public String[] getVariables()
ContinuousDistribution
ContinuousDistribution.getCurrentVariableValues()
getVariables
in class ContinuousDistribution
public double[] getCurrentVariableValues()
ContinuousDistribution
ContinuousDistribution.getVariables()
getCurrentVariableValues
in class ContinuousDistribution
ContinuousDistribution.getVariables()
public void setVariable(String var, double value)
ContinuousDistribution
setVariable
in class ContinuousDistribution
var
- the variable to setvalue
- the value to setpublic TruncatedDistribution clone()
clone
in class ContinuousDistribution
public void setUsingData(Vec data)
ContinuousDistribution
setUsingData
in class ContinuousDistribution
data
- the data to use to attempt to fit againstpublic double mode()
Distribution
NaN
may be returned if the mode is not defined for the current values of the
distribution.mode
in class ContinuousDistribution
public double min()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.NEGATIVE_INFINITY
is a valid return
value.min
in class Distribution
#pdf(double)
is meant to
return a value.public double max()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.POSITIVE_INFINITY
is a valid return
value.max
in class Distribution
#pdf(double)
is meant to
return a value.Copyright © 2017. All rights reserved.