Package edu.cmu.tetrad.sem
Class DagScorer
java.lang.Object
edu.cmu.tetrad.sem.DagScorer
- All Implemented Interfaces:
Scorer
,TetradSerializable
,Serializable
Estimates a SemIm given a CovarianceMatrix and a SemPm. (A DataSet may be substituted for the CovarianceMatrix.) Uses
regression to do the estimation, so this is only for DAG models. But the DAG model may be reset on the fly and the
estimation redone. Variables whose parents have not changed will not be reestimated. Intended to speed up estimation
for algorithm that require repeated estimation of DAG models over the same variables. Assumes all variables are
measured.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new SemEstimator that uses the specified optimizer.DagScorer
(ICovarianceMatrix covMatrix) Constructs a new SemEstimator that uses the specified optimizer. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getBicScore.double
getChiSquare.Getter for the fieldcovMatrix
.Getter for the fielddataSet
.int
getDof()
getDof.Getter for the fieldedgeCoef
.Getter for the fielderrorCovar
.getEstSem.double
getFml()
The value of the maximum likelihood function for the getModel the model (Bollen 107).getMeasuredNodes.int
getNumFreeParams.double
getPValue.Getter for the fieldsampleCovar
.int
getSampleSize.Getter for the fieldvariables
.double
Scores the given DAG using the implemented algorithm.static Scorer
Generates a simple exemplar of this class to test serialization.toString()
toString.
-
Constructor Details
-
DagScorer
Constructs a new SemEstimator that uses the specified optimizer.- Parameters:
dataSet
- a DataSet, all of whose variables are contained in the given SemPm. (They are identified by name.)
-
DagScorer
Constructs a new SemEstimator that uses the specified optimizer.- Parameters:
covMatrix
- a covariance matrix, all of whose variables are contained in the given SemPm. (They are identified by name.)
-
-
Method Details
-
serializableInstance
-
score
-
getCovMatrix
Getter for the field
covMatrix
.- Specified by:
getCovMatrix
in interfaceScorer
- Returns:
- a
ICovarianceMatrix
object
-
toString
-
getFml
-
getBicScore
public double getBicScore()getBicScore.
- Specified by:
getBicScore
in interfaceScorer
- Returns:
- BIC score, calculated as chisq - dof. This is equal to getFullBicScore() up to a constant.
-
getChiSquare
public double getChiSquare()getChiSquare.
- Specified by:
getChiSquare
in interfaceScorer
- Returns:
- the chi square value for the model.
-
getPValue
-
getDataSet
Getter for the field
dataSet
.- Specified by:
getDataSet
in interfaceScorer
- Returns:
- a
DataSet
object
-
getNumFreeParams
public int getNumFreeParams()getNumFreeParams.
- Specified by:
getNumFreeParams
in interfaceScorer
- Returns:
- a int
-
getDof
-
getSampleSize
public int getSampleSize()getSampleSize.
- Specified by:
getSampleSize
in interfaceScorer
- Returns:
- a int
-
getMeasuredNodes
getMeasuredNodes.
- Specified by:
getMeasuredNodes
in interfaceScorer
- Returns:
- a
List
object
-
getSampleCovar
Getter for the field
sampleCovar
.- Specified by:
getSampleCovar
in interfaceScorer
- Returns:
- a
Matrix
object
-
getEdgeCoef
Getter for the field
edgeCoef
.- Specified by:
getEdgeCoef
in interfaceScorer
- Returns:
- a
Matrix
object
-
getErrorCovar
Getter for the field
errorCovar
.- Specified by:
getErrorCovar
in interfaceScorer
- Returns:
- a
Matrix
object
-
getVariables
Getter for the field
variables
.- Specified by:
getVariables
in interfaceScorer
- Returns:
- a
List
object
-
getEstSem
-