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

Update force.ipynb #15

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 11 additions & 4 deletions docs/tutorials/force.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"\n",
"One of the main conditions which need to be fulfilled for dcTMD is a normally distributed work.\n",
"\n",
"This can be checked via different methods. e.g. plotting the work time traces, normality checks at different x positions, Kolmogorov-Smirnov Test, Shapiro-Wilk Test\n",
"This can be checked via different methods. e.g. plotting the work time traces, normality checks at different x positions, Kolmogorov-Smirnov Test, Shapiro-Wilk Test, Anderson-Darling Test\n",
"\n",
"CAUTION: if the work distribution is not normal you results are compromised. And a path separation is necessary. For the theory on path separation see..."
]
Expand Down Expand Up @@ -333,7 +333,7 @@
],
"source": [
"# check if work distribution follows a normal distribution\n",
"from scipy.stats import kstest, shapiro\n",
"from scipy.stats import kstest, shapiro, anderson\n",
"from dcTMD.utils import plotting\n",
"\n",
"index = [5000, 15000]\n",
Expand All @@ -345,9 +345,16 @@
" # Shapiro-Wilk Test\n",
" shapiro_test = shapiro(forceset.work_[:,p])\n",
" print(f'shapiro wilkins results at x={x[p]} is {shapiro_test}')\n",
" # Kolmogorov-Smirnov Test\n",
" kstest_test = kstest(forceset.work_[:,p], 'norm')\n",
" # Anderson-Darling Test\n",
" # If the test statsitics is larger than the critical value of a given\n",
" # significance_level in percent, the null hypothesis that the work\n",
" # is normally distributed has to be rejected.\n",
" anderson_test = anderson(forceset.work_[:,p], 'norm')\n",
" print(f'anderson darling results at x={x[p]} is {anderson_test}.)\n",
" # Kolmogorov-Smirnov Test (requires centering and scaling of input data)\n",
" kstest_test = kstest( (forceset.work_[:,p]-np.mean(forceset.work_[:,p]))/np.std(forceset.work_[:,p]), 'norm')\n",
" print(f'Kolmogorov-Smirnov results at x={x[p]} is {kstest_test}')"

]
},
{
Expand Down
Loading