Skip to content

Commit

Permalink
update: T2-hypothesis-testing.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
huangziwei committed Dec 19, 2024
1 parent 6ae02e2 commit d5cc0a3
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions examples/T2-hypothesis-testing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -74,9 +74,20 @@
"H0: ρ = 0\n",
"HA: ρ ≠ 0\n",
"\n",
"Test Statistics: 5.44787\n",
"P-value: 0.00185 **\n"
"Test Statistics (ρ | z-score): 0.82522 | 5.44787\n",
"P-value: 0.00185 **\n",
"Bootstrap P-value: 0.00900 **\n"
]
},
{
"data": {
"text/plain": [
"RayleighTestResult(r=np.float64(0.8252177448200448), z=np.float64(5.4478746109270455), pval=np.float64(0.0018516375077209267), bootstrap_pval=np.float64(0.009))"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand All @@ -85,7 +96,7 @@
"d1 = load_data('D1', source='zar')['θ'].values\n",
"c1 = Circular(data=d1)\n",
"\n",
"z, pval = rayleigh_test(c1.alpha, verbose=True)"
"rayleigh_test(c1.alpha, B=9999, verbose=True)"
]
},
{
Expand Down Expand Up @@ -226,9 +237,19 @@
"H0: uniform\n",
"HA: not uniform\n",
"\n",
"Test Statistics: 66.54286\n",
"Test Statistics (χ²): 66.54286\n",
"P-value: 0.00000 ***\n"
]
},
{
"data": {
"text/plain": [
"ChiSquareTestResult(chi2=np.float64(66.54285714285714), pval=np.float64(5.518107289173823e-10))"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand All @@ -238,7 +259,7 @@
"d2 = load_data(\"D2\", source=\"zar\")\n",
"c2 = Circular(data=d2[\"θ\"].values, w=d2[\"w\"].values)\n",
"\n",
"chi2, pval = chisquare_test(c2.w, verbose=True)"
"chisquare_test(c2.w, verbose=True)"
]
},
{
Expand Down Expand Up @@ -667,14 +688,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2024-12-18 16:54:54CET\n",
"Last updated: 2024-12-19 14:52:45CET\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.12.8\n",
"IPython version : 8.30.0\n",
"\n",
"numpy : 2.2.0\n",
"pycircstat2: 0.1.7\n",
"numpy : 2.2.0\n",
"\n",
"Watermark: 2.5.0\n",
"\n"
Expand Down

0 comments on commit d5cc0a3

Please sign in to comment.