code: public double logp(int[] o) {
          double[][] alpha = new double[o.length][numStates];
          double[] scaling = new double[o.length];
  
          forward(o, alpha, scaling);
  
          double p = 0.0;
          for (int t = 0; t < o.length; t++) {
              p += java.lang.Math.log(scaling[t]);
          }
  
          return p;
      }
docs: Returns the logarithm probability of an observation sequence given this
  HMM. A scaling procedure is used in order to avoid underflows when
  computing the probability of long sequences.
  
  @param o an observation sequence.
  @return the log probability of this sequence.