Esempio n. 1
0
  /**
   * Contructs the probability matrix for mixture estimation, given a set of support points and a
   * set of intervals.
   *
   * @param s the set of support points
   * @param intervals the intervals
   * @return the probability matrix
   */
  public PaceMatrix probabilityMatrix(DoubleVector s, PaceMatrix intervals) {

    int ns = s.size();
    int nr = intervals.getRowDimension();
    PaceMatrix p = new PaceMatrix(nr, ns);

    for (int i = 0; i < nr; i++) {
      for (int j = 0; j < ns; j++) {
        p.set(
            i,
            j,
            Maths.pchisq(intervals.get(i, 1), s.get(j))
                - Maths.pchisq(intervals.get(i, 0), s.get(j)));
      }
    }

    return p;
  }