rename gradloglik -> gradlogpdf, fix matrix errors