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.
Version:
$Id: $Id
Author:
Don Crimbchin (djc2@andrew.cmu.edu), josephramsey
See Also:
  • Constructor Details

    • Parameter

      public Parameter(String name, ParamType type, Node nodeA, Node nodeB)

      Constructor for 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

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

      public String getName()

      Getter for the field name.

      Returns:
      the name of the parameter.
    • setName

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

      public String toString()

      toString.

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

      public Node getNodeA()

      Getter for the field nodeA.

      Returns:
      the "from" node for the edge this parameter is associated with.
    • getNodeB

      public Node getNodeB()

      Getter for the field nodeB.

      Returns:
      the "to" node for the edge this parameter is associated with.
    • getType

      public ParamType getType()

      Getter for the field type.

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

      public Distribution getDistribution()

      Getter for the field distribution.

      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.
      Parameters:
      distribution - a Distribution object
      See Also:
    • isFixed

      public boolean isFixed()

      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()

      Getter for the field startingValue.

      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.
      Parameters:
      startingValue - a double
    • isInitializedRandomly

      public boolean isInitializedRandomly()

      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.
      Parameters:
      initializedRandomly - a boolean