コード例 #1
0
  public double mergeDiscreteValue(
      RealParameter removed, RealParameter merge, ConditionalCategoricalDistribution distr) {
    int removedModel = (int) (double) removed.getValue();
    int mergeModel = (int) (double) merge.getValue();

    return distr.logConditionalDensity(mergeModel, removedModel);
  }
コード例 #2
0
 public double proposeDiscreteValue(
     QuietRealParameter proposal,
     double oldValue,
     ConditionalCategoricalDistribution distr,
     double upper,
     double lower) {
   int oldModel = (int) oldValue;
   double newValue =
       Randomizer.randomChoicePDF(distr.conditionalDensities(oldModel)) + distr.getOffset();
   proposal.setValueQuietly(0, newValue);
   proposal.setBounds(lower, upper);
   return distr.logConditionalDensity(oldModel, (int) newValue);
 }