159159 "source" : [
160160 " remode = ReMoDe(\n " ,
161161 " alpha=0.05, # alpha level desired (adjusted recursively for multiple testing)\n " ,
162- " alpha_correction='descriptive_peaks', # or 'max_modes', 'none', or custom function\n " ,
163- " statistical_test=perform_fisher_test, # or perform_binomial_test, or custom function\n " ,
164- " )\n "
162+ " alpha_correction=\" descriptive_peaks\" , # default; or \" max_modes\" , \" none\" , or custom function\n " ,
163+ " statistical_test=\" bootstrap\" , # default; or \" fisher\" , \" binomial\" , or custom function\n " ,
164+ " definition=\" shape_based\" , # default; set \" peak_based\" to exclude uniform distributions\n " ,
165+ " )\n " ,
166+ " \n "
165167 ]
166168 },
167169 {
173175 "source" : [
174176 " remode = ReMoDe(\n " ,
175177 " alpha=0.05,\n " ,
176- " alpha_correction='max_modes', # example of the alternative built-in correction\n " ,
177- " statistical_test=perform_fisher_test,\n " ,
178- " )\n "
178+ " alpha_correction=\" max_modes\" , # alternative built-in correction\n " ,
179+ " statistical_test=\" fisher\" ,\n " ,
180+ " definition=\" peak_based\" ,\n " ,
181+ " )\n " ,
182+ " \n "
183+ ]
184+ },
185+ {
186+ "cell_type" : " markdown" ,
187+ "metadata" : {},
188+ "source" : [
189+ " ### Uniformity Test (`peak_based`)\n " ,
190+ " \n " ,
191+ " With `definition=\" peak_based\" `, ReMoDe applies a Pearson Chi-square test for uniformity.\n " ,
192+ " If the distribution is not significantly different from uniform (`p > 0.05`), it returns zero modes.\n "
193+ ]
194+ },
195+ {
196+ "cell_type" : " code" ,
197+ "execution_count" : null ,
198+ "metadata" : {},
199+ "outputs" : [],
200+ "source" : [
201+ " uniform_counts = np.array([10, 10, 10, 10, 10])\n " ,
202+ " \n " ,
203+ " uniform_result = ReMoDe(\n " ,
204+ " statistical_test=\" fisher\" ,\n " ,
205+ " definition=\" peak_based\" ,\n " ,
206+ " ).fit(uniform_counts)\n " ,
207+ " \n " ,
208+ " print(\" Number of modes:\" , uniform_result[\" nr_of_modes\" ])\n " ,
209+ " print(\" Uniform distribution:\" , uniform_result[\" uniform_distribution\" ])\n " ,
210+ " print(\" Chi-square p-value:\" , uniform_result[\" uniformity_p_value\" ])\n "
179211 ]
180212 },
181213 {
244276 },
245277 "nbformat" : 4 ,
246278 "nbformat_minor" : 5
247- }
279+ }
0 commit comments