From 7d818d4fe756c7b469617b97cce6689fb25e2d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Desu=C3=B3=20N?= Date: Sat, 19 Oct 2024 16:47:53 -0300 Subject: [PATCH] docs: fix math equations --- src/banquo/banquo.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/banquo/banquo.py b/src/banquo/banquo.py index eadf211..2ed271b 100644 --- a/src/banquo/banquo.py +++ b/src/banquo/banquo.py @@ -233,7 +233,7 @@ def divide_ns(x1: array, x2: array) -> array: The function relies on the formula: .. math:: - \\frac{x_1}{x_2} = \\text{sign}(x_1)\\text{sign}(x_2) \\exp\\left(\\log(\\lvert x_1\\rvert) - \\log(\\lvert x_2\\rvert)\\right)\\,. + \frac{x_1}{x_2} = \text{sign}(x_1)\text{sign}(x_2) \exp\left(\log(\lvert x_1\rvert) - \log(\lvert x_2\rvert)\right)\,. Parameters ---------- @@ -261,11 +261,11 @@ def multiply_ns(x1: array, x2: array | None = None) -> array | float: r"""Numerically stable multiplication. Given two arrays of the same shape, `x1` and `x2`, this function - performs a numerically stable element-wise division :math:`x_1 \\times x_2`. + performs a numerically stable element-wise division :math:`x_1 \times x_2`. The function relies on the formula: .. math:: - x_1 \\times x_2 = \\text{sign}(x_1)\\text{sign}(x_2) \\exp\\left(\\log(\\lvert x_1\\rvert) + \\log(\\lvert x_2\\rvert)\\right)\\,. + x_1 \times x_2 = \text{sign}(x_1)\text{sign}(x_2) \exp\left(\log(\lvert x_1\rvert) + \log(\lvert x_2\rvert)\right)\,. Parameters ---------- @@ -360,19 +360,19 @@ def extract_minmax_parameters(x: array, support: array | None = None) -> array: These parameters can be applied into the linear transformation, given by, .. math:: - y = \\frac{-a}{b-a} + \\frac{1}{b-a} x, + y = \frac{-a}{b-a} + \frac{1}{b-a} x, to make the data bounded by :math:`[0, 1]`. Where :math:`a` and :math:`b`. are given by: .. math:: - a & = \\max\\{X_{(1)} - \\sqrt{S^2/n}, a'\\},\\\\ - b & = \\min\\{X_{(n)} + \\sqrt{S^2/n}, b'\\}, + a & = \max\{X_{(1)} - \sqrt{S^2/n}, a'\},\\ + b & = \min\{X_{(n)} + \sqrt{S^2/n}, b'\}, with :math:`S^2` representing the sample variance, and :math:`X_{(1)}` and :math:`X_{(n)}` denoting the first and last - order statistics, respectively. In this formula :math:`x \\in [a', b']` + order statistics, respectively. In this formula :math:`x \in [a', b']` Parameters @@ -382,7 +382,7 @@ def extract_minmax_parameters(x: array, support: array | None = None) -> array: support : array | None, optional Two-elements array containing the lower and upper bounds for the elements, by default None. If None, `support` - is the unbounded interval :math:`(-\\infty, \\infty)`. + is the unbounded interval :math:`(-\infty, \infty)`. Returns -------