Skip to content

Commit

Permalink
Fix math in sigma attachment (#207)
Browse files Browse the repository at this point in the history
When reparametrizing sigma into explained variance + resigual sigma, tau
is not needed any more, but was mistakenly used in the model that lead
to instabilities and incorrect interpretation.
  • Loading branch information
ferrine authored Jul 5, 2023
1 parent ff98f06 commit dd3c44d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pymc_experimental/distributions/multivariate/r2d2m2cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def _R2D2M2CP_beta(
psi: tensor
probability of a coefficients to be positive
"""
tau2 = r2 / (1 - r2)
explained_variance = phi * pt.expand_dims(tau2 * output_sigma**2, -1)
explained_variance = phi * pt.expand_dims(r2 * output_sigma**2, -1)
mu_param, std_param = _psivar2musigma(psi, explained_variance, psi_mask=psi_mask)
if not centered:
with pm.Model(name):
Expand Down

0 comments on commit dd3c44d

Please sign in to comment.