test_class.file: jtstoolkit/src/test/java/ec/tstoolkit/timeseries/calendars/EasterRelatedDayTest.java
test_class.identifier: EasterRelatedDayTest
test_case.body: @Test
      public void testLongTermCorrection() {
          double w = .88;
          EasterRelatedDay day = new EasterRelatedDay(-39, w);
          double[][] le = day.getLongTermMeanEffect(12);
          double p = 0;
          for (int i = 0; i < 6; ++i) {
              for (int j = 0; j < le.length; ++j) {
                  if (le[j] != null) {
                      p += le[j][i];
                  }
              }
          }
          org.junit.Assert.assertTrue(Math.abs(p - w) < 1e-9);
      }
test_case.class_method_signature: EasterRelatedDayTest.testLongTermCorrection()
test_case.full_signature: @Test public void testLongTermCorrection()
test_case.identifier: testLongTermCorrection
test_case.invocations: getLongTermMeanEffect assertTrue abs
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLongTermCorrection()
focal_class.declarator: dic = new HashMap<>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Integer, Day> dic = new HashMap<>();
focal_class.type: Map<Integer, Day>
focal_class.var_name: dic
focal_class.declarator: jdic = new HashMap<>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Integer, Day> jdic = new HashMap<>();
focal_class.type: Map<Integer, Day>
focal_class.var_name: jdic
focal_class.declarator: g_days = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
focal_class.modifier: private static final
focal_class.original_string: private static final int[] g_days = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
focal_class.type: int[]
focal_class.var_name: g_days
focal_class.declarator: offset
focal_class.modifier: public final
focal_class.original_string: public final int offset;
focal_class.type: int
focal_class.var_name: offset
focal_class.declarator: weight
focal_class.modifier: private final
focal_class.original_string: private final double weight;
focal_class.type: double
focal_class.var_name: weight
focal_class.declarator: julian
focal_class.modifier: private final
focal_class.original_string: private final boolean julian;
focal_class.type: boolean
focal_class.var_name: julian
focal_class.declarator: ShroveMonday = new EasterRelatedDay(-48)
focal_class.modifier: public static final
focal_class.original_string: public static final EasterRelatedDay ShroveMonday = new EasterRelatedDay(-48),
              ShroveTuesday = new EasterRelatedDay(-47),
              AshWednesday = new EasterRelatedDay(-46),
              Easter = new EasterRelatedDay(0),
              EasterMonday = new EasterRelatedDay(1),
              EasterFriday = new EasterRelatedDay(-2),
              EasterThursday = new EasterRelatedDay(-3),
              Ascension = new EasterRelatedDay(39),
              Pentecost = new EasterRelatedDay(49),
              PentecostMonday = new EasterRelatedDay(50),
              CorpusChristi = new EasterRelatedDay(60),
              JulianShroveMonday = new EasterRelatedDay(-48, true),
              JulianShroveTuesday = new EasterRelatedDay(-47, true),
              JulianAshWednesday = new EasterRelatedDay(-46, true),
              JulianEaster = new EasterRelatedDay(0, true),
              JulianEasterMonday = new EasterRelatedDay(1, true),
              JulianEasterFriday = new EasterRelatedDay(-2, true),
              JulianEasterThursday = new EasterRelatedDay(-3, true),
              JulianAscension = new EasterRelatedDay(39, true),
              JulianPentecost = new EasterRelatedDay(49, true),
              JulianPentecostMonday = new EasterRelatedDay(50, true),
              JulianCorpusChristi = new EasterRelatedDay(60, true);
focal_class.type: EasterRelatedDay
focal_class.var_name: ShroveMonday
focal_class.declarator: START = 80
focal_class.modifier: private static
focal_class.original_string: private static int START = 80, JSTART = 90, DEL = 35, JDEL = 43;
focal_class.type: int
focal_class.var_name: START
focal_class.file: jtstoolkit/src/main/java/ec/tstoolkit/timeseries/calendars/EasterRelatedDay.java
focal_class.identifier: EasterRelatedDay
focal_class.interfaces: implements ISpecialDay
focal_class.class_method_signature: EasterRelatedDay.EasterRelatedDay()
focal_class.full_signature: public  EasterRelatedDay()
focal_class.identifier: EasterRelatedDay
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  EasterRelatedDay()
focal_class.class_method_signature: EasterRelatedDay.EasterRelatedDay(int offset)
focal_class.full_signature: public  EasterRelatedDay(int offset)
focal_class.identifier: EasterRelatedDay
focal_class.modifiers: public
focal_class.parameters: (int offset)
focal_class.signature:  EasterRelatedDay(int offset)
focal_class.class_method_signature: EasterRelatedDay.EasterRelatedDay(int offset, boolean julian)
focal_class.full_signature: public  EasterRelatedDay(int offset, boolean julian)
focal_class.identifier: EasterRelatedDay
focal_class.modifiers: public
focal_class.parameters: (int offset, boolean julian)
focal_class.signature:  EasterRelatedDay(int offset, boolean julian)
focal_class.class_method_signature: EasterRelatedDay.EasterRelatedDay(int offset, double weight)
focal_class.full_signature: public  EasterRelatedDay(int offset, double weight)
focal_class.identifier: EasterRelatedDay
focal_class.modifiers: public
focal_class.parameters: (int offset, double weight)
focal_class.signature:  EasterRelatedDay(int offset, double weight)
focal_class.class_method_signature: EasterRelatedDay.EasterRelatedDay(int offset, double weight, boolean julian)
focal_class.full_signature: public  EasterRelatedDay(int offset, double weight, boolean julian)
focal_class.identifier: EasterRelatedDay
focal_class.modifiers: public
focal_class.parameters: (int offset, double weight, boolean julian)
focal_class.signature:  EasterRelatedDay(int offset, double weight, boolean julian)
focal_class.class_method_signature: EasterRelatedDay.reweight(double nweight)
focal_class.full_signature: public EasterRelatedDay reweight(double nweight)
focal_class.identifier: reweight
focal_class.modifiers: public
focal_class.parameters: (double nweight)
focal_class.return: EasterRelatedDay
focal_class.signature: EasterRelatedDay reweight(double nweight)
focal_class.class_method_signature: EasterRelatedDay.plus(int ndays)
focal_class.full_signature: public EasterRelatedDay plus(int ndays)
focal_class.identifier: plus
focal_class.modifiers: public
focal_class.parameters: (int ndays)
focal_class.return: EasterRelatedDay
focal_class.signature: EasterRelatedDay plus(int ndays)
focal_class.class_method_signature: EasterRelatedDay.isJulian()
focal_class.full_signature: public boolean isJulian()
focal_class.identifier: isJulian
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isJulian()
focal_class.class_method_signature: EasterRelatedDay.getWeight()
focal_class.full_signature: @Override public double getWeight()
focal_class.identifier: getWeight
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double getWeight()
focal_class.class_method_signature: EasterRelatedDay.match(Context context)
focal_class.full_signature: @Override public boolean match(Context context)
focal_class.identifier: match
focal_class.modifiers: @Override public
focal_class.parameters: (Context context)
focal_class.return: boolean
focal_class.signature: boolean match(Context context)
focal_class.class_method_signature: EasterRelatedDay.calcDay(int year)
focal_class.full_signature: public Day calcDay(int year)
focal_class.identifier: calcDay
focal_class.modifiers: public
focal_class.parameters: (int year)
focal_class.return: Day
focal_class.signature: Day calcDay(int year)
focal_class.class_method_signature: EasterRelatedDay.easter(int year)
focal_class.full_signature: private Day easter(int year)
focal_class.identifier: easter
focal_class.modifiers: private
focal_class.parameters: (int year)
focal_class.return: Day
focal_class.signature: Day easter(int year)
focal_class.class_method_signature: EasterRelatedDay.easter(int year, boolean jul)
focal_class.full_signature: private static Day easter(int year, boolean jul)
focal_class.identifier: easter
focal_class.modifiers: private static
focal_class.parameters: (int year, boolean jul)
focal_class.return: Day
focal_class.signature: Day easter(int year, boolean jul)
focal_class.class_method_signature: EasterRelatedDay.probEaster(int del)
focal_class.full_signature: private double probEaster(int del)
focal_class.identifier: probEaster
focal_class.modifiers: private
focal_class.parameters: (int del)
focal_class.return: double
focal_class.signature: double probEaster(int del)
focal_class.class_method_signature: EasterRelatedDay.getIterable(TsFrequency freq, Day start, Day end)
focal_class.full_signature: @Override public Iterable<IDayInfo> getIterable(TsFrequency freq, Day start, Day end)
focal_class.identifier: getIterable
focal_class.modifiers: @Override public
focal_class.parameters: (TsFrequency freq, Day start, Day end)
focal_class.return: Iterable<IDayInfo>
focal_class.signature: Iterable<IDayInfo> getIterable(TsFrequency freq, Day start, Day end)
focal_class.class_method_signature: EasterRelatedDay.getLongTermMeanEffect(int freq)
focal_class.full_signature: @Override public double[][] getLongTermMeanEffect(int freq)
focal_class.identifier: getLongTermMeanEffect
focal_class.modifiers: @Override public
focal_class.parameters: (int freq)
focal_class.return: double[][]
focal_class.signature: double[][] getLongTermMeanEffect(int freq)
focal_class.class_method_signature: EasterRelatedDay.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: EasterRelatedDay.equals(EasterRelatedDay other)
focal_class.full_signature: private boolean equals(EasterRelatedDay other)
focal_class.identifier: equals
focal_class.modifiers: private
focal_class.parameters: (EasterRelatedDay other)
focal_class.return: boolean
focal_class.signature: boolean equals(EasterRelatedDay other)
focal_class.class_method_signature: EasterRelatedDay.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: EasterRelatedDay.getSignificantDomain(TsFrequency freq, Day start, Day end)
focal_class.full_signature: @Override public TsDomain getSignificantDomain(TsFrequency freq, Day start, Day end)
focal_class.identifier: getSignificantDomain
focal_class.modifiers: @Override public
focal_class.parameters: (TsFrequency freq, Day start, Day end)
focal_class.return: TsDomain
focal_class.signature: TsDomain getSignificantDomain(TsFrequency freq, Day start, Day end)
focal_method.body: @Override
      public double[][] getLongTermMeanEffect(int freq) {
          // week day
  
          int w = offset % 7;
          if (w == 0) {
              return null;
          }
          if (w < 0) {
              w += 7;
          }
          // monday must be 0...
          --w;
  
          // Easter always falls between March, 22 and April, 25 (inclusive). The probability to get a specific day is defined by probEaster.
          // We don't take into account leap year. So, the solution is slightly wrong for offset
          // <= -50.
          // The considered day falls between ...
          int d0, d1;
          if (julian) {
              d0 = JSTART + offset;
              d1 = d0 + JDEL;
          } else {
              d0 = START + offset;
              d1 = d0 + DEL;
          }
          // d1 excluded
  
          int ifreq = (int) freq;
          int c = 12 / ifreq;
  
          int c0 = 0, c1 = 0;
          for (int i = 0; i < c; ++i) {
              c1 += g_days[i];
          }
  
          double[][] rslt = new double[ifreq][];
          for (int i = 0; i < ifreq;) {
              if (d0 < c1 && d1 > c0) {
                  double[] m = new double[7];
                  double x = 0;
                  for (int j = Math.max(d0, c0); j < Math.min(d1, c1); ++j) {
                      x += probEaster(j - d0);
                  }
                  m[w] = x * weight;
                  m[6] = -m[w];
                  rslt[i] = m;
              }
              // update c0, c1;
              c0 = c1;
              if (++i < ifreq) {
                  for (int j = 0; j < c; ++j) {
                      c1 += g_days[i * c + j];
                  }
              }
          }
          return rslt;
      }
focal_method.class_method_signature: EasterRelatedDay.getLongTermMeanEffect(int freq)
focal_method.full_signature: @Override public double[][] getLongTermMeanEffect(int freq)
focal_method.identifier: getLongTermMeanEffect
focal_method.invocations: max min probEaster
focal_method.modifiers: @Override public
focal_method.parameters: (int freq)
focal_method.return: double[][]
focal_method.signature: double[][] getLongTermMeanEffect(int freq)