Class Parameter

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

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

    • Parameter

      public Parameter(String name, ParamType type, Node nodeA, Node nodeB)
      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

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

      public String getName()
      Returns:
      the name of the parameter.
    • setName

      public void setName(String name)
      Sets the name for this parameter.
      Throws:
      IllegalArgumentException - if the name does not begin with a letter.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      a string representation for this parameter.
    • getNodeA

      public Node getNodeA()
      Returns:
      the "from" node for the edge this parameter is associated with.
    • getNodeB

      public Node getNodeB()
      Returns:
      the "to" node for the edge this parameter is associated with.
    • getType

      public ParamType getType()
      Returns:
      the type of this parameter--ParamType.COEF or ParamType.COVAR. This is set at construction time.
    • getDistribution

      public Distribution getDistribution()
      Returns:
      the distributions that initial values should be drawn from for this parameter.
    • setDistribution

      public void setDistribution(Distribution distribution)
      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.