public static double[] deconvolve(final double[] p,final double rate){
  final double[] r=Arrays.copyOf(p,p.length);
  for (int k=0; k < p.length; k++) {
    for (int j=0; j < p.length; j++) {
      if (k + j < p.length) {
        r[k + j]-=rate * p[k] * p[j];
      }
    }
  }
  double sum=0;
  for (  final double q : r) {
    sum+=q;
  }
  sum=1 / sum;
  for (int k=0; k < r.length; k++) {
    r[k]*=sum;
  }
  return r;
}

public static double [ ] deconvolve ( final double [ ] p , final double rate ) { final double [ ] r = Arrays . copyOf ( p , p . length ) ; for ( int k = 0 ; k < p . length ; k ++ ) { for ( int j = 0 ; j < p . length ; j ++ ) { if ( k + j < p . length ) { r [ k + j ] -= rate * p [ k ] * p [ j ] ; } } } double sum = 0 ; for ( final double q : r ) { sum += q ; } sum = 1 / sum ; for ( int k = 0 ; k < r . length ; k ++ ) { r [ k ] *= sum ; } return r ; }
takes a probability distribution and reduces higher - order terms by contributions arising from combinations of lower order terms . it assumes the input distribution is suitable for this operation .
