logp_sd = self.sd_dist.logp(sd_vals).sum()
corr_diag = x[diag_idxs] / sd_vals
corr_logdet = np.log(corr_diag).sum()
// Compute the log det jacobian of the second transformation
// described in the docstring.
count = np.arange(self.n - 1)
det_invjac = - (count * tt.log(sd_vals[1:])).sum()
det_invjac += - tt.log(x[diag_idxs]).sum() + tt.log(x[0])
norm = _lkj_normalizing_constant(eta, self.n)
return norm + (self.n - 1) * corr_logdet + logp_sd + det_invjac
class LKJCorr(Continuous):
After Change
// Compute the log det jacobian of the second transformation
// described in the docstring.
idx = tt.arange(n)
det_invjac = tt.log(corr_diag) - idx * tt.log(sd_vals)det_invjac = det_invjac.sum()
norm = _lkj_normalizing_constant(eta, self.n)
return norm + logp_lkj + logp_sd + det_invjac