public double[][] getCovmat() {
    // Since we worked only on params with dofit=true, we need to expand the
    // matrix to cover all parameters.
    double[][] fullcov = new double[numparams][numparams];
    for(int i = 0, i2 = 0; i < numparams; i++) {
      for(int j = 0, j2 = 0; j < numparams; j++) {
        fullcov[i][j] = (dofit[i] && dofit[j]) ? covmat[i2][j2] : 0;
        if(dofit[j]) {
          j2++;
        }
      }
      if(dofit[i]) {
        i2++;
      }
    }
    return fullcov;
  }
public double [ ] [ ] getCovmat ( ) { double [ ] [ ] fullcov = new double [ numparams ] [ numparams ] ; for ( int i = 0 , i2 = 0 ; i < numparams ; i ++ ) { for ( int j = 0 , j2 = 0 ; j < numparams ; j ++ ) { fullcov [ i ] [ j ] = ( dofit [ i ] && dofit [ j ] ) ? covmat [ i2 ] [ j2 ] : 0 ; if ( dofit [ j ] ) { j2 ++ ; } } if ( dofit [ i ] ) { i2 ++ ; } } return fullcov ; }
Get the final covariance matrix.
<p>
Parameters that were not to be optimized are filled with zeros.

@return covariance matrix for all parameters