public static void mergeCovarianceState(CovarianceState state, CovarianceState otherState) { if (otherState.getCount() == 0) { return; } updateCovarianceState(state, otherState); }
@InputFunction public static void input(@AggregationState CovarianceState state, @SqlType(StandardTypes.DOUBLE) double dependentValue, @SqlType(StandardTypes.DOUBLE) double independentValue) { updateCovarianceState(state, independentValue, dependentValue); }
public static void updateRegressionState(RegressionState state, double x, double y) { double oldMeanX = state.getMeanX(); updateCovarianceState(state, x, y); state.setM2X(state.getM2X() + (x - oldMeanX) * (x - state.getMeanX())); }
public static void mergeRegressionState(RegressionState state, RegressionState otherState) { if (otherState.getCount() == 0) { return; } long na = state.getCount(); long nb = otherState.getCount(); state.setM2X(state.getM2X() + otherState.getM2X() + na * nb * Math.pow(state.getMeanX() - otherState.getMeanX(), 2) / (double) (na + nb)); updateCovarianceState(state, otherState); }
public static void updateCorrelationState(CorrelationState state, double x, double y) { double oldMeanX = state.getMeanX(); double oldMeanY = state.getMeanY(); updateCovarianceState(state, x, y); state.setM2X(state.getM2X() + (x - oldMeanX) * (x - state.getMeanX())); state.setM2Y(state.getM2Y() + (y - oldMeanY) * (y - state.getMeanY())); }
public static void mergeCorrelationState(CorrelationState state, CorrelationState otherState) { if (otherState.getCount() == 0) { return; } long na = state.getCount(); long nb = otherState.getCount(); state.setM2X(state.getM2X() + otherState.getM2X() + na * nb * Math.pow(state.getMeanX() - otherState.getMeanX(), 2) / (double) (na + nb)); state.setM2Y(state.getM2Y() + otherState.getM2Y() + na * nb * Math.pow(state.getMeanY() - otherState.getMeanY(), 2) / (double) (na + nb)); updateCovarianceState(state, otherState); }
public static void mergeCovarianceState(CovarianceState state, CovarianceState otherState) { if (otherState.getCount() == 0) { return; } updateCovarianceState(state, otherState); }
public static void updateRegressionState(RegressionState state, double x, double y) { updateCovarianceState(state, x, y); state.setSumXSquare(state.getSumXSquare() + x * x); }
@InputFunction public static void input(CovarianceState state, @SqlType(StandardTypes.DOUBLE) double dependentValue, @SqlType(StandardTypes.DOUBLE) double independentValue) { updateCovarianceState(state, independentValue, dependentValue); }
public static void updateCorrelationState(CorrelationState state, double x, double y) { updateCovarianceState(state, x, y); state.setSumXSquare(state.getSumXSquare() + x * x); state.setSumYSquare(state.getSumYSquare() + y * y); }
public static void mergeRegressionState(RegressionState state, RegressionState otherState) { if (otherState.getCount() == 0) { return; } updateCovarianceState(state, otherState); state.setSumXSquare(state.getSumXSquare() + otherState.getSumXSquare()); }
public static void mergeCorrelationState(CorrelationState state, CorrelationState otherState) { if (otherState.getCount() == 0) { return; } updateCovarianceState(state, otherState); state.setSumXSquare(state.getSumXSquare() + otherState.getSumXSquare()); state.setSumYSquare(state.getSumYSquare() + otherState.getSumYSquare()); }