public static double pdf(double x,double k,double theta,double shift){
  if (x <= shift || x == Double.POSITIVE_INFINITY) {
    return 0.;
  }
  x=(x - shift) * theta;
  final double ex=Math.exp(x);
  return ex < Double.POSITIVE_INFINITY ? Math.exp(k * x - ex - GammaDistribution.logGamma(k)) * theta : 0.;
}

public static double pdf ( double x , double k , double theta , double shift ) { if ( x <= shift || x == Double . POSITIVE_INFINITY ) { return 0. ; } x = ( x - shift ) * theta ; final double ex = Math . exp ( x ) ; return ex < Double . POSITIVE_INFINITY ? Math . exp ( k * x - ex - GammaDistribution . logGamma ( k ) ) * theta : 0. ; }
expgamma distribution pdf ( with 0 . 0 for x & lt ; 0 )
