Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
1e8bd9b
change: improve descriptive.py
huangziwei Sep 27, 2025
7cb36d5
change: improve hypothesis.py
huangziwei Sep 27, 2025
21d793f
change: improve correlation.py
huangziwei Sep 27, 2025
c4874e0
update: notebooks
huangziwei Sep 27, 2025
5fcfc40
change: improve regression.py
huangziwei Sep 27, 2025
ecc549c
change: improve clustering.py
huangziwei Sep 27, 2025
e8b3262
fix: distributions/circularuniform.pdf; update: notebooks
huangziwei Oct 21, 2025
ba6945e
improve: circularuniform methods
huangziwei Oct 21, 2025
a8d1617
improve: distributions.triangular
huangziwei Oct 21, 2025
5dc8f75
improve: distributions.triangular
huangziwei Oct 22, 2025
585d6f5
update: notebooks
huangziwei Oct 22, 2025
153169d
add: distributions/CircularContinuous
huangziwei Oct 24, 2025
efb2b8e
change: also force periodic input for cdf(s) in CircularContinous
huangziwei Oct 28, 2025
f7a16a3
update: notebooks
huangziwei Oct 28, 2025
c2c91e5
change: cache normalizing constants in those distributions that need it
huangziwei Oct 28, 2025
811a799
update: notebooks
huangziwei Oct 28, 2025
1a27d2a
add: stats to distribution/CircularContinuous
huangziwei Oct 28, 2025
fa33aa2
add: tests for distribution stats
huangziwei Oct 28, 2025
4e6ea44
rm
huangziwei Oct 28, 2025
cc93f9c
add: distribution/katojones; fix: wrapcauchy parameter ranges
huangziwei Oct 29, 2025
9b3be95
change: katojones docstring
huangziwei Oct 29, 2025
5d3eba0
fix: katojones.fit(method="mle")
huangziwei Oct 29, 2025
8a88fd8
add: tests for katojones
huangziwei Oct 29, 2025
71a4aac
add: convert_rho_lambda to katojones
huangziwei Oct 29, 2025
103817a
change: katojones docstring
huangziwei Oct 29, 2025
2febd46
change: default batch cdf
huangziwei Oct 29, 2025
1ae0b2f
change: wrapnorm_gen.cdf now is evaluated via series
huangziwei Oct 29, 2025
7b91bee
change: wrapcauchy_gen.cdf
huangziwei Oct 29, 2025
5204d65
change: vonmises_gen.cdf
huangziwei Oct 29, 2025
3897563
change: cartwright_gen.cdf
huangziwei Oct 29, 2025
db43dd0
fix: katojones docstring
huangziwei Oct 29, 2025
1b4682a
change: better rng handling in distributions/CircularContinous
huangziwei Oct 29, 2025
b4f972c
change: update _rvs() for cardioid and cartwright
huangziwei Oct 29, 2025
9c8fd95
change: add fit() for cardioid and cartwright
huangziwei Oct 29, 2025
9246067
change: add fit() for wrapcachy and wrapnorm
huangziwei Oct 29, 2025
9aa0a8a
change: update fit() for vonmises
huangziwei Oct 29, 2025
c9be2b6
change: cleanup symmetrical distributions
huangziwei Oct 30, 2025
0dd4b3b
add: ppf to cardioid
huangziwei Oct 30, 2025
bd70a36
change: docstrings; add: roundtrip tests for more cdf and ppf
huangziwei Oct 30, 2025
9789f07
add: ppf to cartwright; change: update cartwright docstring
huangziwei Oct 30, 2025
13709ba
add: ppf to wrapnorm; change: improve rvs argument parsing for some d…
huangziwei Oct 30, 2025
6421a12
add: tests for some distributions
huangziwei Oct 30, 2025
9795b19
fix: _quadpack_py warning
huangziwei Oct 30, 2025
56629a1
add: ppf to wrapcauchy; fix: ppf parameter shape bug in wrapnorm
huangziwei Oct 30, 2025
607d649
add: ppf to vonmises
huangziwei Oct 30, 2025
4e5506d
fix: ppf parameter shape bug in vonmises
huangziwei Oct 30, 2025
9c64cbd
fix: wrapnorm ppf and cartwright cdf
huangziwei Oct 30, 2025
0dc73c4
add: tests ensuring cdf and ppf monotonicity
huangziwei Oct 30, 2025
8ce8607
add: better tests ensuring cdf and ppf monotonicity
huangziwei Oct 30, 2025
eacd977
change: rm py3.9 from ci, add py3.14
huangziwei Oct 30, 2025
de357c0
fix: jonespewsey family helpers and pdfs
huangziwei Oct 30, 2025
51c6bad
change: overhaul jp family
huangziwei Oct 30, 2025
f0a6bc7
change: add public apis docstring for jp family
huangziwei Oct 30, 2025
1b4a4f5
change: reorder distributions in the file; change: fix vonmises_flatt…
huangziwei Oct 30, 2025
813050d
change: overhaul vonmises_flattopped
huangziwei Oct 30, 2025
916a4bb
fix: invbatschelet pdf
huangziwei Oct 31, 2025
a25df3e
add: invbatschelet cdf
huangziwei Oct 31, 2025
22fa515
add: invbatschelet ppf
huangziwei Oct 31, 2025
b21c9f1
add: invbatschelet rvs
huangziwei Oct 31, 2025
1d86a51
add: invbatschelet fit
huangziwei Oct 31, 2025
a81f0d1
fix: wrapstable pdf
huangziwei Oct 31, 2025
4be176a
add: wrapstable cdf
huangziwei Oct 31, 2025
1b01593
add: wrapstable ppf
huangziwei Oct 31, 2025
cd3fd2c
add: wrapstable rvs
huangziwei Oct 31, 2025
b3159ff
add: wrapstable fit
huangziwei Oct 31, 2025
f267108
change: wrapstable dosctring
huangziwei Oct 31, 2025
f24df96
fix: katojones
huangziwei Oct 31, 2025
41db318
fix: cardioid instability; update: notebooks
huangziwei Oct 31, 2025
bc3c838
update: all notebooks
huangziwei Oct 31, 2025
d5ba280
change: revamp test_distributions
huangziwei Oct 31, 2025
5c34c0b
change: more revamp test_distributions
huangziwei Oct 31, 2025
86ade34
draft: clustering/MoCD
huangziwei Oct 31, 2025
9893a51
change: better clustering/MoCD
huangziwei Oct 31, 2025
72e4616
change: restrict MoCD to simple distributions for now
huangziwei Oct 31, 2025
88b2f15
fix: wrapnorm name
huangziwei Oct 31, 2025
5d31b62
add: clustering/MoKJ
huangziwei Oct 31, 2025
c8ece68
add: params_ to both MovM and MoKJ
huangziwei Oct 31, 2025
d75227d
change: visualization / allow disabling legends
huangziwei Nov 3, 2025
f25434f
rm: duplicate notebooks
huangziwei Nov 3, 2025
c337e2c
change: .gitignore
huangziwei Nov 3, 2025
6ba3b83
revamp: hypothesis, harmonized all results objects
huangziwei Nov 3, 2025
68feadf
update: all notebooks
huangziwei Nov 3, 2025
276f294
change: better hypothesis
huangziwei Nov 3, 2025
ef1fec1
update: hypothesis
huangziwei Nov 3, 2025
29728fe
change: harmonize hypothesis testing random seed api
huangziwei Nov 4, 2025
af57eb6
fix: docstring
huangziwei Nov 4, 2025
c71a3de
change: all hypothesis testings have verbose mode
huangziwei Nov 4, 2025
345d2dd
update: notebook/hypothesis
huangziwei Nov 4, 2025
dcb0736
change: now some distributions support arr params, not roll out to al…
huangziwei Dec 2, 2025
5209da5
change: some complicated distributions will stay scalar only
huangziwei Dec 2, 2025
2937c38
add/change: clarify docs and add tests
huangziwei Dec 2, 2025
b7a8e56
add/change: more docs clarified and add more tests
huangziwei Dec 2, 2025
36cb54a
add/change: more tests
huangziwei Dec 2, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
.coverage
.vscode
.venv
.mplconfig

*.egg-info
*/__pycache__

uv.lock

dev/
dist/
docs/site/
build/
build/

*copy*
27 changes: 14 additions & 13 deletions docs/docs/feature-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### 1. Descriptive Statistics

| Feature | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| ----------------------------------- | --------------------- | ------------------------- | ------------------ | ------------- | ------------------------------------- |
|-------------------------------------|-----------------------|---------------------------|--------------------|---------------|---------------------------------------|
| **Measures of Central Tendency** | | | | | |
| Circular Mean | `circ_mean` | `mean(alpha)` | `circ_mean(alpha)` | `circ.mean` | `mean.circular` |
| Circular Mean CI | `circ_mean_ci` | `mean(alpha, ci=95)` | `circ_confmean` | - | `mle.vonmises.bootstrap.ci` |
Expand Down Expand Up @@ -31,7 +31,7 @@
#### One-Sample Tests for Significance

| Feature | H0 | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| --------------------------- | ----------------------------------- | ------------------- | ---------- | ----------------- | ------------- | --------------- |
|-----------------------------|-------------------------------------|---------------------|------------|-------------------|---------------|-----------------|
| **Mean Direction** | | | | | | |
| Rayleigh Test | $\rho=0$ [^uniform] | `rayleigh_test` | `rayleigh` | `circ_rtest` | `r.test` | `rayleigh.test` |
| V-Test | $\rho=0$ | `V_test` | `vtest` | `circ_vtest` | `v0.test` | - |
Expand All @@ -46,7 +46,7 @@
#### Multi-Sample Tests for Significance

| Feature | H0 | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| ------------------------------- | --------------------------------------------- | ---------------------------- | ----------------- | ----------------- | ----------------- | ---------------------- |
|---------------------------------|-----------------------------------------------|------------------------------|-------------------|-------------------|-------------------|------------------------|
| **Mean Direction** | | | | | | |
| Circular Analysis of Variance | $\mu_1 = \dots = \mu_n$ | `circ_anova` | - | - | - | `aov.circular` |
| Watson-Williams Test [^one-way] | $\mu_1 = \dots = \mu_n$ | `watson_williams_test` | `watson_williams` | `circ_wwtest` | - | `watson.williams.test` |
Expand All @@ -66,7 +66,7 @@
#### Goodness-of-fit Tests

| Feature | H0 | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| ------------------- | ---------- | ------------------ | ------------ | ----------------- | ------------- | ------------------ |
|---------------------|------------|--------------------|--------------|-------------------|---------------|--------------------|
| Kuiper’s Test | $\rho = 0$ | `circ_kuiper_test` | `kupier` | `circ_kuipertest` | `kuiper` | `kuiper.test` |
| Rao’s Spacing Test | $\rho = 0$ | `rao_spacing_test` | `raospacing` | `circ_raotest` | `rao.spacing` | `rao.spacing.test` |
| Watson's Test | $\rho = 0$ | `watson_test` | - | - | `watson` | `watson.test` |
Expand All @@ -75,7 +75,7 @@

### 3. Correlation & Regression
| Feature | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| ----------------------------- | -------------- | ---------- | ----------------- | ------------- | ------------------------- |
|-------------------------------|----------------|------------|-------------------|---------------|---------------------------|
| Circular-Circular Correlation | `circ_corrcc` | `corrcc` | `circ_corrcc` | `circ.cor` | `cor.circular` |
| Circular-Linear Correlation | `circ_corrcl` | `corrcl` | `circ_corrcl` | - | - |
| Circular-Circular Regression | `CCRegression` | - | - | `circ.reg` | `lm.circular(type="c-c")` |
Expand All @@ -85,10 +85,12 @@

### 4. Circular Distributions

All circular distributions assume angles are on ``[0, 2π)``. Inputs are automatically wrapped to that support as a convenience. We remove SciPy's ``loc``/``scale`` convention—parameters like ``mu``, ``rho``, etc. are the only inputs.

#### Symmetric Circular Distributions

| Feature | Method | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| -------------------- | ------ | ------------------------- | ---------------- | ----------------- | ------------- | ------------------- |
|----------------------|--------|---------------------------|------------------|-------------------|---------------|---------------------|
| Circular Uniform | PDF | `circularuniform.pdf` | - | - | - | `dcircularuniform` |
| | CDF | `circularuniform.cdf` | - | - | - | - |
| | PPF | `circularuniform.ppf` | - | - | - | - |
Expand Down Expand Up @@ -134,15 +136,10 @@
| | PPF | `jonespewsey.ppf` | - | - | - | - |
| | RVS | `jonespewsey.rvs` | - | - | - | - |
| | Fit | `jonespewsey.fit` | - | - | - | - |
| Kato-Jones | PDF | - | - | - | - | `dkatojones` |
| | CDF | - | - | - | - | - |
| | PPF | - | - | - | - | - |
| | RVS | - | - | - | - | `rkatojones` |
| | Fit | - | - | - | - | - |

#### Asymmetric Circular Distributions
| Feature | Method | PyCircStat2 | PyCircStat | CircStat (MATLAB) | CircStats (R) | circular (R) |
| ------------------------ | ------ | ---------------------------- | ---------- | ----------------- | ------------- | ---------------- |
|--------------------------|--------|------------------------------|------------|-------------------|---------------|------------------|
| Jones-Pewsey Sine-Skewed | PDF | `jonespewsey_sineskewed.pdf` | - | - | - | - |
| | CDF | `jonespewsey_sineskewed.cdf` | - | - | - | - |
| | PPF | `jonespewsey_sineskewed.ppf` | - | - | - | - |
Expand All @@ -158,6 +155,11 @@
| | PPF | `inverse_batschelet.ppf` | - | - | - | - |
| | RVS | `inverse_batschelet.rvs` | - | - | - | - |
| | Fit | `inverse_batschelet.fit` | - | - | - | - |
| Kato-Jones | PDF | `katojones.pdf` | - | - | - | `dkatojones` |
| | CDF | `katojones.cdf` | - | - | - | - |
| | PPF | `katojones.ppf` | - | - | - | - |
| | RVS | `katojones.rvs` | - | - | - | `rkatojones` |
| | Fit | `katojones.fit` | - | - | - | - |
| Wrapped Stable | PDF | `wrapstable.pdf` | - | - | - | - |
| | CDF | `wrapstable.cdf` | - | - | - | - |
| | PPF | `wrapstable.ppf` | - | - | - | - |
Expand All @@ -172,4 +174,3 @@
[^F]: $F$ stands for distributions.
[^one-way]: Yet anothr one-way ANOVA.
[^two-way]: Two-way ANOVA.

Binary file modified docs/docs/images/circ-mod-cardioid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-cartwright.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-circularuniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-inverse-batschelet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-jonespewsey-asym.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-jonespewsey-sineskewed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-jonespewsey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/circ-mod-katojones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-triangular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-vonmises-flat-topped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-vonmises.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-wrapcauchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-wrapnorm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/circ-mod-wrapstable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ plugins:
- mkdocstrings:
handlers:
python:
paths:
- ../pycircstat2
options:
show_source: true
docstring_style: "numpy"
Expand Down
40 changes: 20 additions & 20 deletions examples/B1-Fisher-1993.ipynb

Large diffs are not rendered by default.

120 changes: 61 additions & 59 deletions examples/B2-Zar-2010.ipynb

Large diffs are not rendered by default.

145 changes: 45 additions & 100 deletions examples/B3-Pewsey-2014.ipynb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions examples/T0-utils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2025-03-11 17:56:28CET\n",
"Last updated: 2025-11-03 14:20:54CET\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.12.9\n",
"IPython version : 8.31.0\n",
"Python version : 3.12.12\n",
"IPython version : 9.6.0\n",
"\n",
"numpy : 2.2.3\n",
"pycircstat2: 0.1.12\n",
"numpy : 2.3.4\n",
"pycircstat2: 0.1.15\n",
"\n",
"Watermark: 2.5.0\n",
"\n"
Expand All @@ -302,7 +302,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.12.12)",
"language": "python",
"name": "python3"
},
Expand All @@ -316,7 +316,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.12"
},
"orig_nbformat": 4
},
Expand Down
42 changes: 21 additions & 21 deletions examples/T1-descriptive-statistics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"c11 = Circular(data=b11)\n",
"\n",
"u, r = circ_mean_and_r(alpha=c11.alpha)\n",
"print(f\"μ={np.rad2deg(u).round(2)}, r={r.round(2)}\")"
"print(f\"μ={np.round(np.rad2deg(u), 2)}, r={np.round(r, 2)}\")"
]
},
{
Expand Down Expand Up @@ -100,13 +100,13 @@
"\n",
"mp1 = circ_moment(alpha=c11.alpha, p=1, centered=False)\n",
"u1, r1 = convert_moment(mp1) \n",
"print(f\"μ1={np.rad2deg(u1).round(2)}, r1={r1.round(2)}\")\n",
"print(f\"μ1={np.round(np.rad2deg(u1), 2)}, r1={np.round(r1, 2)}\")\n",
"\n",
"# second moment\n",
"\n",
"mp2 = circ_moment(alpha=c11.alpha, p=2, centered=False)\n",
"u2, r2 = convert_moment(mp2)\n",
"print(f\"μ2={np.rad2deg(u2).round(2)}, r2={r2.round(2)}\")"
"print(f\"μ2={np.round(np.rad2deg(u2), 2)}, r2={np.round(r2, 2)}\")"
]
},
{
Expand Down Expand Up @@ -310,13 +310,13 @@
"c1 = Circular(data=d1)\n",
"s = angular_std(alpha=c1.alpha)\n",
"s0 = circ_std(alpha=c1.alpha)\n",
"print(f\"s={np.rad2deg(s).round()}, s0={np.rad2deg(s0).round()}\")\n",
"print(f\"s={np.round(np.rad2deg(s))}, s0={np.round(np.rad2deg(s0))}\")\n",
"\n",
"d2 = load_data('D2', source='zar')\n",
"c2 = Circular(data=d2['θ'].values[:], w=d2['w'].values[:])\n",
"s = angular_std(alpha=c2.alpha, w=c2.w)\n",
"s0 = circ_std(alpha=c2.alpha, w=c2.w)\n",
"print(f\"s={np.rad2deg(s).round()}, s0={np.rad2deg(s0).round()}\")"
"print(f\"s={np.round(np.rad2deg(s))}, s0={np.round(np.rad2deg(s0))}\")"
]
},
{
Expand All @@ -336,7 +336,7 @@
}
],
"source": [
"from pycircstat2.descriptive import compute_C_and_S, circ_var, circ_r\n",
"from pycircstat2.descriptive import compute_C_and_S, circ_var\n",
"C, S = compute_C_and_S(alpha=c2.alpha, w=c2.w)\n",
"np.sqrt(C**2 + S**2), circ_r(alpha=c2.alpha, w=c2.w)"
]
Expand Down Expand Up @@ -402,12 +402,12 @@
" n=circ_zar_ex4_ch26.n,\n",
" method=\"approximate\",\n",
")\n",
"print(np.rad2deg([lb, ub]).round())"
"print(np.round(np.rad2deg([lb, ub])))"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -420,7 +420,7 @@
"median 279.0 247.5 245.0 \n",
"mean 280.8 248.7 247.6 \n",
"95% median CI [245. 315.] [229. 277.] [229. 267.] \n",
"95% bootstrap mean CI [266.2 305.3] [216. 266.5] [230.2 262.1] \n",
"95% bootstrap mean CI [263. 306.9] [227.7 272.5] [234.5 263.2] \n",
"95% large-sample mean CI - - [232.7 262.5] \n"
]
}
Expand All @@ -438,29 +438,29 @@
" \n",
" e = np.deg2rad(d)\n",
" mean = circ_mean(e)\n",
" table['mean'].append(np.rad2deg(mean).round(1))\n",
" table['mean'].append(np.round(np.rad2deg(mean), 1))\n",
" median = circ_median(e, method='deviation', average_method=\"unique\")\n",
" table['median'].append(np.rad2deg(median).round(1))\n",
" table['median'].append(np.round(np.rad2deg(median),1))\n",
"\n",
" # CI for median\n",
" median_lb, median_ub, ci = circ_median_ci(alpha=e, method='deviation')\n",
" table['95% median CI'].append(np.rad2deg([median_lb, median_ub]).round(1))\n",
" table['95% median CI'].append(np.round(np.rad2deg([median_lb, median_ub]), 1))\n",
"\n",
" # CI for mean using bootstrap\n",
" mean_lb, mean_ub = circ_mean_ci(\n",
" alpha=e,\n",
" B=200,\n",
" method=\"bootstrap\",\n",
" )\n",
" table['95% bootstrap mean CI'].append(np.rad2deg([mean_lb, mean_ub]).round(1))\n",
" table['95% bootstrap mean CI'].append(np.round(np.rad2deg([mean_lb, mean_ub]), 1))\n",
"\n",
" if i == 2:\n",
" # CI for mean using dispersion\n",
" mean_lb_large_sample, mean_ub_large_sample = circ_mean_ci(\n",
" alpha=e,\n",
" method=\"dispersion\",\n",
" )\n",
" table['95% large-sample mean CI'].append(np.rad2deg([mean_lb_large_sample, mean_ub_large_sample]).round(1))\n",
" table['95% large-sample mean CI'].append(np.round(np.rad2deg([mean_lb_large_sample, mean_ub_large_sample]), 1))\n",
" else:\n",
" table['95% large-sample mean CI'].append('-')\n",
"\n",
Expand All @@ -481,14 +481,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2025-03-11 17:57:05CET\n",
"Last updated: 2025-11-03 14:19:06CET\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.12.9\n",
"IPython version : 8.31.0\n",
"Python version : 3.12.12\n",
"IPython version : 9.6.0\n",
"\n",
"pycircstat2: 0.1.12\n",
"numpy : 2.2.3\n",
"numpy : 2.3.4\n",
"pycircstat2: 0.1.15\n",
"\n",
"Watermark: 2.5.0\n",
"\n"
Expand All @@ -503,7 +503,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.12.12)",
"language": "python",
"name": "python3"
},
Expand All @@ -517,7 +517,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.12"
},
"orig_nbformat": 4
},
Expand Down
Loading