Package edu.cmu.tetrad.sem
Class ParamConstraint
java.lang.Object
edu.cmu.tetrad.sem.ParamConstraint
- All Implemented Interfaces:
TetradSerializable
,Serializable
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 Summary
ConstructorsConstructorDescriptionParamConstraint
(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. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getSemIm()
getType()
static ParamConstraint
Generates a simple exemplar of this class to test serialization.void
setType
(ParamConstraintType type) boolean
wouldBeSatisfied
(double testValue) This method is for testing whether a value that might be assigned to a parameter would satisfy it.
-
Constructor Details
-
ParamConstraint
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
Generates a simple exemplar of this class to test serialization. -
getType
-
setType
-
getNumber
public double getNumber() -
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
-