Class SemOptimizerRicf
java.lang.Object
edu.cmu.tetrad.sem.SemOptimizerRicf
- All Implemented Interfaces:
SemOptimizer, TetradSerializable, Serializable
Optimizes a SEM using RICF for ADMGs (no selection bias).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of restarts used by the optimizer.voidOptimizes the given structural equation model by utilizing the RICF (Regression Iterative Conditional Fitting) algorithm based on the EJML library, tailored for models with ADMG (Acyclic Directed Mixed Graphs) and no selection bias.static SemOptimizerRicfCreates and returns a new instance of the SemOptimizerRicf class that is serializable.voidsetMaxIters(int maxIters) Sets the maximum number of iterations for the optimizer.voidsetNumRestarts(int numRestarts) Sets the number of restarts for the optimizer.voidsetTolerance(double tolerance) Sets the tolerance level for the optimizer.toString()Returns a string representation of the SemOptimizerRicf instance, providing information about the algorithm and underlying libraries.
-
Constructor Details
-
SemOptimizerRicf
public SemOptimizerRicf()Default constructor for the SemOptimizerRicf class. This class implements a structural equation model (SEM) optimizer using the Regression Iterative Conditional Fitting (RICF) algorithm. The optimizer is specifically designed for models with Acyclic Directed Mixed Graphs (ADMGs) and is built on the EJML library. The constructor initializes a new instance with default configurations. The optimizer allows customization, including setting the number of restarts, tolerance, and maximum iterations.
-
-
Method Details
-
serializableInstance
Creates and returns a new instance of the SemOptimizerRicf class that is serializable. This method is typically used for serialization purposes to provide a consistent and accessible way to instantiate the class.- Returns:
- a new serializable instance of the SemOptimizerRicf class.
-
optimize
Optimizes the given structural equation model by utilizing the RICF (Regression Iterative Conditional Fitting) algorithm based on the EJML library, tailored for models with ADMG (Acyclic Directed Mixed Graphs) and no selection bias. The method updates the SEM parameters such as edge coefficients, error variances, and error covariances based on the input specification.- Specified by:
optimizein interfaceSemOptimizer- Parameters:
semIm- the structural equation model (SEM) instance to be optimized. It must contain the sample covariance matrix and a defined SEM parameterization. The method checks for missing values in the covariance matrix, and an exception is thrown if such values are found. The number of restarts for the optimizer must be explicitly set to 1 before this method is called. Results are logged after the RICF optimization is complete.
-
getNumRestarts
public int getNumRestarts()Returns the number of restarts used by the optimizer.- Specified by:
getNumRestartsin interfaceSemOptimizer- Returns:
- the number of restarts currently set for the optimizer.
-
setNumRestarts
public void setNumRestarts(int numRestarts) Sets the number of restarts for the optimizer. The number of restarts determines how many times the optimization process is repeated to potentially improve results.- Specified by:
setNumRestartsin interfaceSemOptimizer- Parameters:
numRestarts- the number of restarts to set for the optimizer. Must be a non-negative integer.
-
setTolerance
public void setTolerance(double tolerance) Sets the tolerance level for the optimizer. The tolerance is typically used as a convergence criterion to determine when the optimization process should stop. A smaller value allows for more precise optimization but may increase computation time.- Parameters:
tolerance- the tolerance value to set. Must be a non-negative double.
-
setMaxIters
public void setMaxIters(int maxIters) Sets the maximum number of iterations for the optimizer. The maximum iteration limit is used to manage the computational effort and prevent the optimization process from running excessively long if convergence is not achieved within the specified limit.- Parameters:
maxIters- the maximum number of iterations to allow, specified as a positive integer.
-
toString
-