Class SemEstimatorGibbs

java.lang.Object
edu.cmu.tetrad.sem.SemEstimatorGibbs

public final class SemEstimatorGibbs extends Object
Implements the Gibbs sampler apporach to obtain samples of arbitrary size from the posterior distribution over the freeParameters of a SEM given a continuous dataset and a SemPm. Point estimates, standard deviations and interval estimates for the freeParameters can be computed from these samples. See "Bayesian Estimation and Testing of Structural Equation Models" by Scheines, Hoijtink and Boomsma, Psychometrika, v. 64, no. 1.
Version:
$Id: $Id
Author:
Frank Wimberly
  • Constructor Summary

    Constructors
    Constructor
    Description
    SemEstimatorGibbs(int numIterations, double stretch1, double stretch2, double tolerance, double priorVariance, SemPm semPm, SemIm startIm, boolean flatPrior)
    Constructor for SemEstimatorGibbs.
    SemEstimatorGibbs(SemPm semPm, SemIm startIm, double[][] sampleCovars, boolean flatPrior, double stretch, int numIterations)
    Constructor for SemEstimatorGibbs.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Runs the estimator on the data and SemPm passed in through the constructor.
    Getter for the field dataSet.
    Getter for the field estimatedSem.
    Getter for the field semPm.
    toString.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SemEstimatorGibbs

      public SemEstimatorGibbs(SemPm semPm, SemIm startIm, double[][] sampleCovars, boolean flatPrior, double stretch, int numIterations)

      Constructor for SemEstimatorGibbs.

      Parameters:
      semPm - a SemPm specifying the graph and parameterization for the model.
      startIm - SemIm
      sampleCovars - sample covariance matrix
      flatPrior - whether or not the prior is informative
      stretch - scaling for the variance
      numIterations - number of times to iterate sampler
    • SemEstimatorGibbs

      public SemEstimatorGibbs(int numIterations, double stretch1, double stretch2, double tolerance, double priorVariance, SemPm semPm, SemIm startIm, boolean flatPrior)

      Constructor for SemEstimatorGibbs.

      Parameters:
      numIterations - a int
      stretch1 - a double
      stretch2 - a double
      tolerance - a double
      priorVariance - a double
      semPm - a SemPm object
      startIm - a SemIm object
      flatPrior - a boolean
  • Method Details

    • estimate

      public void estimate()
      Runs the estimator on the data and SemPm passed in through the constructor.
    • getEstimatedSem

      public SemIm getEstimatedSem()

      Getter for the field estimatedSem.

      Returns:
      SemIm
    • toString

      public String toString()

      toString.

      Overrides:
      toString in class Object
      Returns:
      a string representation of the Sem.
    • getSemPm

      public SemPm getSemPm()

      Getter for the field semPm.

      Returns:
      a SemPm object
    • getDataSet

      public Matrix getDataSet()

      Getter for the field dataSet.

      Returns:
      a Matrix object