File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
pymc_experimental/distributions Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,13 @@ def R2D2M2CP(
127
127
--------
128
128
Here are arguments explained in a synthetic example
129
129
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
+
130
137
.. code-block:: python
131
138
132
139
import pymc_experimental as pmx
@@ -168,8 +175,11 @@ def R2D2M2CP(
168
175
# NOTE: try both
169
176
centered=True
170
177
)
178
+ # intercept prior centering should be around prior predictive mean
171
179
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)
173
183
174
184
There can be special cases by choosing specific set of arguments
175
185
You can’t perform that action at this time.
0 commit comments