Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SyntaxWarning by making some docstrings raw #414

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading