Class ParamConstraint

java.lang.Object
edu.cmu.tetrad.sem.ParamConstraint
All Implemented Interfaces:
TetradSerializable, Serializable

public class ParamConstraint extends Object implements TetradSerializable
A class for implementing constraints on the values of the freeParameters of of instances of the SemIm class. The constraint can either be on the value of a single parameter in relation to a given value (double) or it can constrain the relative values of two freeParameters. There is a companion class ParamConstraintType that specifies whether the constraint implements an equality, less than or greater than relation.
Author:
Frank Wimberly
See Also:
  • Constructor Details

    • ParamConstraint

      public ParamConstraint(SemIm semIm, Parameter param1, ParamConstraintType type, double number)
      The first constructor specifies the parameter and a number and the type of relation imposed by the constraint. The SemIm is required because the freeParameters' values are determined by it.
  • Method Details

    • serializableInstance

      public static ParamConstraint serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • getType

      public ParamConstraintType getType()
    • setType

      public void setType(ParamConstraintType type)
    • getNumber

      public double getNumber()
    • getParam2

      public Parameter getParam2()
    • wouldBeSatisfied

      public boolean wouldBeSatisfied(double testValue)
      This method is for testing whether a value that might be assigned to a parameter would satisfy it. This is useful during a procedure which searches possible values of freeParameters to find that value which is optimal with respect to some measure of fit of the parameterized SEM to some dataset.
      Returns:
      true if the value would satisfy the constraint.
    • getSemIm

      public SemIm getSemIm()