Class SemPm

java.lang.Object
edu.cmu.tetrad.sem.SemPm
All Implemented Interfaces:
Pm, TetradSerializable, Serializable

public final class SemPm extends Object implements Pm, TetradSerializable
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 Details

    • SemPm

      public SemPm(Graph graph)
      Constructs a BayesPm from the given Graph, which must be convertible first into a ProtoSemGraph and then into a SemGraph.
    • SemPm

      public SemPm(SemGraph graph)
      Constructs a new SemPm from the given SemGraph.
    • SemPm

      public SemPm(SemPm semPm)
      Copy constructor.
  • Method Details

    • serializableInstance

      public static SemPm serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • fixLatentErrorVariances

      public void fixLatentErrorVariances()
    • fixOneLoadingPerLatent

      public void fixOneLoadingPerLatent()
    • getGraph

      public SemGraph getGraph()
      Returns:
      the structural model graph this SEM PM is using.
    • getParameters

      public List<Parameter> getParameters()
      Returns:
      a list of all the freeParameters, including variance, covariance, coefficient, and mean freeParameters.
    • getVariableNodes

      public List<Node> getVariableNodes()
      Returns:
      the list of variable nodes--that is, node that are not error nodes.
    • getMeasuredNodes

      public List<Node> getMeasuredNodes()
      Returns:
      the list of measured variableNodes.
    • getLatentNodes

      public List<Node> getLatentNodes()
      Returns:
      the list of latent variableNodes.
    • getParameter

      public Parameter getParameter(String name)
      Returns:
      the first parameter encountered with the given name, or null if there is no such parameter.
    • getParameter

      public Parameter getParameter(Node nodeA, Node nodeB)
    • getVarianceParameter

      public Parameter 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.
    • getCovarianceParameter

      public Parameter getCovarianceParameter(Node nodeA, Node nodeB)
    • getCoefficientParameter

      public Parameter getCoefficientParameter(Node nodeA, Node nodeB)
    • getMeanParameter

      public Parameter getMeanParameter(Node node)
    • getMeasuredVarNames

      public String[] 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

      public ParamComparison getParamComparison(Parameter a, Parameter b)
      Returns:
      the comparison of parameter a to parameter b.
    • setParamComparison

      public void setParamComparison(Parameter a, Parameter b, ParamComparison comparison)
      Sets the comparison of parameter a to parameter b.
    • getFreeParameters

      public List<Parameter> getFreeParameters()
    • getDof

      public int getDof()
      Returns:
      the degrees of freedom for the model.
    • toString

      public String toString()
      Overrides:
      toString in class Object