Skip to content

Commit

Permalink
Merge pull request #414 from pymc-labs/syntax-warning
Browse files Browse the repository at this point in the history
Fix SyntaxWarning by making some docstrings raw
  • Loading branch information
drbenvincent authored Oct 9, 2024
2 parents 2c6a4dc + 553cf53 commit d31a033
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions causalpy/pymc_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,16 @@ def print_row(


class LinearRegression(PyMCModel):
"""
r"""
Custom PyMC model for linear regression.
Defines the PyMC model
.. math::
\\beta &\sim \mathrm{Normal}(0, 50)
\sigma &\sim \mathrm{HalfNormal}(1)
\mu &= X * \\beta
y &\sim \mathrm{Normal}(\mu, \sigma)
\beta &\sim \mathrm{Normal}(0, 50) \\
\sigma &\sim \mathrm{HalfNormal}(1) \\
\mu &= X \cdot \beta \\
y &\sim \mathrm{Normal}(\mu, \sigma) \\
Example
--------
Expand Down Expand Up @@ -230,20 +227,16 @@ def build_model(self, X, y, coords):


class WeightedSumFitter(PyMCModel):
"""
r"""
Used for synthetic control experiments.
Defines the PyMC model:
.. math::
\sigma &\sim \mathrm{HalfNormal}(1)
\\beta &\sim \mathrm{Dirichlet}(1,...,1)
\mu &= X * \\beta
y &\sim \mathrm{Normal}(\mu, \sigma)
\sigma &\sim \mathrm{HalfNormal}(1) \\
\beta &\sim \mathrm{Dirichlet}(1,...,1) \\
\mu &= X \cdot \beta \\
y &\sim \mathrm{Normal}(\mu, \sigma) \\
Example
--------
Expand Down Expand Up @@ -423,7 +416,7 @@ def fit(self, X, Z, y, t, coords, priors, ppc_sampler=None):


class PropensityScore(PyMCModel):
"""
r"""
Custom PyMC model for inverse propensity score models
.. note:
Expand All @@ -433,14 +426,10 @@ class PropensityScore(PyMCModel):
Defines the PyMC model
.. math::
\\beta &\sim \mathrm{Normal}(0, 1)
\sigma &\sim \mathrm{HalfNormal}(1)
\mu &= X * \\beta
p &= logit^{-1}(mu)
\beta &\sim \mathrm{Normal}(0, 1) \\
\sigma &\sim \mathrm{HalfNormal}(1) \\
\mu &= X \cdot \beta \\
p &= \text{logit}^{-1}(\mu) \\
t &\sim \mathrm{Bernoulli}(p)
Example
Expand Down

0 comments on commit d31a033

Please sign in to comment.