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.
Version:
$Id: $Id
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.
      Parameters:
      semIm - a SemIm object
      param1 - a Parameter object
      type - a ParamConstraintType object
      number - a double
  • Method Details

    • serializableInstance

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

      public ParamConstraintType getType()

      Getter for the field type.

      Returns:
      a ParamConstraintType object
    • setType

      public void setType(ParamConstraintType type)

      Setter for the field type.

      Parameters:
      type - a ParamConstraintType object
    • getNumber

      public double getNumber()

      Getter for the field number.

      Returns:
      a double
    • getParam2

      public Parameter getParam2()

      Getter for the field param2.

      Returns:
      a Parameter object
    • 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.
      Parameters:
      testValue - a double
      Returns:
      true if the value would satisfy the constraint.
    • getSemIm

      public SemIm getSemIm()

      Getter for the field semIm.

      Returns:
      a SemIm object