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.
- Version:
- $Id: $Id
- Author:
- Donald Crimbchin, josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
fixLatentErrorVariances.void
fixOneLoadingPerLatent.getCoefficientParameter
(Node nodeA, Node nodeB) getCoefficientParameter.getCovarianceParameter
(Node nodeA, Node nodeB) getCovarianceParameter.int
getDof()
getDof.getFreeParameters.getGraph()
Getter for the fieldgraph
.getLatentNodes.getMeanParameter
(Node node) getMeanParameter.getMeasuredNodes.String[]
getMeasuredVarNames.getParamComparison.getParameter
(Node nodeA, Node nodeB) getParameter.getParameter
(String name) getParameter.Getter for the fieldparameters
.Getter for the fieldvariableNodes
.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()
toString.
-
Constructor Details
-
SemPm
Constructs a BayesPm from the given Graph, which must be convertible first into a ProtoSemGraph and then into a SemGraph.- Parameters:
graph
- aGraph
object
-
SemPm
Constructs a new SemPm from the given SemGraph.- Parameters:
graph
- aSemGraph
object
-
SemPm
Copy constructor.- Parameters:
semPm
- aSemPm
object
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
SemPm
object
-
fixLatentErrorVariances
public void fixLatentErrorVariances()fixLatentErrorVariances.
-
fixOneLoadingPerLatent
public void fixOneLoadingPerLatent()fixOneLoadingPerLatent.
-
getGraph
Getter for the field
graph
.- Returns:
- the structural model graph this SEM PM is using.
-
getParameters
Getter for the field
parameters
.- Returns:
- a list of all the freeParameters, including variance, covariance, coefficient, and mean freeParameters.
-
getVariableNodes
Getter for the field
variableNodes
.- Returns:
- the list of variable nodes--that is, node that are not error nodes.
-
getMeasuredNodes
getMeasuredNodes.
- Returns:
- the list of measured variableNodes.
-
getLatentNodes
getLatentNodes.
- Returns:
- the list of latent variableNodes.
-
getParameter
getParameter.
- Parameters:
name
- aString
object- Returns:
- the first parameter encountered with the given name, or null if there is no such parameter.
-
getParameter
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
getCovarianceParameter.
-
getCoefficientParameter
getCoefficientParameter.
-
getMeanParameter
getMeanParameter.
-
getMeasuredVarNames
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
getParamComparison.
-
setParamComparison
Sets the comparison of parameter a to parameter b.- Parameters:
a
- aParameter
objectb
- aParameter
objectcomparison
- aParamComparison
object
-
getFreeParameters
getFreeParameters.
- Returns:
- a
List
object
-
getDof
public int getDof()getDof.
- Returns:
- the degrees of freedom for the model.
-
toString
toString.
-