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 TypeMethodDescriptiondoubleGetter for the fieldnumber.Getter for the fieldparam2.getSemIm()Getter for the fieldsemIm.getType()Getter for the fieldtype.static ParamConstraintGenerates a simple exemplar of this class to test serialization.voidsetType(ParamConstraintType type) Setter for the fieldtype.booleanwouldBeSatisfied(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- aSemImobjectparam1- aParameterobjecttype- aParamConstraintTypeobjectnumber- a double
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
ParamConstraintobject
-
getType
Getter for the field
type.- Returns:
- a
ParamConstraintTypeobject
-
setType
Setter for the field
type.- Parameters:
type- aParamConstraintTypeobject
-
getNumber
public double getNumber()Getter for the field
number.- Returns:
- a double
-
getParam2
Getter for the field
param2.- Returns:
- a
Parameterobject
-
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
Getter for the field
semIm.- Returns:
- a
SemImobject
-