Skip to content

Commit 9391367

Browse files
committed
add comments to docstrings
1 parent 89ba19f commit 9391367

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pymc_experimental/distributions/multivariate.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ def R2D2M2CP(
127127
--------
128128
Here are arguments explained in a synthetic example
129129
130+
.. warning::
131+
132+
To use the prior in a linear regression
133+
134+
- make sure :math:`X` is centered around zero
135+
- intercept represents prior predictive mean when :math:`X` is centered
136+
130137
.. code-block:: python
131138
132139
import pymc_experimental as pmx
@@ -168,8 +175,11 @@ def R2D2M2CP(
168175
# NOTE: try both
169176
centered=True
170177
)
178+
# intercept prior centering should be around prior predictive mean
171179
intercept = y.mean()
172-
obs = pm.Normal("obs", intercept + X @ beta, eps, observed=y)
180+
# regressors should be centered around zero
181+
Xc = X - X.mean(0)
182+
obs = pm.Normal("obs", intercept + Xc @ beta, eps, observed=y)
173183
174184
There can be special cases by choosing specific set of arguments
175185

0 commit comments

Comments
 (0)