Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Sep 25, 2024
1 parent 9206f8f commit 96ae522
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
8 changes: 0 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@
latex_engine = 'xelatex'
latex_elements = {'papersize': 'letterpaper'}

mathjax_config = {
'TeX': {
'Macros': {
'bar': r'\overline',
# Other macros can be added here
}
}
}
# source_suffix = {
# '.rst': 'restructuredtext',
# '.ipynb': 'nbsphinx',
Expand Down
25 changes: 9 additions & 16 deletions simba/mixins/statistics_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,13 +1366,6 @@ def spearman_rank_correlation(sample_1: np.ndarray, sample_2: np.ndarray) -> flo
Spearman's rank correlation coefficient assesses how well the relationship between two variables can be described using a monotonic function.
It computes the strength and direction of the monotonic relationship between ranked variables.
# .. math::
# ρ = 1 - \\frac{{6 ∑(d_i^2)}}{{n(n^2 - 1)}}
#
# where:
# - \( d_i \) is the difference between the ranks of corresponding elements in sample_1 and sample_2.
# - \( n \) is the number of observations.
.. seealso::
:func:`simba.data_processors.cuda.statistics.sliding_spearman_rank_correlation`,
:func:`simba.mixins.statistics.StatisticsMixin.sliding_spearman_rank_correlation`
Expand Down Expand Up @@ -1631,7 +1624,7 @@ def concordance_ratio(x: np.ndarray, invert: bool) -> float:
The equation for the concordance ratio :math:`C` is given by:
.. math::
C = \frac{N_c}{N_t}
C = \\frac{N_c}{N_t}
where:
- :math:`N_c` is the count of rows with only one unique value,
Expand All @@ -1640,7 +1633,7 @@ def concordance_ratio(x: np.ndarray, invert: bool) -> float:
If the `invert` parameter is set to `True`, the function will return the disconcordance ratio instead, defined as:
.. math::
D = \frac{N_d}{N_t}
D = \\frac{N_d}{N_t}
where:
Expand Down Expand Up @@ -3541,9 +3534,8 @@ def mad_median_rule(data: np.ndarray, k: int) -> np.ndarray:

@staticmethod
@njit("(float32[:], int64, float64[:], float64)")
def sliding_mad_median_rule(
data: np.ndarray, k: int, time_windows: np.ndarray, fps: float
) -> np.ndarray:
def sliding_mad_median_rule(data: np.ndarray, k: int, time_windows: np.ndarray, fps: float) -> np.ndarray:

"""
Count the number of outliers in a sliding time-window using the MAD-Median Rule.
Expand All @@ -3554,7 +3546,8 @@ def sliding_mad_median_rule(
:param int k: The outlier threshold defined as k * median absolute deviation in each time window.
:param np.ndarray time_windows: 1D array of time window sizes in seconds.
:param float fps: The frequency of the signal.
:return np.ndarray: Array of size (data.shape[0], time_windows.shape[0]) with counts if outliers detected.
:return: Array of size (data.shape[0], time_windows.shape[0]) with counts if outliers detected.
:rtype: np.ndarray
:example:
>>> data = np.random.randint(0, 50, (50000,)).astype(np.float32)
Expand Down Expand Up @@ -3590,7 +3583,7 @@ def dunn_index(x: np.ndarray, y: np.ndarray, sample: Optional[float] = None) ->
The Dunn Index is given by:
.. math::
D = \frac{\min_{i \neq j} \{ \delta(C_i, C_j) \}}{\max_k \{ \Delta(C_k) \}}
D = \\frac{\min_{i \neq j} \{ \delta(C_i, C_j) \}}{\max_k \{ \Delta(C_k) \}}
where :math:`\delta(C_i, C_j)` is the distance between clusters :math:`C_i` and :math:`C_j`, and
:math:`\Delta(C_k)` is the diameter of cluster :math:`C_k`.
Expand Down Expand Up @@ -3904,7 +3897,7 @@ def czebyshev_distance(sample_1: np.ndarray, sample_2: np.ndarray) -> float:
.. note::
Normalize arrays sample_1 and sample_2 before passing it to ensure accurate results.
The equation for the Czebyshev distance is given by: :math:`D_\infty(p, q) = \max_i \left| p_i - q_i \right|`.
The equation for the Czebyshev distance is given by :math:`D_\infty(p, q) = \max_i \left| p_i - q_i \right|`.
.. seealso:
:func:`simba.mixins.statistics_mixin.Statistics.sliding_czebyshev_distance`
Expand Down Expand Up @@ -3977,7 +3970,7 @@ def sokal_michener(x: np.ndarray, y: np.ndarray, w: Optional[np.ndarray] = None)
Adapted from `umap <https://github.com/lmcinnes/umap/blob/e7f2fb9e5e772edd5c8f38612365ec6a35a54373/umap/distances.py#L468>`_.
.. math::
D(x, y) = \frac{2 \cdot \sum_{i} w_i \cdot \mathbb{1}(x_i \neq y_i)}{N + \sum_{i} w_i \cdot \mathbb{1}(x_i \neq y_i)}
D(x, y) = \\frac{2 \cdot \sum_{i} w_i \cdot \mathbb{1}(x_i \neq y_i)}{N + \sum_{i} w_i \cdot \mathbb{1}(x_i \neq y_i)}
where:
- :math:`x` and :math:`y` are the binary vectors or matrices.
Expand Down

0 comments on commit 96ae522

Please sign in to comment.