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.
- Author:
- Don Crimbchin (djc2@andrew.cmu.edu), josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
getNodeA()
getNodeB()
double
getType()
boolean
isFixed()
boolean
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()
-
Constructor Details
-
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
Generates a simple exemplar of this class to test serialization. -
getName
- Returns:
- the name of the parameter.
-
setName
Sets the name for this parameter.- Throws:
IllegalArgumentException
- if the name does not begin with a letter.
-
toString
-
getNodeA
- Returns:
- the "from" node for the edge this parameter is associated with.
-
getNodeB
- Returns:
- the "to" node for the edge this parameter is associated with.
-
getType
- Returns:
- the type of this parameter--ParamType.COEF or ParamType.COVAR. This is set at construction time.
-
getDistribution
- 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.- See Also:
-
isFixed
public boolean 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()- 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. -
isInitializedRandomly
public boolean 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.
-