public static double logpdf(double val,double loc,double scale,double shape){
  val=(val - loc) / scale;
  double e=Math.exp(-val);
  return -(val + (shape + 1.0) * Math.log1p(e)) + Math.log(shape);
}

public static double logpdf ( double val , double loc , double scale , double shape ) { val = ( val - loc ) / scale ; double e = Math . exp ( - val ) ; return - ( val + ( shape + 1.0 ) * Math . log1p ( e ) ) + Math . log ( shape ) ; }
log probability density function . todo : untested .
