Example #1
0
  public static List<Double> getMultipleExponentialRegressionModel(int historyDataFromYear) {
    List<Double> aiList = null;
    try {
      Connection connection = ConnectionHelper.getConnection();
      aiList = getMultipleExponentialRegressionModel(historyDataFromYear, connection);
      connection.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    return aiList;
  }
Example #2
0
  public static double execute(
      int historyDataFromYear,
      int YEAR,
      int AREA_TYPE,
      int AREA_NUM_OF_SHOPPING_CENTER,
      int AREA_NUM_OF_STORE,
      double SQUARE_METER,
      double SUPPLIERS,
      double COSMECEUTICALS,
      double OTC,
      double RX,
      int IS_MEDICARE,
      int LOC_NUM_OF_SHOPPING_CENTER,
      int LOC_NUM_OF_OFFICE_BUILDING,
      int LOC_NUM_OF_HOSPITAL,
      int LOC_NUM_OF_RESID_NORMAL,
      int LOC_NUM_OF_RESID_ADVANCED,
      int LOC_NUM_OF_BUSSTOP,
      int LOC_NUM_OF_METRO) {

    List<Double> aiList = null;
    try {
      Connection connection = ConnectionHelper.getConnection();
      aiList = getMultipleExponentialRegressionModel(historyDataFromYear, connection);
      connection.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    double exponential =
        aiList.get(1) * YEAR
            + aiList.get(2) * AREA_TYPE
            + aiList.get(3) * AREA_NUM_OF_SHOPPING_CENTER
            + aiList.get(4) * AREA_NUM_OF_STORE
            + aiList.get(5) * SQUARE_METER
            + aiList.get(6) * SUPPLIERS
            + aiList.get(7) * COSMECEUTICALS
            + aiList.get(8) * OTC
            + aiList.get(9) * RX
            + aiList.get(10) * IS_MEDICARE
            + aiList.get(11) * LOC_NUM_OF_SHOPPING_CENTER
            + aiList.get(12) * LOC_NUM_OF_OFFICE_BUILDING
            + aiList.get(13) * LOC_NUM_OF_HOSPITAL
            + aiList.get(14) * LOC_NUM_OF_RESID_NORMAL
            + aiList.get(15) * LOC_NUM_OF_RESID_ADVANCED
            + aiList.get(16) * LOC_NUM_OF_BUSSTOP
            + aiList.get(17) * LOC_NUM_OF_METRO;

    return aiList.get(0) * Math.exp(exponential);
  }