question: public static double logpdf ( double x , double mu , double sigma , double xi ) { x = ( x - mu ) / sigma ; if ( x < 0 || ( xi < 0 && x > - 1. / xi ) ) { return Double . NEGATIVE_INFINITY ; } if ( xi == 0 ) { return Double . POSITIVE_INFINITY ; } return ( ( xi == - 1 ) ? 0. : Math . log ( 1 + xi * x ) * ( - 1 / xi - 1 ) ) - Math . log ( sigma ) ; }
target:  PDF of GPD distribution