private static void computeProbabilitiesMultinomialLogistic(double[] responses){
  double[] r=responses.clone();
  for (int j=0; j < r.length; j++) {
    double sum=0;
    boolean overflow=false;
    for (int k=0; k < r.length; k++) {
      if (r[k] - r[j] > 700) {
        overflow=true;
        break;
      }
      sum+=Math.exp(r[k] - r[j]);
    }
    if (overflow) {
      responses[j]=0.0;
    }
 else {
      responses[j]=1.0 / sum;
    }
  }
}

private static void computeProbabilitiesMultinomialLogistic ( double [ ] responses ) { double [ ] r = responses . clone ( ) ; for ( int j = 0 ; j < r . length ; j ++ ) { double sum = 0 ; boolean overflow = false ; for ( int k = 0 ; k < r . length ; k ++ ) { if ( r [ k ] - r [ j ] > 700 ) { overflow = true ; break ; } sum += Math . exp ( r [ k ] - r [ j ] ) ; } if ( overflow ) { responses [ j ] = 0.0 ; } else { responses [ j ] = 1.0 / sum ; } } }
computes probabilities for the multinomial logistic model type .
