Esempio n. 1
0
 public void computeAuxiliary(
     ObservationsReader observations, CandidateSelectionPolicy candidateSelectionPolicy) {
   if (this.auxiliary != null) {
     throw new IllegalStateException("Auxiliary was already set");
   }
   this.auxiliary =
       new ICEstimateAuxiliary(originalModel.getSn(), observations, candidateSelectionPolicy);
 }
Esempio n. 2
0
 /**
  * Computes and stores the partial fraction of covered propagations.
  *
  * <p>Works only if {@link #computeFractionOfPropagations} is true, otherwise does nothing.
  *
  * @param observations the observations
  * @param newProbs the probabilities of the current model
  * @param i a number indicating the number of edges so far
  */
 protected void computeAndStorePartialFractionOfPropagations(
     ObservationsReader observations, SparseDoubleMatrix2D newProbs, int i) {
   if (computeFractionOfPropagations) {
     ICModel tempModel = new ICModel(originalModel.getSn(), newProbs);
     double sparsifiedFraction = tempModel.getTotalFraction(observations);
     storePartialResult(Measure.FRACTION_OF_PROPAGATIONS, i, sparsifiedFraction);
   }
 }
Esempio n. 3
0
 protected double computeAndStorePartialLogLikelihood(int k, SparseDoubleMatrix2D newProbs) {
   ICModel model = new ICModel(originalModel.getSn(), newProbs);
   double logLikelihood = model.getLogLikelihoodIgnoringParentInformation(auxiliary);
   storePartialResult(Measure.LOG_L, k, logLikelihood);
   return logLikelihood;
 }