Class PartitionedGEN

java.lang.Object
org.oristool.math.function.PartitionedGEN
All Implemented Interfaces:
PartitionedFunction

public class PartitionedGEN extends Object implements PartitionedFunction
Multidimensional PDF on a piecewise DBM zone support.
  • Constructor Details

    • PartitionedGEN

      public PartitionedGEN()
      Creates an empty PDF.
    • PartitionedGEN

      public PartitionedGEN(List<GEN> functions)
      Creates a new piecewise PDF from a list of PDFs with DBM zone support.
      Parameters:
      functions - PDFs with DBM zone support
    • PartitionedGEN

      public PartitionedGEN(PartitionedGEN partitionedGEN)
      Creates a copy of the input piecewise PDF.
      Parameters:
      partitionedGEN - input piecewise PDF
  • Method Details

    • newOneInstance

      public static PartitionedGEN newOneInstance()
      Creates an empty instance with integral equal to 1. This instance has empty support and density equal to 1; it can be used as neutral element in products with other PDFs.
      Returns:
      an empty PDF
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getFunctions

      public List<GEN> getFunctions()
      Specified by:
      getFunctions in interface PartitionedFunction
    • cartesianProduct

      public PartitionedGEN cartesianProduct(Function f)
      Returns the product with another PDF, which is the product of densities over the Cartesian product of supports.
      Parameters:
      f - input PDF
      Returns:
      product PDF
    • cartesianProduct

      public PartitionedGEN cartesianProduct(PartitionedFunction partitionedFunction)
      Returns the product with another partitioned function, which is the product of densities over the Cartesian product of supports.
      Parameters:
      partitionedFunction - input function
      Returns:
      product PDF
    • conditionToMin

      public BigDecimal conditionToMin(Variable v, OmegaBigDecimal min)
      Imposes the bound v >= min and normalizes the density.
      Parameters:
      v - target variable
      min - minimum value
      Returns:
      probability that the bound is satisfied (before normalization)
    • conditionToMax

      public BigDecimal conditionToMax(Variable v, OmegaBigDecimal max)
      Imposes the bound v <= max and normalizes the density.
      Parameters:
      v - target variable
      max - maximum value
      Returns:
      probability that the bound is satisfied (before normalization)
    • conditionToBound

      public BigDecimal conditionToBound(Variable v, OmegaBigDecimal min, OmegaBigDecimal max)
      Imposes the bound min <= v <= max and normalizes the density.
      Parameters:
      v - target variable
      min - minimum value
      max - maximum value
      Returns:
      probability that the bound is satisfied (before normalization)
    • shiftAndProject

      public void shiftAndProject(Variable var)
      Subtracts the input variable from all others and removes it.
      Parameters:
      var - target variable
    • project

      public void project(Variable var)
      Removes the input variable.
      Parameters:
      var - target variable
    • constantShift

      public void constantShift(BigDecimal constant)
      Subtracts a constant from all variables.
      Parameters:
      constant - input constant
    • constantShift

      public void constantShift(BigDecimal constant, Collection<Variable> variables)
      Subtracts a constant from a set of variables.
      Parameters:
      constant - input constant
      variables - variables to be shifted
    • substitute

      public void substitute(Variable oldVar, Variable newVar)
      Replaces one variable name with another one.
      Parameters:
      oldVar - old variable name
      newVar - new variable name
    • substitute

      public void substitute(Variable oldVar, Variable newVar, BigDecimal constant)
      Replaces one variable name with another one plus a constant.
      Parameters:
      oldVar - old variable name
      newVar - new variable name
      constant - constant to add
    • substituteAndShift

      public void substituteAndShift(Variable oldVar, Variable newVar, BigDecimal constant)
      Replaces oldVar with Variable.TSTAR and makes newVar - constant the new ground.
      Parameters:
      oldVar - old variable name
      newVar - new variable name
      constant - constant to subtract from newVar
    • integrateOverDomain

      public OmegaBigDecimal integrateOverDomain()
      Integrates this PDF over the support.

      The result should be 1, unless the support has been restricted without normalization.

      Returns:
      integral over the support
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getVariables

      public Set<Variable> getVariables()
      Returns the list of variables of this PDF.
      Returns:
      list of variables (not including Variable.TSTAR)
    • toMathematicaString

      public String toMathematicaString()
      Specified by:
      toMathematicaString in interface PartitionedFunction