public static double logPdf(double x,double shape,double scale){
  if (x < 0)   return Double.NEGATIVE_INFINITY;
  if (x == 0) {
    if (shape == 1.0)     return Math.log(1.0 / scale);
 else     return Double.NEGATIVE_INFINITY;
  }
  if (shape == 1.0) {
    return (-x / scale) - Math.log(scale);
  }
  if (shape == 0.0)   return -Math.log(x);
  if (shape == -0.5) {
    return 0.5 * Math.log(x);
  }
  return ((shape - 1.0) * (Math.log(x) - Math.log(scale)) - x / scale - GammaFunction.lnGamma(shape)) - Math.log(scale);
}

public static double logPdf ( double x , double shape , double scale ) { if ( x < 0 ) return Double . NEGATIVE_INFINITY ; if ( x == 0 ) { if ( shape == 1.0 ) return Math . log ( 1.0 / scale ) ; else return Double . NEGATIVE_INFINITY ; } if ( shape == 1.0 ) { return ( - x / scale ) - Math . log ( scale ) ; } if ( shape == 0.0 ) return - Math . log ( x ) ; if ( shape == - 0.5 ) { return 0.5 * Math . log ( x ) ; } return ( ( shape - 1.0 ) * ( Math . log ( x ) - Math . log ( scale ) ) - x / scale - GammaFunction . lnGamma ( shape ) ) - Math . log ( scale ) ; }
the natural log of the probability density function of the distribution
