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.
- Version:
- $Id: $Id
- 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
Getter for the fieldnumber
.Getter for the fieldparam2
.getSemIm()
Getter for the fieldsemIm
.getType()
Getter for the fieldtype
.static ParamConstraint
Generates a simple exemplar of this class to test serialization.void
setType
(ParamConstraintType type) Setter for the fieldtype
.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.- Parameters:
semIm
- aSemIm
objectparam1
- aParameter
objecttype
- aParamConstraintType
objectnumber
- a double
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
ParamConstraint
object
-
getType
Getter for the field
type
.- Returns:
- a
ParamConstraintType
object
-
setType
Setter for the field
type
.- Parameters:
type
- aParamConstraintType
object
-
getNumber
public double getNumber()Getter for the field
number
.- Returns:
- a double
-
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.- Parameters:
testValue
- a double- Returns:
- true if the value would satisfy the constraint.
-
getSemIm
-