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

Fixed the L-coratio definitions in the documentation #47

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 4 additions & 8 deletions lmo/_lm_co.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from numpy import typing as npt

from ._lm import l_weights
from ._utils import clean_order, ordered
from ._utils import broadstack, clean_order, ordered
from .typing import AnyInt, AnyTrim, IntVector, LComomentOptions, SortKind

if sys.version_info < (3, 11):
Expand Down Expand Up @@ -191,20 +191,16 @@ def l_coratio(
\tilde \Lambda_{rs}^{(t_1, t_2)} =
\left[
\left. \lambda_{r [ij]}^{(t_1, t_2)} \right/
\lambda_{s [jj]}^{(t_1, t_2)}
\lambda_{s [ii]}^{(t_1, t_2)}
\right]_{m \times m}
$$

See Also:
- [`lmo.l_comoment`][lmo.l_comoment]
- [`lmo.l_ratio`][lmo.l_ratio]
"""
rs = np.stack(np.broadcast_arrays(np.asarray(r), np.asarray(s)))
l_r, l_s = l_comoment(a, rs, trim, dtype=dtype, **kwargs)

l_s = np.diagonal(l_s, axis1=-2, axis2=-1)

return l_r / np.expand_dims(l_s, -1)
l_r, l_s = l_comoment(a, broadstack(r, s), trim, dtype=dtype, **kwargs)
return l_r / np.expand_dims(np.diagonal(l_s, axis1=-2, axis2=-1), -1)


def l_costats(
Expand Down
2 changes: 1 addition & 1 deletion lmo/theoretical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ def l_coratio_from_pdf(
\tilde \Lambda_{r,r_0}^{(s, t)} =
\left[
\left. \lambda_{r [ij]}^{(s, t)} \right/
\lambda_{r_0 [jj]}^{(s, t)}
\lambda_{r_0 [ii]}^{(s, t)}
\right]_{n \times n}
$$

Expand Down