Skip to content

Commit d7df631

Browse files
Fixed some PyPi README issues
1 parent 147811f commit d7df631

3 files changed

Lines changed: 32 additions & 35 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ r_y^{\ast} = \frac{r_y - \overline{r_y}}{\sigma_{r_y}} .
148148
$$
149149

150150
Standardization doesn't affect $\mathbf{\Lambda_s}$ due to symmetrization but improves the stability of the asymmetric $\mathbf{\Lambda_{yx}/\Lambda_{xy}}$, especially when there are ties. Tests using
151-
Somers' D better agree on asymmetry when standardization is done, e.g., on binary data. Also, decreases the number of $\mathbf{\Lambda_{yx}/\Lambda_{xy}}$ sign disagreements for various scenarios (see [/tests/test_opposites.py](/tests/test_opposites.py))
151+
Somers' D better agree on asymmetry when standardization is done, e.g., on binary data. Also, decreases the number of $\mathbf{\Lambda_{yx}/\Lambda_{xy}}$ sign disagreements for various scenarios (see [/tests/test_opposites.py](/tests/test_opposites.py)).
152152

153153
3. For each anchor point sample *i*, compute the **median slope in rank space**:
154154

README_pypi.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ Given paired samples (x_i, y_i), i = 1...n: symmetrize (via signed geometric mea
130130

131131
Replace the raw (x, y) values by their ranks, i.e. by the *positions* they occupy when the data are sorted, so that only relative ordering information is retained:
132132

133-
134133
$$
135-
r_x = \mathrm{rank}_{\mathrm{avg}}(x),
134+
r_x = \mathrm{rank}\_{\mathrm{avg}}(x),
136135
\qquad
137-
r_y = \mathrm{rank}_{\mathrm{avg}}(y),
136+
r_y = \mathrm{rank}\_{\mathrm{avg}}(y),
138137
$$
139138

140139
where ties are assigned their average (mid) rank.
@@ -148,21 +147,22 @@ r_y^{\ast} = \frac{r_y - \overline{r_y}}{\sigma_{r_y}} .
148147
$$
149148

150149
Standardization doesn't affect **Λ_s** due to symmetrization but improves the stability of the asymmetric **Λ_yx/xy**, especially when there are ties. Tests using
151-
Somers' D better agree on asymmetry when standardization is done, e.g., on binary data. Also, decreases the number of **Λ_yx/xy** sign disagreements for various scenarios (see [github /tests/test_opposites.py](https://github.com/JonPaulLundquist/lambda_corr/blob/main/tests/test_opposites.py))
150+
Somers' D better agree on asymmetry when standardization is done, e.g., on binary data. Also, decreases the number of **Λ_yx/xy** sign disagreements for various scenarios (see [github /tests/test_opposites.py](https://github.com/JonPaulLundquist/lambda_corr/blob/main/tests/test_opposites.py)).
152151

153152
3. For each anchor point sample *i*, compute the **median slope in rank space**:
154153

155154
$$
156155
\begin{aligned}
157156
b_i &=
158-
\underset{\substack{j \neq i \\ r_x^{\ast}(j) \neq r_x^{\ast}(i)}}{\mathrm{median}}
157+
\underset{j \ne i, r_x^{\ast}(j) \ne r_x^{\ast}(i)}{\mathrm{median}}
159158
\left(
160159
\frac{ r_y^{\ast}(j) - r_y^{\ast}(i) }
161160
{ r_x^{\ast}(j) - r_x^{\ast}(i) }
162161
\right)
163162
\end{aligned}
164163
$$
165164

165+
166166
4. Compute the **asymmetric** rank-slope correlations as the outer mean over i slopes:
167167
- **Λ(y|x)**:
168168

@@ -176,11 +176,11 @@ $$
176176

177177
$$
178178
\begin{aligned}
179-
\Lambda_{yx} &=
180-
\mathrm{sign}\left(\bar{\Lambda}_{yx}\right)
179+
\Lambda\_{yx} &=
180+
\mathrm{sign}\left(\bar{\Lambda}\_{yx}\right)
181181
\exp\left(
182182
-\left|
183-
\log\left|\bar{\Lambda}_{yx}\right|
183+
\log\left|\bar{\Lambda}\_{yx}\right|
184184
\right|
185185
\right)
186186
\end{aligned}
@@ -190,11 +190,11 @@ That is equivalent to:
190190

191191
$$
192192
\begin{aligned}
193-
\Lambda_{yx} &=
194-
\mathrm{sign}\left(\bar{\Lambda}_{yx}\right)
193+
\Lambda\_{yx} &=
194+
\mathrm{sign}\left(\bar{\Lambda}\_{yx}\right)
195195
\min\left(
196-
\lvert \bar{\Lambda}_{yx} \rvert,
197-
\lvert \bar{\Lambda}_{yx} \rvert^{-1}
196+
\lvert \bar{\Lambda}\_{yx} \rvert,
197+
\lvert \bar{\Lambda}\_{yx} \rvert^{-1}
198198
\right)
199199
\end{aligned}
200200
$$
@@ -226,30 +226,27 @@ Alternative stabilizations (e.g., Harrell–Davis quantile estimator per anchor,
226226
**Examples of Overshoot Behavior**
227227
Shown are rank configurations that produce the largest observed *untransformed* value of the symmetric statistics for different sample sizes (found via stochastic annealing rank swap search). Listed in the legend are the |Λ_raw| before transform and Λ after applying the reciprocal fold-back transform to the asymmetric components; the results are reasonable for this robust correlation measure.
228228

229-
<table>
230-
<tr>
231-
<td align="center">
232-
233-
<b>(a) Possible maximal overshoot examples found via annealing search. Shown are the values of Λ_s before and after fold-back.</b><br>
234-
<p align="center">
235-
<img src="tests/overshoot/possible_max_overshoots.png" width="350">
236-
</p>
237-
238-
</td>
239-
<td align="center">
240-
241-
<b>(b) Λ_s statistic before and after fold-back transform compared to Kendall's τ (found by random indice swapping from perfect association). The proper ordering of association strength is recovered.</b><br>
242-
<p align="center">
243-
<img src="tests/overshoot/LambdaVsTau_overshoot.png" width="350">
244-
</p>
245-
246-
</td>
247-
</tr>
229+
<table width="100%">
230+
<colgroup>
231+
<col width="50%">
232+
<col width="50%">
233+
</colgroup>
234+
<tr>
235+
<td align="center">
236+
<b>(a) Possible maximal overshoot examples found via annealing search. Shown are the values of Λ_s before and after fold-back.</b><br>
237+
<img src="https://raw.githubusercontent.com/JonPaulLundquist/lambda_corr/main/tests/overshoot/possible_max_overshoots.png" width="350" height="263">
238+
</td>
239+
<td align="center">
240+
<b>(b) Λ_s statistic before and after fold-back transform compared to Kendall's τ (found by random indice swapping from perfect association). The proper ordering of association strength is recovered.</b><br>
241+
<img src="https://raw.githubusercontent.com/JonPaulLundquist/lambda_corr/main/tests/overshoot/LambdaVsTau_overshoot.png" width="350" height="263">
242+
</td>
243+
</tr>
248244
</table>
249245

246+
250247
---
251248

252-
## Properties of $\Lambda_s$
249+
## Properties of Λ_s
253250

254251
- **Range:** **Λ_s**[-1,1].
255252
- **Symmetric:** **Λ_s**(x,y) == **Λ_s**(y,x).

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "lambda-corr"
7-
version = "0.1.2"
8-
description = "Repeated-Average-Rank Correlations Λ (Lambda): a family of robust, symmetric/asymmetric measures of monotone association based on pairwise rank slopes."
7+
version = "0.5.0"
8+
description = "Repeated-Average Rank Correlations Λ (Lambda): a family of robust, symmetric/asymmetric measures of monotone association based on pairwise rank slopes."
99
readme = { file = "README_pypi.md", content-type = "text/markdown" }
1010
requires-python = ">=3.8"
1111
license = "MIT"

0 commit comments

Comments
 (0)