test_class.file: momentsolver/src/test/java/com/github/stanfordfuturedata/momentsketch/MathUtilTest.java
test_class.identifier: MathUtilTest
test_case.body: @Test
      public void testChebyCoefficient() {
          int[][] cCoeffs = MathUtil.getChebyCoefficients(5);
          int[] expected = {0, -3, 0, 4, 0, 0};
          assertArrayEquals(expected, cCoeffs[3]);
      }
test_case.class_method_signature: MathUtilTest.testChebyCoefficient()
test_case.full_signature: @Test public void testChebyCoefficient()
test_case.identifier: testChebyCoefficient
test_case.invocations: getChebyCoefficients assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testChebyCoefficient()
focal_class.file: momentsolver/src/main/java/com/github/stanfordfuturedata/momentsketch/MathUtil.java
focal_class.identifier: MathUtil
focal_class.class_method_signature: MathUtil.getBinomials(int m)
focal_class.full_signature: public static long[][] getBinomials(int m)
focal_class.identifier: getBinomials
focal_class.modifiers: public static
focal_class.parameters: (int m)
focal_class.return: long[][]
focal_class.signature: long[][] getBinomials(int m)
focal_class.class_method_signature: MathUtil.getChebyCoefficients(int k)
focal_class.full_signature: public static int[][] getChebyCoefficients(int k)
focal_class.identifier: getChebyCoefficients
focal_class.modifiers: public static
focal_class.parameters: (int k)
focal_class.return: int[][]
focal_class.signature: int[][] getChebyCoefficients(int k)
focal_class.class_method_signature: MathUtil.shiftPowerSum(
              double[] powerSums,
              double r,
              double xc
      )
focal_class.full_signature: public static double[] shiftPowerSum(
              double[] powerSums,
              double r,
              double xc
      )
focal_class.identifier: shiftPowerSum
focal_class.modifiers: public static
focal_class.parameters: (
              double[] powerSums,
              double r,
              double xc
      )
focal_class.return: double[]
focal_class.signature: double[] shiftPowerSum(
              double[] powerSums,
              double r,
              double xc
      )
focal_class.class_method_signature: MathUtil.powerSumsToZerodMoments(
              double[] powerSums,
              double min,
              double max
      )
focal_class.full_signature: public static double[] powerSumsToZerodMoments(
              double[] powerSums,
              double min,
              double max
      )
focal_class.identifier: powerSumsToZerodMoments
focal_class.modifiers: public static
focal_class.parameters: (
              double[] powerSums,
              double min,
              double max
      )
focal_class.return: double[]
focal_class.signature: double[] powerSumsToZerodMoments(
              double[] powerSums,
              double min,
              double max
      )
focal_class.class_method_signature: MathUtil.powerSumsToChebyMoments(
              double min,
              double max,
              double[] powerSums
      )
focal_class.full_signature: public static double[] powerSumsToChebyMoments(
              double min,
              double max,
              double[] powerSums
      )
focal_class.identifier: powerSumsToChebyMoments
focal_class.modifiers: public static
focal_class.parameters: (
              double min,
              double max,
              double[] powerSums
      )
focal_class.return: double[]
focal_class.signature: double[] powerSumsToChebyMoments(
              double min,
              double max,
              double[] powerSums
      )
focal_class.class_method_signature: MathUtil.arrayMean(double[] xs)
focal_class.full_signature: public static double arrayMean(double[] xs)
focal_class.identifier: arrayMean
focal_class.modifiers: public static
focal_class.parameters: (double[] xs)
focal_class.return: double
focal_class.signature: double arrayMean(double[] xs)
focal_class.class_method_signature: MathUtil.calcPowers(double x, double[] powers)
focal_class.full_signature: public static void calcPowers(double x, double[] powers)
focal_class.identifier: calcPowers
focal_class.modifiers: public static
focal_class.parameters: (double x, double[] powers)
focal_class.return: void
focal_class.signature: void calcPowers(double x, double[] powers)
focal_class.class_method_signature: MathUtil.entropy(double[] ps)
focal_class.full_signature: public static double entropy(double[] ps)
focal_class.identifier: entropy
focal_class.modifiers: public static
focal_class.parameters: (double[] ps)
focal_class.return: double
focal_class.signature: double entropy(double[] ps)
focal_class.class_method_signature: MathUtil.getMSE(double[] error)
focal_class.full_signature: public static double getMSE(double[] error)
focal_class.identifier: getMSE
focal_class.modifiers: public static
focal_class.parameters: (double[] error)
focal_class.return: double
focal_class.signature: double getMSE(double[] error)
focal_method.body: public static int[][] getChebyCoefficients(int k) {
          int[][] chebyCoeffs = new int[k+1][k+1];
          chebyCoeffs[0][0] = 1;
          if (k == 0) {
              return chebyCoeffs;
          }
          chebyCoeffs[1][1] = 1;
          for (int i = 2; i <= k; i++) {
              int[] c1 = chebyCoeffs[i-1];
              int[] c2 = chebyCoeffs[i-2];
              chebyCoeffs[i][0] = -c2[0];
              for (int j = 1; j <= i; j++) {
                  chebyCoeffs[i][j] = 2*c1[j-1] - c2[j];
              }
          }
          return chebyCoeffs;
      }
focal_method.class_method_signature: MathUtil.getChebyCoefficients(int k)
focal_method.full_signature: public static int[][] getChebyCoefficients(int k)
focal_method.identifier: getChebyCoefficients
focal_method.modifiers: public static
focal_method.parameters: (int k)
focal_method.return: int[][]
focal_method.signature: int[][] getChebyCoefficients(int k)