Package edu.cmu.tetrad.sem
Class Parameter
java.lang.Object
edu.cmu.tetrad.sem.Parameter
- All Implemented Interfaces:
TetradSerializable
,Serializable
Stores information about the identity of a SEM parameter--its name, its type (COEF, COVAR), and the node(s) it is
associated with.
- Version:
- $Id: $Id
- Author:
- Don Crimbchin (djc2@andrew.cmu.edu), josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fielddistribution
.getName()
Getter for the fieldname
.getNodeA()
Getter for the fieldnodeA
.getNodeB()
Getter for the fieldnodeB
.double
Getter for the fieldstartingValue
.getType()
Getter for the fieldtype
.boolean
isFixed()
isFixed.boolean
isInitializedRandomly.static Parameter
Generates a simple exemplar of this class to test serialization.void
setDistribution
(Distribution distribution) Sets the distribution that initial values should be drawn from for this parameter.void
setFixed
(boolean fixed) Sets whether this parameter should be held fixed during estimation.void
setInitializedRandomly
(boolean initializedRandomly) Set to true iff this parameter should be initialized randomly by drawing an initial value from its preset random distribution.void
Sets the name for this parameter.void
setStartingValue
(double startingValue) Sets the starting value in case this is a fixed parameter.toString()
toString.
-
Constructor Details
-
Parameter
Constructor for Parameter.
- Parameters:
name
- The name of the parameter.type
- The type of the parameter--ParamType.COEF, ParamType.VAR, or ParamType.COVAR.nodeA
- The "from" node.nodeB
- The "to" node. (For variance freeParameters, this must be the same as the "from" node. For covariance freeParameters, it must be different from the "from" node.)
-
-
Method Details
-
serializableInstance
-
getName
-
setName
Sets the name for this parameter.- Parameters:
name
- aString
object- Throws:
IllegalArgumentException
- if the name does not begin with a letter.
-
toString
-
getNodeA
Getter for the field
nodeA
.- Returns:
- the "from" node for the edge this parameter is associated with.
-
getNodeB
Getter for the field
nodeB
.- Returns:
- the "to" node for the edge this parameter is associated with.
-
getType
Getter for the field
type
.- Returns:
- the type of this parameter--ParamType.COEF or ParamType.COVAR. This is set at construction time.
-
getDistribution
Getter for the field
distribution
.- Returns:
- the distributions that initial values should be drawn from for this parameter.
-
setDistribution
Sets the distribution that initial values should be drawn from for this parameter. To set the parameter to always use the same initial value, use tetrad.util.SingleValue.- Parameters:
distribution
- aDistribution
object- See Also:
-
isFixed
public boolean isFixed()isFixed.
- Returns:
- true iff this parameter should be held fixed during estimation.
-
setFixed
public void setFixed(boolean fixed) Sets whether this parameter should be held fixed during estimation.- Parameters:
fixed
- True if the parameter will be held fixed, false if not.
-
getStartingValue
public double getStartingValue()Getter for the field
startingValue
.- Returns:
- the starting value if this is a fixed parameter.
-
setStartingValue
public void setStartingValue(double startingValue) Sets the starting value in case this is a fixed parameter.- Parameters:
startingValue
- a double
-
isInitializedRandomly
public boolean isInitializedRandomly()isInitializedRandomly.
- Returns:
- true iff this parameter should be initialized randomly by drawing an initial value from its preset random distribution.
-
setInitializedRandomly
public void setInitializedRandomly(boolean initializedRandomly) Set to true iff this parameter should be initialized randomly by drawing an initial value from its preset random distribution.- Parameters:
initializedRandomly
- a boolean
-