Package org.oristool.math.function
Class GEN
java.lang.Object
org.oristool.math.function.GEN
- All Implemented Interfaces:
Function
,PartitionedFunction
- Direct Known Subclasses:
Erlang
Multidimensional PDF on a DBM zone support (non-piecewise).
-
Constructor Summary
ConstructorDescriptionGEN
(DBMZone domain, Expolynomial density) Builds a new PDF with the given support and density function.Builds a copy from a given function. -
Method Summary
Modifier and TypeMethodDescriptionComputes the product PDF with another set of random variables.computeNonIntersectingZones
(GEN gen, List<GEN> finalFunctions) Computes the PDF on support intersection and those of difference supports.conditionToBound
(Variable v, OmegaBigDecimal min, OmegaBigDecimal max) Imposes the boundmin <= v <= max
and normalizes the density.conditionToMax
(Variable v, OmegaBigDecimal max) Imposes the boundv <= max
and normalizes the density.conditionToMin
(Variable v, OmegaBigDecimal min) Imposes the boundv >= min
and normalizes the density.void
constantShift
(BigDecimal constant) Adds a constant to all variables in the PDF.void
constantShift
(BigDecimal constant, Collection<Variable> variables) Adds a constant to a set of variables in the PDF.boolean
static GEN
getDETInstance
(Variable v, BigDecimal value) Builds the PDF of a deterministic variable.getSubZonesInducted
(GEN gen) Computes the subzone PDFs induced by the support of a given PDF.int
hashCode()
Integrates the PDF over its support.static GEN
newDeterministic
(BigDecimal value) Builds the PDF of a deterministic variable.static GEN
newExpolynomial
(String density, OmegaBigDecimal eft, OmegaBigDecimal lft) Builds a PDF from an input string.static GEN
newHyperExp
(List<BigDecimal> probs, List<BigDecimal> rates) Builds the PDF of an hyper-exponential variable.static GEN
newHypoExp
(BigDecimal rate1, BigDecimal rate2) Builds the PDF of an hypo-exponential variable.static GEN
newShiftedExp
(BigDecimal shift, BigDecimal rate) Builds the PDF of a shifted exponential.static GEN
newTruncatedExp
(Variable v, BigDecimal rate, OmegaBigDecimal eft, OmegaBigDecimal lft) Builds the PDF of a truncated EXP.static GEN
newUniform
(OmegaBigDecimal eft, OmegaBigDecimal lft) Builds the PDF of a uniform variable.void
Normalizes the PDF, dividing its density by the integral over the support.Removes a variable from the PDF.Subtracts a variable from all others and removes it from the PDF.void
substitute
(Variable oldVar, Variable newVar) Replaces a variable name with another.void
substitute
(Variable oldVar, Variable newVar, BigDecimal constant) Replaces a variable name with another and adds a constant.void
substituteAndShift
(Variable oldVar, Variable newVar, BigDecimal constant) Replaces the ground withnewVar - constant
andoldVar
with the ground.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.oristool.math.function.Function
getFunctions
Methods inherited from interface org.oristool.math.function.PartitionedFunction
getDensities, getDomains, getDomainsEFT, getDomainsLFT
-
Constructor Details
-
GEN
Builds a new PDF with the given support and density function.- Parameters:
domain
- support of the PDFdensity
- density function of the PDF
-
GEN
Builds a copy from a given function.- Parameters:
f
- input function
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
normalize
public void normalize()Normalizes the PDF, dividing its density by the integral over the support. -
cartesianProduct
Computes the product PDF with another set of random variables.- Parameters:
f
- input PDF- Returns:
- product PDF
-
integrateOverDomain
Integrates the PDF over its support.- Returns:
- value of the integral
-
project
Removes a variable from the PDF.- Parameters:
v
- target variable- Returns:
- piecewise PDF resulting after removing the input variable
-
shiftAndProject
Subtracts a variable from all others and removes it from the PDF.- Parameters:
v
- target variable- Returns:
- piecewise PDF resulting after removing the input variable
-
computeNonIntersectingZones
Computes the PDF on support intersection and those of difference supports.- Parameters:
gen
- input PDFfinalFunctions
- list where difference PDFs are added- Returns:
- intersection PDF
-
getSubZonesInducted
Computes the subzone PDFs induced by the support of a given PDF.- Parameters:
gen
- input PDF- Returns:
- list of intersection PDFs
-
substitute
Replaces a variable name with another.- Parameters:
oldVar
- old variable namenewVar
- new variable name
-
substitute
Replaces a variable name with another and adds a constant.- Parameters:
oldVar
- old variable namenewVar
- new variable nameconstant
- constant to be added
-
constantShift
Adds a constant to all variables in the PDF.- Parameters:
constant
- constant to be added
-
constantShift
Adds a constant to a set of variables in the PDF.- Parameters:
constant
- constant to be addedvariables
- variables to be shifted
-
substituteAndShift
Replaces the ground withnewVar - constant
andoldVar
with the ground.- Parameters:
oldVar
- the new ground variablenewVar
- the variable to be removed from allconstant
- constant to be added to all
-
conditionToMin
Imposes the boundv >= min
and normalizes the density.- Parameters:
v
- target variablemin
- minimum value- Returns:
- probability that the bound is satisfied (before normalization)
-
conditionToMax
Imposes the boundv <= max
and normalizes the density.- Parameters:
v
- target variablemax
- maximum value- Returns:
- probability that the bound is satisfied (before normalization)
-
conditionToBound
Imposes the boundmin <= v <= max
and normalizes the density.- Parameters:
v
- target variablemin
- minimum valuemax
- maximum value- Returns:
- probability that the bound is satisfied (before normalization)
-
toString
-
toMathematicaString
- Specified by:
toMathematicaString
in interfaceFunction
- Specified by:
toMathematicaString
in interfacePartitionedFunction
-
getDomain
-
getDensity
- Specified by:
getDensity
in interfaceFunction
-
newTruncatedExp
public static GEN newTruncatedExp(Variable v, BigDecimal rate, OmegaBigDecimal eft, OmegaBigDecimal lft) Builds the PDF of a truncated EXP.- Parameters:
v
- variable namerate
- rate of the EXPeft
- start of the supportlft
- end of the support- Returns:
- truncated EXP PDF
-
newDeterministic
Builds the PDF of a deterministic variable.By convention, this PDF has density equal to 1 and support including only the input value.
- Parameters:
value
- value of the deterministic variable- Returns:
- deterministic PDF
-
getDETInstance
Builds the PDF of a deterministic variable.By convention, this PDF has density equal to 1 and support including only the input value.
- Parameters:
v
- variable namevalue
- value of the deterministic variable- Returns:
- deterministic PDF
-
newUniform
Builds the PDF of a uniform variable.- Parameters:
eft
- minimum valuelft
- maximum value- Returns:
- uniform PDF
-
newExpolynomial
Builds a PDF from an input string.- Parameters:
density
- string representing the PDFeft
- minimum valuelft
- maximum value- Returns:
- expolynomial PDF
-
newHyperExp
Builds the PDF of an hyper-exponential variable.- Parameters:
probs
- list of mixture probabilitiesrates
- list of exponential rates- Returns:
- hyper-exponential PDF
-
newHypoExp
Builds the PDF of an hypo-exponential variable.- Parameters:
rate1
- rate of the first exponentialrate2
- rate of the second exponential- Returns:
- hypo-exponential PDF
-
newShiftedExp
Builds the PDF of a shifted exponential.- Parameters:
shift
- shift amountrate
- rate of the EXP- Returns:
- shifted EXP PDF
-