Fix beta log den pdf calculation
@@ -53,8 +53,8 @@ public class Beta {
public static Diff dlnPdf(double alpha, double beta, double x) {
double dPdx = ((alpha - 1) / x) - ((beta- 1) / (1 - x));
- double dPda = gamma(alpha + beta) * digamma(alpha + beta) - (gamma(alpha) * digamma(alpha)) + Math.log(x);
- double dPdb = gamma(alpha + beta) * digamma(alpha + beta) - (gamma(beta) * digamma(beta)) + Math.log(1 - x);
+ double dPda = digamma(alpha + beta) - digamma(alpha) + Math.log(x);
+ double dPdb = digamma(alpha + beta) - digamma(beta) + Math.log(1 - x);
return new Diff(dPda, dPdb, dPdx);
}
