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.
- Author:
- Joseph Ramsey
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new SemEstimator that uses the specified optimizer.DagScorer(ICovarianceMatrix covMatrix) Constructs a new SemEstimator that uses the specified optimizer.
- 
Method SummaryModifier and TypeMethodDescriptiondoubledoubleintgetDof()doublegetFml()The value of the maximum likelihood function for the getModel the model (Bollen 107).intdoubleintdoubleRuns the estimator on the data and SemPm passed in through the constructor.static ScorerGenerates a simple exemplar of this class to test serialization.toString()
- 
Constructor Details- 
DagScorerConstructs 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.)
 
- 
DagScorerConstructs 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- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.
- 
scoreRuns the estimator on the data and SemPm passed in through the constructor. Returns the fml score of the resulting model.
- 
getCovMatrix- Specified by:
- getCovMatrixin interface- Scorer
 
- 
toString
- 
getFmlpublic double getFml()The value of the maximum likelihood function for the getModel the model (Bollen 107). To optimize, this should be minimized.
- 
getBicScorepublic double getBicScore()- Specified by:
- getBicScorein interface- Scorer
- Returns:
- BIC score, calculated as chisq - dof. This is equal to getFullBicScore() up to a constant.
 
- 
getChiSquarepublic double getChiSquare()- Specified by:
- getChiSquarein interface- Scorer
- Returns:
- the chi square value for the model.
 
- 
getPValuepublic double getPValue()
- 
getDataSet- Specified by:
- getDataSetin interface- Scorer
 
- 
getNumFreeParamspublic int getNumFreeParams()- Specified by:
- getNumFreeParamsin interface- Scorer
 
- 
getDofpublic int getDof()
- 
getSampleSizepublic int getSampleSize()- Specified by:
- getSampleSizein interface- Scorer
 
- 
getMeasuredNodes- Specified by:
- getMeasuredNodesin interface- Scorer
 
- 
getSampleCovar- Specified by:
- getSampleCovarin interface- Scorer
 
- 
getEdgeCoef- Specified by:
- getEdgeCoefin interface- Scorer
 
- 
getErrorCovar- Specified by:
- getErrorCovarin interface- Scorer
 
- 
getVariables- Specified by:
- getVariablesin interface- Scorer
 
- 
getEstSem
 
-