Skip to content

Commit

Permalink
fix comments in mannkendall function
Browse files Browse the repository at this point in the history
  • Loading branch information
spestana committed Dec 9, 2020
1 parent a2a909f commit 9d78ed8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions modules/lab4/lab4-4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
"source": [
"def mann_kendall(V, alpha=0.05):\n",
" '''Mann Kendall Test (adapted from original Matlab function)\n",
" Performs original Mann-Kendall test of the null hypothesis of trend absence in the vector V, \n",
" against the alternative of trend.\n",
" The result of the test is returned in H = False indicates a rejection of the null hypothesis at \n",
" the alpha significance level. \n",
" H = True indicates a failure to reject the null hypothesis at the alpha significance level.\n",
" Performs original Mann-Kendall test of the null hypothesis of trend absence in the vector V, against the alternative of trend.\n",
" \n",
" The result of the test is returned in reject_null:\n",
" reject_null = True indicates a rejection of the null hypothesis at the alpha significance level. \n",
" reject_null = False indicates a failure to reject the null hypothesis at the alpha significance level.\n",
" \n",
" INPUTS:\n",
" V = time series [vector]\n",
Expand Down Expand Up @@ -148,9 +148,9 @@
" Zalpha = st.norm.ppf(1-alpha,0,1)\n",
" p_value = 2*(1-st.norm.cdf(abs(Z), 0, 1)) #Two-tailed test p-value\n",
"\n",
" H = abs(Z) > Zalpha\n",
" reject_null = abs(Z) > Zalpha # reject null hypothesis only if abs(Z) > Zalpha\n",
" \n",
" return H, p_value"
" return reject_null, p_value"
]
},
{
Expand Down Expand Up @@ -181,11 +181,11 @@
"source": [
"alpha = 0.05\n",
"\n",
"H, p_value = mann_kendall(snow_pillows['SLI_max'].values, alpha)\n",
"print('Can we reject the null hypothesis for Slide Canyon?\\n{}\\n'.format(H))\n",
"reject_null, p_value = mann_kendall(snow_pillows['SLI_max'].values, alpha)\n",
"print('Can we reject the null hypothesis for Slide Canyon?\\n{}\\n'.format(reject_null))\n",
"\n",
"H, p_value = mann_kendall(snow_pillows['BLC_max'].values, alpha)\n",
"print('Can we reject the null hypothesis for Blue Canyon?\\n{}\\n'.format(H))"
"reject_null, p_value = mann_kendall(snow_pillows['BLC_max'].values, alpha)\n",
"print('Can we reject the null hypothesis for Blue Canyon?\\n{}\\n'.format(reject_null))"
]
},
{
Expand Down

0 comments on commit 9d78ed8

Please sign in to comment.