@Override public KernelEstimator aggregate(KernelEstimator toAggregate) throws Exception { for (int i = 0; i < toAggregate.m_NumValues; i++) { addValue(toAggregate.m_Values[i], toAggregate.m_Weights[i]); } return this; }
@Override public KernelEstimator aggregate(KernelEstimator toAggregate) throws Exception { for (int i = 0; i < toAggregate.m_NumValues; i++) { addValue(toAggregate.m_Values[i], toAggregate.m_Weights[i]); } return this; }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param given the new value that data is conditional upon * @param weight the weight assigned to the data value */ public void addValue(double data, double given, double weight) { m_Estimators[(int)given].addValue(data, weight); }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param given the new value that data is conditional upon * @param weight the weight assigned to the data value */ public void addValue(double data, double given, double weight) { m_Estimators[(int)given].addValue(data, weight); }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param given the new value that data is conditional upon * @param weight the weight assigned to the data value */ public void addValue(double data, double given, double weight) { m_Estimators[(int)data].addValue(given, weight); m_Weights.addValue((int)data, weight); }
/** * Add a new data value to the current estimator. * * @param data the new data value * @param given the new value that data is conditional upon * @param weight the weight assigned to the data value */ public void addValue(double data, double given, double weight) { m_Estimators[(int)data].addValue(given, weight); m_Weights.addValue((int)data, weight); }
newEst.addValue(Double.valueOf(argv[i]).doubleValue(), Double.valueOf(argv[i + 1]).doubleValue());
newEst.addValue(Double.valueOf(argv[i]).doubleValue(), Double.valueOf(argv[i + 1]).doubleValue());
public static void testAggregation() { KernelEstimator ke = new KernelEstimator(0.01); KernelEstimator one = new KernelEstimator(0.01); KernelEstimator two = new KernelEstimator(0.01); java.util.Random r = new java.util.Random(1); for (int i = 0; i < 100; i++) { double z = r.nextDouble(); ke.addValue(z, 1); if (i < 50) { one.addValue(z, 1); } else { two.addValue(z, 1); } } try { System.out.println("\n\nFull\n"); System.out.println(ke.toString()); System.out.println("Prob (0): " + ke.getProbability(0)); System.out.println("\nOne\n" + one.toString()); System.out.println("Prob (0): " + one.getProbability(0)); System.out.println("\nTwo\n" + two.toString()); System.out.println("Prob (0): " + two.getProbability(0)); one = one.aggregate(two); System.out.println("Aggregated\n"); System.out.println(one.toString()); System.out.println("Prob (0): " + one.getProbability(0)); } catch (Exception ex) { ex.printStackTrace(); } }
public static void testAggregation() { KernelEstimator ke = new KernelEstimator(0.01); KernelEstimator one = new KernelEstimator(0.01); KernelEstimator two = new KernelEstimator(0.01); java.util.Random r = new java.util.Random(1); for (int i = 0; i < 100; i++) { double z = r.nextDouble(); ke.addValue(z, 1); if (i < 50) { one.addValue(z, 1); } else { two.addValue(z, 1); } } try { System.out.println("\n\nFull\n"); System.out.println(ke.toString()); System.out.println("Prob (0): " + ke.getProbability(0)); System.out.println("\nOne\n" + one.toString()); System.out.println("Prob (0): " + one.getProbability(0)); System.out.println("\nTwo\n" + two.toString()); System.out.println("Prob (0): " + two.getProbability(0)); one = one.aggregate(two); System.out.println("Aggregated\n"); System.out.println(one.toString()); System.out.println("Prob (0): " + one.getProbability(0)); } catch (Exception ex) { ex.printStackTrace(); } }