Skip to content
Open
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
6 changes: 3 additions & 3 deletions pymc_marketing/mmm/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,12 @@ def diversification_ratio(
The Diversification Ratio is calculated as:

.. math::
DR = \frac{\\sum_{i=1}^{n} w_i \\cdot \\sigma_i}{\\sigma_p}
DR = \frac{\sum_{i=1}^{n} w_i \cdot \sigma_i}{\sigma_p} \
Copy link
Contributor

@TeemuSailynoja TeemuSailynoja Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Sphinx documentation, the equation doesn't need a newline after the math call:

When the math is only one line of text, it can also be given as a directive argument:
.. math:: (a + b)^2 = a^2 + 2ab + b^2

Also, maybe the line should not terminate with \ which might be the cause of the rendering issue @williambdean is seeing..


where:
- :math:`w_i` is the weight of asset \\( i \\)
- :math:`\\sigma_i` is the volatility (standard deviation) of asset \\( i \\)
- :math:`\\sigma_p` is the volatility of the portfolio
- :math:`\sigma_i` is the volatility (standard deviation) of asset \\( i \\)
- :math:`\sigma_p` is the volatility of the portfolio

Parameters
----------
Expand Down