diff --git a/modules/lab4/lab4-4.ipynb b/modules/lab4/lab4-4.ipynb index 22a1a3c6..3fa9d7a7 100644 --- a/modules/lab4/lab4-4.ipynb +++ b/modules/lab4/lab4-4.ipynb @@ -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", @@ -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" ] }, { @@ -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))" ] }, {