for (int j = 0; j < m_Par.length; j++) { deltas[j] -= 2 * m_Ridge * m_Par[j]; }   for (int j = 0; j < Arr.length; j++) { Arr[j][j] += 2 * m_Ridge; }
  protected double calculateLogLikelihood(double [][] X, double [] Y, 					  Matrix jacobian, double [] deltas) {    double LL = 0;    double [][] Arr = new double [jacobian.numRows()][jacobian.numRows()];    for (int j = 0; j < Arr.length; j++) {      for (int k = 0; k < Arr.length; k++) {	Arr[j][k] = 0;      }      deltas[j] = 0;    }    // For each data point    for (int i = 0; i < X.length; i++) {	      // Evaluate the probability for this point using the current coefficients      double p = evaluateProbability(X[i]);      // Update the log-likelihood of this set of coefficients      if( Y[i]==1 ) {	LL = LL - 2 * Math.log(p);      } else {	LL = LL - 2 * Math.log(1 - p);      }      double w = p * (1 - p);     // Weight      double z = (Y[i] - p);      // The error of this prediction      for (int j = 0; j < Arr.length; j++) {	double xij = X[i][j];	deltas[j] += xij * z;	for (int k = j; k < Arr.length; k++) {	  Arr[j][k] += xij * X[i][k] * w;	}      }    }    // Fill out the rest of the array    for (int j = 1; j < Arr.length; j++) {      for (int k = 0; k < j; k++) {	Arr[j][k] = Arr[k][j];      }    }    for (int j = 0; j < Arr.length; j++) {      jacobian.setRow(j, Arr[j]);    }    /*    System.out.println("Jacobian:\n"+jacobian.toString());    System.out.print("Deltas: ");    for(int j = 0; j < deltas.length; j++)      System.out.print(" "+Utils.doubleToString(deltas[j],10,3));    System.out.println("");    */    return LL;  }