Ejemplo n.º 1
0
  /**
   * Updates the proposal parameter, based on the target acceptance probability This method relies
   * on the proposal parameter being a decreasing function of acceptance probability.
   *
   * @param op The operator
   * @param logr
   */
  private void coerceAcceptanceProbability(CoercableMCMCOperator op, double logr) {

    if (isCoercable(op)) {
      final double p = op.getCoercableParameter();

      final double i = schedule.getOptimizationTransform(MCMCOperator.Utils.getOperationCount(op));

      final double target = op.getTargetAcceptanceProbability();

      final double newp = p + ((1.0 / (i + 1.0)) * (Math.exp(logr) - target));

      if (newp > -Double.MAX_VALUE && newp < Double.MAX_VALUE) {
        op.setCoercableParameter(newp);
      }
    }
  }
Ejemplo n.º 2
0
  private boolean isCoercable(CoercableMCMCOperator op) {

    return op.getMode() == CoercionMode.COERCION_ON
        || (op.getMode() != CoercionMode.COERCION_OFF && useCoercion);
  }