Package edu.cmu.tetrad.sem
Class SemPm
java.lang.Object
edu.cmu.tetrad.sem.SemPm
- All Implemented Interfaces:
Pm
,TetradSerializable
,Serializable
Parametric model for Structural Equation Models.
Note: Could not get a copy constructor to work properly, so to copy SemPm objects, use object serialization--e.g. java.rmu.MarshalledObject.
- Author:
- Donald Crimbchin, josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getCoefficientParameter
(Node nodeA, Node nodeB) getCovarianceParameter
(Node nodeA, Node nodeB) int
getDof()
getGraph()
getMeanParameter
(Node node) String[]
getParameter
(Node nodeA, Node nodeB) getParameter
(String name) getVarianceParameter
(Node node) Return the parameter for the variance of the error term for the given node, which is the variance of the node if the node is an error term, and the variance of the node's error term if not.static SemPm
Generates a simple exemplar of this class to test serialization.void
setParamComparison
(Parameter a, Parameter b, ParamComparison comparison) Sets the comparison of parameter a to parameter b.toString()
-
Constructor Details
-
SemPm
Constructs a BayesPm from the given Graph, which must be convertible first into a ProtoSemGraph and then into a SemGraph. -
SemPm
Constructs a new SemPm from the given SemGraph. -
SemPm
Copy constructor.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
fixLatentErrorVariances
public void fixLatentErrorVariances() -
fixOneLoadingPerLatent
public void fixOneLoadingPerLatent() -
getGraph
- Returns:
- the structural model graph this SEM PM is using.
-
getParameters
- Returns:
- a list of all the freeParameters, including variance, covariance, coefficient, and mean freeParameters.
-
getVariableNodes
- Returns:
- the list of variable nodes--that is, node that are not error nodes.
-
getMeasuredNodes
- Returns:
- the list of measured variableNodes.
-
getLatentNodes
- Returns:
- the list of latent variableNodes.
-
getParameter
- Returns:
- the first parameter encountered with the given name, or null if there is no such parameter.
-
getParameter
-
getVarianceParameter
Return the parameter for the variance of the error term for the given node, which is the variance of the node if the node is an error term, and the variance of the node's error term if not. -
getCovarianceParameter
-
getCoefficientParameter
-
getMeanParameter
-
getMeasuredVarNames
- Returns:
- the list of measured variable names in the order in which they appear in the list of nodes. (This order is fixed.)
-
getParamComparison
- Returns:
- the comparison of parameter a to parameter b.
-
setParamComparison
Sets the comparison of parameter a to parameter b. -
getFreeParameters
-
getDof
public int getDof()- Returns:
- the degrees of freedom for the model.
-
toString
-