Skip to content

Commit

Permalink
Update documentation -- QM and QDM formulas (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger authored Feb 2, 2024
1 parent ea93a78 commit 445d2c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cmethods/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def quantile_mapping(
**kwargs: Any,
) -> np.ndarray:
r"""
**Do not call this function directly, please use :func:`cmethods.CMethods.adjust`**
**Do not call this function directly, please use :func:`cmethods.adjust`**
See https://python-cmethods.readthedocs.io/en/latest/src/methods.html#quantile-mapping
"""
check_adjust_called(
Expand Down Expand Up @@ -205,7 +205,7 @@ def quantile_delta_mapping(
**kwargs: Any,
) -> NPData:
r"""
**Do not call this function directly, please use :func:`cmethods.CMethods.adjust`**
**Do not call this function directly, please use :func:`cmethods.adjust`**
See https://python-cmethods.readthedocs.io/en/latest/src/methods.html#quantile-delta-mapping
"""
Expand Down
4 changes: 2 additions & 2 deletions cmethods/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def linear_scaling(
**kwargs: Any,
) -> NPData:
r"""
**Do not call this function directly, please use :func:`cmethods.CMethods.adjust`**
**Do not call this function directly, please use :func:`cmethods.adjust`**
See https://python-cmethods.readthedocs.io/en/latest/src/methods.html#linear-scaling
"""
Expand Down Expand Up @@ -125,7 +125,7 @@ def delta_method(
**kwargs: Any,
) -> NPData:
r"""
**Do not call this function directly, please use :func:`cmethods.CMethods.adjust`**
**Do not call this function directly, please use :func:`cmethods.adjust`**
See https://python-cmethods.readthedocs.io/en/latest/src/methods.html#delta-method
"""
check_adjust_called(
Expand Down
18 changes: 7 additions & 11 deletions doc/src/methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ In the following the equations of Alex J. Cannon (2015) are shown and explained:

**Multiplicative**:

.. math::
X^{*QM}_{sim,p}(i) = F^{-1}_{obs,h}\Biggl\{F_{sim,h}\left[\frac{\mu{X_{sim,h}} \cdot X_{sim,p}(i)}{\mu{X_{sim,p}(i)}}\right]\Biggr\}\frac{\mu{X_{sim,p}(i)}}{\mu{X_{sim,h}}}
The formula is the same as for the additive variant, but the values are
bound to the lower level of zero. The upper and lower boundary can be
adjusted by passing the hidden arguments ``val_min`` and ``val_max``.

.. code-block:: python
:linenos:
Expand Down Expand Up @@ -324,24 +324,20 @@ Preserve Changes in Quantiles and Extremes?"*
The following equations qre based on Alex J. Cannon (2015) but extended the
shift of :math:`X_{sim,p}(i)`:

**Shift of value range**:

.. math::
X_{sim,p}^{*DT}(i) = X_{sim,p}(i) + \Delta\mu
**Additive**:

.. math::
X_{sim,p}^{*DQM}(i) = F_{obs,h}^{-1}\left\{F_{sim,h}\left[X_{sim,p}^{*DT}(i)\right]\right\}
X_{sim,p}^{*DT}(i) & = X_{sim,p}(i) + \Delta\mu \\[1pt]
X_{sim,p}^{*DQM}(i) & = F_{obs,h}^{-1}\left\{F_{sim,h}\left[X_{sim,p}^{*DT}(i)\right]\right\}
**Multiplicative**:

.. math::
X^{*DQM}_{sim,p}(i) = F^{-1}_{obs,h}\Biggl\{F_{sim,h}\left[\frac{\mu{X_{sim,h}} \cdot X_{sim,p}^{*DT}(i)}{\mu{X_{sim,p}^{*DT}(i)}}\right]\Biggr\}\frac{\mu{X_{sim,p}^{*DT}(i)}}{\mu{X_{sim,h}}}
X_{sim,p}^{*DT}(i) & = X_{sim,p}(i) \cdot \Delta\mu \\[1pt]
X^{*DQM}_{sim,p}(i) & = F^{-1}_{obs,h}\Biggl\{F_{sim,h}\left[\frac{\mu{X_{sim,h}} \cdot X_{sim,p}^{*DT}(i)}{\mu{X_{sim,p}^{*DT}(i)}}\right]\Biggr\}\frac{\mu{X_{sim,p}^{*DT}(i)}}{\mu{X_{sim,h}}}
.. code-block:: python
Expand Down

0 comments on commit 445d2c4

Please sign in to comment.