public static double logpdf(double x,double mu,double shape){
  if (!(x > 0) || x == Double.POSITIVE_INFINITY) {
    return Double.NEGATIVE_INFINITY;
  }
  final double v=(x - mu) / mu;
  return v < Double.MAX_VALUE ? 0.5 * Math.log(shape / (MathUtil.TWOPI * x * x* x)) - shape * v * v / (2. * x) : Double.NEGATIVE_INFINITY;
}

public static double logpdf ( double x , double mu , double shape ) { if ( ! ( x > 0 ) || x == Double . POSITIVE_INFINITY ) { return Double . NEGATIVE_INFINITY ; } final double v = ( x - mu ) / mu ; return v < Double . MAX_VALUE ? 0.5 * Math . log ( shape / ( MathUtil . TWOPI * x * x * x ) ) - shape * v * v / ( 2. * x ) : Double . NEGATIVE_INFINITY ; }
probability density function of the wald distribution .
