public ImpliedCovarianceDataAllWrapper(SemEstimatorWrapper wrapper) {
    //        int sampleSize = params.getSampleSize();
    //        boolean latentDataSaved = params.isIncludeLatents();
    SemEstimator semEstimator = wrapper.getSemEstimator();
    SemIm semIm1 = semEstimator.getEstimatedSem();

    if (semIm1 != null) {

      TetradMatrix matrix2D = semIm1.getImplCovar(true);
      int sampleSize = semIm1.getSampleSize();
      List<Node> variables =
          wrapper.getSemEstimator().getEstimatedSem().getSemPm().getVariableNodes();
      CovarianceMatrix cov = new CovarianceMatrix(variables, matrix2D, sampleSize);
      setDataModel(cov);
      setSourceGraph(wrapper.getSemEstimator().getEstimatedSem().getSemPm().getGraph());
      this.semIm = wrapper.getEstimatedSemIm();
    }

    LogDataUtils.logDataModelList(
        "Data simulated from a linear structural equation model.", getDataModelList());
  }
 /**
  * Generates a simple exemplar of this class to test serialization.
  *
  * @see TetradSerializableUtils
  */
 public static DataWrapper serializableInstance() {
   return new ImpliedCovarianceDataWrapper(SemEstimatorWrapper.serializableInstance());
 }