numo-gsl 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/README.md +84 -0
  4. data/Rakefile +16 -0
  5. data/ext/numo/gsl/cdf/depend +17 -0
  6. data/ext/numo/gsl/cdf/erbpp_cdf.rb +44 -0
  7. data/ext/numo/gsl/cdf/extconf.rb +9 -0
  8. data/ext/numo/gsl/cdf/func_def.rb +610 -0
  9. data/ext/numo/gsl/const/const_def.rb +419 -0
  10. data/ext/numo/gsl/const/depend +17 -0
  11. data/ext/numo/gsl/const/erbpp_const.rb +30 -0
  12. data/ext/numo/gsl/const/extconf.rb +9 -0
  13. data/ext/numo/gsl/err/depend +1 -0
  14. data/ext/numo/gsl/err/err.c +22 -0
  15. data/ext/numo/gsl/err/extconf.rb +9 -0
  16. data/ext/numo/gsl/extconf_gsl.rb +44 -0
  17. data/ext/numo/gsl/fit/depend +17 -0
  18. data/ext/numo/gsl/fit/erbpp_fit.rb +74 -0
  19. data/ext/numo/gsl/fit/extconf.rb +9 -0
  20. data/ext/numo/gsl/fit/func_def.rb +129 -0
  21. data/ext/numo/gsl/fit/tmpl/check_1d.c +9 -0
  22. data/ext/numo/gsl/fit/tmpl/fit_linear.c +53 -0
  23. data/ext/numo/gsl/fit/tmpl/fit_linear_est.c +56 -0
  24. data/ext/numo/gsl/fit/tmpl/fit_mul.c +50 -0
  25. data/ext/numo/gsl/fit/tmpl/fit_mul_est.c +47 -0
  26. data/ext/numo/gsl/fit/tmpl/fit_wlinear.c +59 -0
  27. data/ext/numo/gsl/fit/tmpl/fit_wmul.c +56 -0
  28. data/ext/numo/gsl/gen/erbpp2.rb +306 -0
  29. data/ext/numo/gsl/gen/erbpp_gsl.rb +166 -0
  30. data/ext/numo/gsl/gen/func_parser.rb +520 -0
  31. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_DFloat.c +40 -0
  32. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ.c +41 -0
  33. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ_x2.c +44 -0
  34. data/ext/numo/gsl/gen/tmpl/c_DFloat_x2_f_DFloat_x2.c +45 -0
  35. data/ext/numo/gsl/gen/tmpl/c_double_f_double.c +16 -0
  36. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet.c +16 -0
  37. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet_x2.c +17 -0
  38. data/ext/numo/gsl/gen/tmpl/c_double_f_void.c +15 -0
  39. data/ext/numo/gsl/gen/tmpl/c_double_x2_f_void.c +17 -0
  40. data/ext/numo/gsl/gen/tmpl/c_new_DFloat.c +29 -0
  41. data/ext/numo/gsl/gen/tmpl/c_new_double.c +22 -0
  42. data/ext/numo/gsl/gen/tmpl/c_new_f_other.c +25 -0
  43. data/ext/numo/gsl/gen/tmpl/c_new_sizet.c +22 -0
  44. data/ext/numo/gsl/gen/tmpl/c_new_sizet_double.c +23 -0
  45. data/ext/numo/gsl/gen/tmpl/c_new_sizet_x2.c +23 -0
  46. data/ext/numo/gsl/gen/tmpl/c_new_void.c +21 -0
  47. data/ext/numo/gsl/gen/tmpl/c_other_f_void.c +19 -0
  48. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat.c +46 -0
  49. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x2.c +41 -0
  50. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x3.c +44 -0
  51. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x4.c +47 -0
  52. data/ext/numo/gsl/gen/tmpl/c_self_f_SZ_x2_DFloat.c +45 -0
  53. data/ext/numo/gsl/gen/tmpl/c_self_f_double.c +17 -0
  54. data/ext/numo/gsl/gen/tmpl/c_self_f_other.c +17 -0
  55. data/ext/numo/gsl/gen/tmpl/c_self_f_sizet.c +21 -0
  56. data/ext/numo/gsl/gen/tmpl/c_self_f_void.c +14 -0
  57. data/ext/numo/gsl/gen/tmpl/c_sizet_f_void.c +15 -0
  58. data/ext/numo/gsl/gen/tmpl/c_sizet_x2_f_void.c +17 -0
  59. data/ext/numo/gsl/gen/tmpl/c_str_f_void.c +15 -0
  60. data/ext/numo/gsl/gen/tmpl/c_super_new_void.c +18 -0
  61. data/ext/numo/gsl/gen/tmpl/c_uint_f_void.c +15 -0
  62. data/ext/numo/gsl/gen/tmpl/c_ulong_f_void.c +15 -0
  63. data/ext/numo/gsl/gen/tmpl/c_void_f_double.c +17 -0
  64. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x2.c +18 -0
  65. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x4.c +20 -0
  66. data/ext/numo/gsl/gen/tmpl/c_void_f_ulong.c +17 -0
  67. data/ext/numo/gsl/gen/tmpl/c_void_f_void.c +14 -0
  68. data/ext/numo/gsl/gen/tmpl/cast_1d_contiguous.c +15 -0
  69. data/ext/numo/gsl/gen/tmpl/cast_2d_contiguous.c +15 -0
  70. data/ext/numo/gsl/gen/tmpl/class.c +26 -0
  71. data/ext/numo/gsl/gen/tmpl/create_new_narray.c +26 -0
  72. data/ext/numo/gsl/gen/tmpl/init_class.c +10 -0
  73. data/ext/numo/gsl/gen/tmpl/init_module.c +12 -0
  74. data/ext/numo/gsl/gen/tmpl/lib.c +41 -0
  75. data/ext/numo/gsl/gen/tmpl/m_DFloat_Int_f_DFloat.c +38 -0
  76. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat.c +35 -0
  77. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_Int.c +39 -0
  78. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_UInt.c +39 -0
  79. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double.c +42 -0
  80. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double_x2.c +47 -0
  81. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_int.c +42 -0
  82. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x2.c +38 -0
  83. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x3.c +41 -0
  84. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c +36 -0
  85. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt.c +36 -0
  86. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32.c +36 -0
  87. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double.c +43 -0
  88. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_uint.c +49 -0
  89. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_x2.c +48 -0
  90. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_uint_x3.c +51 -0
  91. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double.c +43 -0
  92. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_uint.c +50 -0
  93. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_x2.c +48 -0
  94. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_uint_x3.c +51 -0
  95. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat.c +41 -0
  96. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat_x2.c +44 -0
  97. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c +46 -0
  98. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat.c +36 -0
  99. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat_x3.c +42 -0
  100. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat.c +42 -0
  101. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat_x2.c +45 -0
  102. data/ext/numo/gsl/gen/tmpl/mod_func_noloop.c +54 -0
  103. data/ext/numo/gsl/gen/tmpl/mod_func_scalar.c +27 -0
  104. data/ext/numo/gsl/gen/tmpl/module.c +9 -0
  105. data/ext/numo/gsl/histogram/depend +17 -0
  106. data/ext/numo/gsl/histogram/erbpp_histogram.rb +109 -0
  107. data/ext/numo/gsl/histogram/extconf.rb +9 -0
  108. data/ext/numo/gsl/histogram/func_def.rb +763 -0
  109. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_2d_get.c +54 -0
  110. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_field.c +35 -0
  111. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_get.c +47 -0
  112. data/ext/numo/gsl/histogram/tmpl/c_DFloat_x2_f_get_range.c +56 -0
  113. data/ext/numo/gsl/histogram/tmpl/c_bool_f_other.c +19 -0
  114. data/ext/numo/gsl/histogram/tmpl/c_bool_f_pdf_init.c +24 -0
  115. data/ext/numo/gsl/histogram/tmpl/c_self_f_2d_set_ranges.c +26 -0
  116. data/ext/numo/gsl/histogram/tmpl/c_self_f_set_ranges.c +21 -0
  117. data/ext/numo/gsl/histogram/tmpl/c_sizet_f_field.c +15 -0
  118. data/ext/numo/gsl/interp/depend +17 -0
  119. data/ext/numo/gsl/interp/erbpp_interp.rb +59 -0
  120. data/ext/numo/gsl/interp/extconf.rb +9 -0
  121. data/ext/numo/gsl/interp/func_def.rb +816 -0
  122. data/ext/numo/gsl/interp/parse_interp.rb +67 -0
  123. data/ext/numo/gsl/interp/tmpl/interp2d_new.c +36 -0
  124. data/ext/numo/gsl/interp/tmpl/interp2d_type_new.c +17 -0
  125. data/ext/numo/gsl/interp/tmpl/interp_bsearch.c +57 -0
  126. data/ext/numo/gsl/interp/tmpl/interp_new.c +29 -0
  127. data/ext/numo/gsl/interp/tmpl/interp_type_new.c +16 -0
  128. data/ext/numo/gsl/interp/tmpl/spline2d_eval.c +61 -0
  129. data/ext/numo/gsl/interp/tmpl/spline_eval.c +55 -0
  130. data/ext/numo/gsl/interp/tmpl/spline_integ.c +56 -0
  131. data/ext/numo/gsl/interp/type_def.rb +9 -0
  132. data/ext/numo/gsl/multifit/depend +17 -0
  133. data/ext/numo/gsl/multifit/erbpp_multifit.rb +99 -0
  134. data/ext/numo/gsl/multifit/extconf.rb +9 -0
  135. data/ext/numo/gsl/multifit/func_2.1.rb +1035 -0
  136. data/ext/numo/gsl/multifit/func_2.2.1.rb +736 -0
  137. data/ext/numo/gsl/multifit/func_2.2.rb +736 -0
  138. data/ext/numo/gsl/multifit/func_2.3.rb +872 -0
  139. data/ext/numo/gsl/multifit/func_def.rb +1012 -0
  140. data/ext/numo/gsl/multifit/tmpl/multifit_linear.c +66 -0
  141. data/ext/numo/gsl/multifit/tmpl/multifit_linear_est.c +48 -0
  142. data/ext/numo/gsl/multifit/tmpl/multifit_linear_residuals.c +47 -0
  143. data/ext/numo/gsl/multifit/tmpl/multifit_wlinear.c +70 -0
  144. data/ext/numo/gsl/multifit/type_def.rb +1 -0
  145. data/ext/numo/gsl/numo_gsl.h +117 -0
  146. data/ext/numo/gsl/pdf/depend +17 -0
  147. data/ext/numo/gsl/pdf/erbpp_pdf.rb +26 -0
  148. data/ext/numo/gsl/pdf/extconf.rb +9 -0
  149. data/ext/numo/gsl/pdf/func_2.2.1.rb +306 -0
  150. data/ext/numo/gsl/pdf/func_2.2.rb +306 -0
  151. data/ext/numo/gsl/pdf/func_2.3.rb +306 -0
  152. data/ext/numo/gsl/pdf/func_def.rb +282 -0
  153. data/ext/numo/gsl/pdf/parse_pdf.rb +42 -0
  154. data/ext/numo/gsl/pdf/tmpl/dirichlet.c +39 -0
  155. data/ext/numo/gsl/pdf/tmpl/multinomial.c +39 -0
  156. data/ext/numo/gsl/poly/depend +17 -0
  157. data/ext/numo/gsl/poly/erbpp_poly.rb +70 -0
  158. data/ext/numo/gsl/poly/extconf.rb +9 -0
  159. data/ext/numo/gsl/poly/func_def.rb +234 -0
  160. data/ext/numo/gsl/poly/tmpl/poly_complex_solve.c +59 -0
  161. data/ext/numo/gsl/poly/tmpl/poly_eval.c +70 -0
  162. data/ext/numo/gsl/poly/tmpl/poly_eval_derivs.c +40 -0
  163. data/ext/numo/gsl/ran/depend +17 -0
  164. data/ext/numo/gsl/ran/erbpp_ran.rb +42 -0
  165. data/ext/numo/gsl/ran/extconf.rb +9 -0
  166. data/ext/numo/gsl/ran/func_2.2.1.rb +1658 -0
  167. data/ext/numo/gsl/ran/func_2.2.rb +1658 -0
  168. data/ext/numo/gsl/ran/func_2.3.rb +1658 -0
  169. data/ext/numo/gsl/ran/func_def.rb +1594 -0
  170. data/ext/numo/gsl/ran/parse_ran.rb +10 -0
  171. data/ext/numo/gsl/rng/depend +17 -0
  172. data/ext/numo/gsl/rng/erbpp_rng.rb +58 -0
  173. data/ext/numo/gsl/rng/extconf.rb +9 -0
  174. data/ext/numo/gsl/rng/func_def.rb +230 -0
  175. data/ext/numo/gsl/rng/parse_rng.rb +125 -0
  176. data/ext/numo/gsl/rng/tmpl/ran.c +40 -0
  177. data/ext/numo/gsl/rng/tmpl/ran_DFloat_f_DFloat.c +28 -0
  178. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x2.c +45 -0
  179. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x3.c +51 -0
  180. data/ext/numo/gsl/rng/tmpl/ran_multinomial.c +32 -0
  181. data/ext/numo/gsl/rng/tmpl/rng_DFloat.c +29 -0
  182. data/ext/numo/gsl/rng/tmpl/rng_UInt.c +44 -0
  183. data/ext/numo/gsl/rng/tmpl/rng_alloc.c +24 -0
  184. data/ext/numo/gsl/rng/tmpl/rng_type_new.c +14 -0
  185. data/ext/numo/gsl/rng/type_def.rb +63 -0
  186. data/ext/numo/gsl/rstat/depend +17 -0
  187. data/ext/numo/gsl/rstat/erbpp_rstat.rb +64 -0
  188. data/ext/numo/gsl/rstat/extconf.rb +9 -0
  189. data/ext/numo/gsl/rstat/func_2.2.1.rb +116 -0
  190. data/ext/numo/gsl/rstat/func_2.2.rb +116 -0
  191. data/ext/numo/gsl/rstat/func_2.3.rb +123 -0
  192. data/ext/numo/gsl/rstat/func_def.rb +102 -0
  193. data/ext/numo/gsl/sf/depend +17 -0
  194. data/ext/numo/gsl/sf/erbpp_sf.rb +51 -0
  195. data/ext/numo/gsl/sf/extconf.rb +9 -0
  196. data/ext/numo/gsl/sf/func_def.rb +4703 -0
  197. data/ext/numo/gsl/sf/parse_sf.rb +277 -0
  198. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat.c +50 -0
  199. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat_x2.c +52 -0
  200. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x3_DFloat_x2.c +55 -0
  201. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_DFloat_mode.c +47 -0
  202. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_lmax_array.c +41 -0
  203. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_nmin_nmax_array.c +49 -0
  204. data/ext/numo/gsl/spmatrix/const_2.2.1.rb +3 -0
  205. data/ext/numo/gsl/spmatrix/const_2.2.rb +3 -0
  206. data/ext/numo/gsl/spmatrix/const_2.3.rb +3 -0
  207. data/ext/numo/gsl/spmatrix/const_def.rb +2 -0
  208. data/ext/numo/gsl/spmatrix/depend +17 -0
  209. data/ext/numo/gsl/spmatrix/erbpp_spmatrix.rb +100 -0
  210. data/ext/numo/gsl/spmatrix/extconf.rb +9 -0
  211. data/ext/numo/gsl/spmatrix/func_2.2.1.rb +297 -0
  212. data/ext/numo/gsl/spmatrix/func_2.2.rb +297 -0
  213. data/ext/numo/gsl/spmatrix/func_2.3.rb +297 -0
  214. data/ext/numo/gsl/spmatrix/func_def.rb +218 -0
  215. data/ext/numo/gsl/spmatrix/parse_spmatrix.rb +70 -0
  216. data/ext/numo/gsl/spmatrix/tmpl/itersolve_iterate.c +47 -0
  217. data/ext/numo/gsl/spmatrix/tmpl/itersolve_new.c +22 -0
  218. data/ext/numo/gsl/spmatrix/tmpl/itersolve_type_new.c +16 -0
  219. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemm.c +35 -0
  220. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemv.c +43 -0
  221. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_add.c +22 -0
  222. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c +28 -0
  223. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_new.c +40 -0
  224. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_sp2d.c +25 -0
  225. data/ext/numo/gsl/spmatrix/type_def.rb +1 -0
  226. data/ext/numo/gsl/stats/depend +17 -0
  227. data/ext/numo/gsl/stats/erbpp_stats.rb +29 -0
  228. data/ext/numo/gsl/stats/extconf.rb +9 -0
  229. data/ext/numo/gsl/stats/func_2.2.1.rb +608 -0
  230. data/ext/numo/gsl/stats/func_2.2.rb +608 -0
  231. data/ext/numo/gsl/stats/func_2.3.rb +608 -0
  232. data/ext/numo/gsl/stats/func_def.rb +608 -0
  233. data/ext/numo/gsl/stats/parse_stats.rb +63 -0
  234. data/ext/numo/gsl/stats/tmpl/stats_1a0p.c +37 -0
  235. data/ext/numo/gsl/stats/tmpl/stats_1a0p_index.c +60 -0
  236. data/ext/numo/gsl/stats/tmpl/stats_1a1p.c +41 -0
  237. data/ext/numo/gsl/stats/tmpl/stats_1a2p.c +42 -0
  238. data/ext/numo/gsl/stats/tmpl/stats_2a0p.c +39 -0
  239. data/ext/numo/gsl/stats/tmpl/stats_2a1p.c +43 -0
  240. data/ext/numo/gsl/stats/tmpl/stats_2a2p.c +44 -0
  241. data/ext/numo/gsl/stats/tmpl/stats_minmax.c +37 -0
  242. data/ext/numo/gsl/stats/tmpl/stats_minmax_index.c +67 -0
  243. data/ext/numo/gsl/stats/tmpl/stats_spearman.c +46 -0
  244. data/ext/numo/gsl/sys/const_def.rb +21 -0
  245. data/ext/numo/gsl/sys/depend +17 -0
  246. data/ext/numo/gsl/sys/enum_def.rb +75 -0
  247. data/ext/numo/gsl/sys/erbpp_sys.rb +60 -0
  248. data/ext/numo/gsl/sys/extconf.rb +9 -0
  249. data/ext/numo/gsl/sys/func_def.rb +249 -0
  250. data/ext/numo/gsl/version.h +1 -0
  251. data/ext/numo/gsl/wavelet/depend +17 -0
  252. data/ext/numo/gsl/wavelet/erbpp_wavelet.rb +48 -0
  253. data/ext/numo/gsl/wavelet/extconf.rb +9 -0
  254. data/ext/numo/gsl/wavelet/func_def.rb +337 -0
  255. data/ext/numo/gsl/wavelet/parse_wavelet.rb +47 -0
  256. data/ext/numo/gsl/wavelet/tmpl/wavelet2d_transform.c +56 -0
  257. data/ext/numo/gsl/wavelet/tmpl/wavelet_array_check.c +56 -0
  258. data/ext/numo/gsl/wavelet/tmpl/wavelet_macro.c +1 -0
  259. data/ext/numo/gsl/wavelet/tmpl/wavelet_new.c +20 -0
  260. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform.c +55 -0
  261. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform2.c +22 -0
  262. data/ext/numo/gsl/wavelet/tmpl/wavelet_type_new.c +15 -0
  263. data/ext/numo/gsl/wavelet/type_def.rb +6 -0
  264. data/lib/numo/gsl.rb +17 -0
  265. data/numo-gsl.gemspec +33 -0
  266. metadata +367 -0
@@ -0,0 +1,9 @@
1
+ require_relative '../extconf_gsl.rb'
2
+
3
+ # source file to compile
4
+ srcs = %w(
5
+ gsl_ran
6
+ )
7
+ $objs = srcs.collect{|i| i+".o"}
8
+
9
+ create_makefile('numo/gsl/ran')
@@ -0,0 +1,1658 @@
1
+ [{:func_name=>"gsl_ran_gaussian",
2
+ :func_type=>"double",
3
+ :args=>[["const gsl_rng *", "r"], ["double", "sigma"]],
4
+ :desc=>
5
+ "This function returns a Gaussian random variate, with mean zero and\n" +
6
+ "standard deviation sigma. The probability distribution for\n" +
7
+ "Gaussian random variates is,\n" +
8
+ "\n" +
9
+ "p(x) dx = @{1 \\over \\sqrt@{2 \\pi \\sigma^2@}@} \\exp (-x^2 / 2\\sigma^2) dx\n" +
10
+ "\n" +
11
+ "for x in the range -\\infty to +\\infty. Use the\n" +
12
+ "transformation z = \\mu + x on the numbers returned by\n" +
13
+ "gsl_ran_gaussian to obtain a Gaussian distribution with mean\n" +
14
+ "\\mu. This function uses the Box-Muller algorithm which requires two\n" +
15
+ "calls to the random number generator r."},
16
+ {:func_name=>"gsl_ran_gaussian_pdf",
17
+ :func_type=>"double",
18
+ :args=>[["double", "x"], ["double", "sigma"]],
19
+ :desc=>
20
+ "This function computes the probability density p(x) at x\n" +
21
+ "for a Gaussian distribution with standard deviation sigma, using\n" +
22
+ "the formula given above."},
23
+ {:func_name=>"gsl_ran_gaussian_ziggurat",
24
+ :func_type=>"double",
25
+ :args=>[["const gsl_rng *", "r"], ["double", "sigma"]],
26
+ :desc=>
27
+ "This function computes a Gaussian random variate using the alternative\n" +
28
+ "Marsaglia-Tsang ziggurat and Kinderman-Monahan-Leva ratio methods. The\n" +
29
+ "Ziggurat algorithm is the fastest available algorithm in most cases."},
30
+ {:func_name=>"gsl_ran_gaussian_ratio_method",
31
+ :func_type=>"double",
32
+ :args=>[["const gsl_rng *", "r"], ["double", "sigma"]],
33
+ :desc=>
34
+ "This function computes a Gaussian random variate using the alternative\n" +
35
+ "Marsaglia-Tsang ziggurat and Kinderman-Monahan-Leva ratio methods. The\n" +
36
+ "Ziggurat algorithm is the fastest available algorithm in most cases."},
37
+ {:func_name=>"gsl_ran_ugaussian",
38
+ :func_type=>"double",
39
+ :args=>[["const gsl_rng *", "r"]],
40
+ :desc=>
41
+ "These functions compute results for the unit Gaussian distribution. They\n" +
42
+ "are equivalent to the functions above with a standard deviation of one,\n" +
43
+ "sigma = 1."},
44
+ {:func_name=>"gsl_ran_ugaussian_pdf",
45
+ :func_type=>"double",
46
+ :args=>[["double", "x"]],
47
+ :desc=>
48
+ "These functions compute results for the unit Gaussian distribution. They\n" +
49
+ "are equivalent to the functions above with a standard deviation of one,\n" +
50
+ "sigma = 1."},
51
+ {:func_name=>"gsl_ran_ugaussian_ratio_method",
52
+ :func_type=>"double",
53
+ :args=>[["const gsl_rng *", "r"]],
54
+ :desc=>
55
+ "These functions compute results for the unit Gaussian distribution. They\n" +
56
+ "are equivalent to the functions above with a standard deviation of one,\n" +
57
+ "sigma = 1."},
58
+ {:func_name=>"gsl_cdf_gaussian_P",
59
+ :func_type=>"double",
60
+ :args=>[["double", "x"], ["double", "sigma"]],
61
+ :desc=>
62
+ "These functions compute the cumulative distribution functions\n" +
63
+ "P(x), Q(x) and their inverses for the Gaussian\n" +
64
+ "distribution with standard deviation sigma."},
65
+ {:func_name=>"gsl_cdf_gaussian_Q",
66
+ :func_type=>"double",
67
+ :args=>[["double", "x"], ["double", "sigma"]],
68
+ :desc=>
69
+ "These functions compute the cumulative distribution functions\n" +
70
+ "P(x), Q(x) and their inverses for the Gaussian\n" +
71
+ "distribution with standard deviation sigma."},
72
+ {:func_name=>"gsl_cdf_gaussian_Pinv",
73
+ :func_type=>"double",
74
+ :args=>[["double", "P"], ["double", "sigma"]],
75
+ :desc=>
76
+ "These functions compute the cumulative distribution functions\n" +
77
+ "P(x), Q(x) and their inverses for the Gaussian\n" +
78
+ "distribution with standard deviation sigma."},
79
+ {:func_name=>"gsl_cdf_gaussian_Qinv",
80
+ :func_type=>"double",
81
+ :args=>[["double", "Q"], ["double", "sigma"]],
82
+ :desc=>
83
+ "These functions compute the cumulative distribution functions\n" +
84
+ "P(x), Q(x) and their inverses for the Gaussian\n" +
85
+ "distribution with standard deviation sigma."},
86
+ {:func_name=>"gsl_cdf_ugaussian_P",
87
+ :func_type=>"double",
88
+ :args=>[["double", "x"]],
89
+ :desc=>
90
+ "These functions compute the cumulative distribution functions\n" +
91
+ "P(x), Q(x) and their inverses for the unit Gaussian\n" +
92
+ "distribution."},
93
+ {:func_name=>"gsl_cdf_ugaussian_Q",
94
+ :func_type=>"double",
95
+ :args=>[["double", "x"]],
96
+ :desc=>
97
+ "These functions compute the cumulative distribution functions\n" +
98
+ "P(x), Q(x) and their inverses for the unit Gaussian\n" +
99
+ "distribution."},
100
+ {:func_name=>"gsl_cdf_ugaussian_Pinv",
101
+ :func_type=>"double",
102
+ :args=>[["double", "P"]],
103
+ :desc=>
104
+ "These functions compute the cumulative distribution functions\n" +
105
+ "P(x), Q(x) and their inverses for the unit Gaussian\n" +
106
+ "distribution."},
107
+ {:func_name=>"gsl_cdf_ugaussian_Qinv",
108
+ :func_type=>"double",
109
+ :args=>[["double", "Q"]],
110
+ :desc=>
111
+ "These functions compute the cumulative distribution functions\n" +
112
+ "P(x), Q(x) and their inverses for the unit Gaussian\n" +
113
+ "distribution."},
114
+ {:func_name=>"gsl_ran_gaussian_tail",
115
+ :func_type=>"double",
116
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "sigma"]],
117
+ :desc=>
118
+ "This function provides random variates from the upper tail of a Gaussian\n" +
119
+ "distribution with standard deviation sigma. The values returned\n" +
120
+ "are larger than the lower limit a, which must be positive. The\n" +
121
+ "method is based on Marsaglia's famous rectangle-wedge-tail algorithm (Ann. \n" +
122
+ "Math. Stat. 32, 894--899 (1961)), with this aspect explained in Knuth, v2,\n" +
123
+ "3rd ed, p139,586 (exercise 11).\n" +
124
+ "\n" +
125
+ "The probability distribution for Gaussian tail random variates is,\n" +
126
+ "\n" +
127
+ "p(x) dx = @{1 \\over N(a;\\sigma) \\sqrt@{2 \\pi \\sigma^2@}@} \\exp (- x^2/(2 \\sigma^2)) dx\n" +
128
+ "\n" +
129
+ "for x > a where N(a;\\sigma) is the normalization constant,\n" +
130
+ "\n" +
131
+ "N(a;\\sigma) = (1/2) erfc(a / sqrt(2 sigma^2)).\n"},
132
+ {:func_name=>"gsl_ran_gaussian_tail_pdf",
133
+ :func_type=>"double",
134
+ :args=>[["double", "x"], ["double", "a"], ["double", "sigma"]],
135
+ :desc=>
136
+ "This function computes the probability density p(x) at x\n" +
137
+ "for a Gaussian tail distribution with standard deviation sigma and\n" +
138
+ "lower limit a, using the formula given above."},
139
+ {:func_name=>"gsl_ran_ugaussian_tail",
140
+ :func_type=>"double",
141
+ :args=>[["const gsl_rng *", "r"], ["double", "a"]],
142
+ :desc=>
143
+ "These functions compute results for the tail of a unit Gaussian\n" +
144
+ "distribution. They are equivalent to the functions above with a standard\n" +
145
+ "deviation of one, sigma = 1."},
146
+ {:func_name=>"gsl_ran_ugaussian_tail_pdf",
147
+ :func_type=>"double",
148
+ :args=>[["double", "x"], ["double", "a"]],
149
+ :desc=>
150
+ "These functions compute results for the tail of a unit Gaussian\n" +
151
+ "distribution. They are equivalent to the functions above with a standard\n" +
152
+ "deviation of one, sigma = 1."},
153
+ {:func_name=>"gsl_ran_bivariate_gaussian",
154
+ :func_type=>"void",
155
+ :args=>
156
+ [["const gsl_rng *", "r"],
157
+ ["double", "sigma_x"],
158
+ ["double", "sigma_y"],
159
+ ["double", "rho"],
160
+ ["double *", "x"],
161
+ ["double *", "y"]],
162
+ :desc=>
163
+ "This function generates a pair of correlated Gaussian variates, with\n" +
164
+ "mean zero, correlation coefficient rho and standard deviations\n" +
165
+ "sigma_x and sigma_y in the x and y directions.\n" +
166
+ "The probability distribution for bivariate Gaussian random variates is,\n" +
167
+ "\n" +
168
+ "p(x,y) dx dy = @{1 \\over 2 \\pi \\sigma_x \\sigma_y \\sqrt@{1-\\rho^2@}@} \\exp (-(x^2/\\sigma_x^2 + y^2/\\sigma_y^2 - 2 \\rho x y/(\\sigma_x\\sigma_y))/2(1-\\rho^2)) dx dy\n" +
169
+ "\n" +
170
+ "for x,y in the range -\\infty to +\\infty. The\n" +
171
+ "correlation coefficient rho should lie between 1 and\n" +
172
+ "-1."},
173
+ {:func_name=>"gsl_ran_bivariate_gaussian_pdf",
174
+ :func_type=>"double",
175
+ :args=>
176
+ [["double", "x"],
177
+ ["double", "y"],
178
+ ["double", "sigma_x"],
179
+ ["double", "sigma_y"],
180
+ ["double", "rho"]],
181
+ :desc=>
182
+ "This function computes the probability density p(x,y) at\n" +
183
+ "(x,y) for a bivariate Gaussian distribution with standard\n" +
184
+ "deviations sigma_x, sigma_y and correlation coefficient\n" +
185
+ "rho, using the formula given above."},
186
+ {:func_name=>"gsl_ran_multivariate_gaussian",
187
+ :func_type=>"int",
188
+ :args=>
189
+ [["const gsl_rng *", "r"],
190
+ ["const gsl_vector *", "mu"],
191
+ ["const gsl_matrix *", "L"],
192
+ ["gsl_vector *", "result"]],
193
+ :desc=>
194
+ "This function generates a random vector satisfying the k-dimensional multivariate Gaussian\n" +
195
+ "distribution with mean \\mu and variance-covariance matrix\n" +
196
+ "\\Sigma. On input, the k-vector \\mu is given in mu, and\n" +
197
+ "the Cholesky factor of the k-by-k matrix \\Sigma = L L^T is\n" +
198
+ "given in the lower triangle of L, as output from gsl_linalg_cholesky_decomp.\n" +
199
+ "The random vector is stored in result on output. The probability distribution\n" +
200
+ "for multivariate Gaussian random variates is\n" +
201
+ "\n" +
202
+ "p(x_1,...,x_k) dx_1 ... dx_k = @{1 \\over \\sqrt@{(2 \\pi)^k |\\Sigma|@} \\exp \\left(-@{1 \\over 2@} (x - \\mu)^T \\Sigma^@{-1@} (x - \\mu)\\right) dx_1 \\dots dx_k\n"},
203
+ {:func_name=>"gsl_ran_multivariate_gaussian_pdf",
204
+ :func_type=>"int",
205
+ :args=>
206
+ [["const gsl_vector *", "x"],
207
+ ["const gsl_vector *", "mu"],
208
+ ["const gsl_matrix *", "L"],
209
+ ["double *", "result"],
210
+ ["gsl_vector *", "work"]],
211
+ :desc=>
212
+ "These functions compute p(x) or \\log{p(x)} at the point x, using mean vector\n" +
213
+ "mu and variance-covariance matrix specified by its Cholesky factor L using the formula\n" +
214
+ "above. Additional workspace of length k is required in work."},
215
+ {:func_name=>"gsl_ran_multivariate_gaussian_log_pdf",
216
+ :func_type=>"int",
217
+ :args=>
218
+ [["const gsl_vector *", "x"],
219
+ ["const gsl_vector *", "mu"],
220
+ ["const gsl_matrix *", "L"],
221
+ ["double *", "result"],
222
+ ["gsl_vector *", "work"]],
223
+ :desc=>
224
+ "These functions compute p(x) or \\log{p(x)} at the point x, using mean vector\n" +
225
+ "mu and variance-covariance matrix specified by its Cholesky factor L using the formula\n" +
226
+ "above. Additional workspace of length k is required in work."},
227
+ {:func_name=>"gsl_ran_multivariate_gaussian_mean",
228
+ :func_type=>"int",
229
+ :args=>[["const gsl_matrix *", "X"], ["gsl_vector *", "mu_hat"]],
230
+ :desc=>
231
+ "Given a set of n samples X_j from a k-dimensional multivariate Gaussian distribution,\n" +
232
+ "this function computes the maximum likelihood estimate of the mean of the distribution, given by\n" +
233
+ "\n" +
234
+ "\\Hat@{\\mu@} = @{1 \\over n@} \\sum_@{j=1@}^n X_j\n" +
235
+ "\n" +
236
+ "The samples X_1,X_2,\\dots,X_n are given in the n-by-k matrix X, and the maximum\n" +
237
+ "likelihood estimate of the mean is stored in mu_hat on output."},
238
+ {:func_name=>"gsl_ran_multivariate_gaussian_vcov",
239
+ :func_type=>"int",
240
+ :args=>[["const gsl_matrix *", "X"], ["gsl_matrix *", "sigma_hat"]],
241
+ :desc=>
242
+ "Given a set of n samples X_j from a k-dimensional multivariate Gaussian distribution,\n" +
243
+ "this function computes the maximum likelihood estimate of the variance-covariance matrix of the distribution,\n" +
244
+ "given by\n" +
245
+ "\n" +
246
+ "\\Hat@{\\Sigma@} = @{1 \\over n@} \\sum_@{j=1@}^n \\left( X_j - \\Hat@{\\mu@} \\right) \\left( X_j - \\Hat@{\\mu@} \\right)^T\n" +
247
+ "\n" +
248
+ "The samples X_1,X_2,\\dots,X_n are given in the n-by-k matrix X and the maximum\n" +
249
+ "likelihood estimate of the variance-covariance matrix is stored in sigma_hat on output."},
250
+ {:func_name=>"gsl_ran_exponential",
251
+ :func_type=>"double",
252
+ :args=>[["const gsl_rng *", "r"], ["double", "mu"]],
253
+ :desc=>
254
+ "This function returns a random variate from the exponential distribution\n" +
255
+ "with mean mu. The distribution is,\n" +
256
+ "\n" +
257
+ "p(x) dx = @{1 \\over \\mu@} \\exp(-x/\\mu) dx\n" +
258
+ "\n" +
259
+ "for $x \\ge 0$\n" +
260
+ "x >= 0. "},
261
+ {:func_name=>"gsl_ran_exponential_pdf",
262
+ :func_type=>"double",
263
+ :args=>[["double", "x"], ["double", "mu"]],
264
+ :desc=>
265
+ "This function computes the probability density p(x) at x\n" +
266
+ "for an exponential distribution with mean mu, using the formula\n" +
267
+ "given above."},
268
+ {:func_name=>"gsl_cdf_exponential_P",
269
+ :func_type=>"double",
270
+ :args=>[["double", "x"], ["double", "mu"]],
271
+ :desc=>
272
+ "These functions compute the cumulative distribution functions\n" +
273
+ "P(x), Q(x) and their inverses for the exponential\n" +
274
+ "distribution with mean mu."},
275
+ {:func_name=>"gsl_cdf_exponential_Q",
276
+ :func_type=>"double",
277
+ :args=>[["double", "x"], ["double", "mu"]],
278
+ :desc=>
279
+ "These functions compute the cumulative distribution functions\n" +
280
+ "P(x), Q(x) and their inverses for the exponential\n" +
281
+ "distribution with mean mu."},
282
+ {:func_name=>"gsl_cdf_exponential_Pinv",
283
+ :func_type=>"double",
284
+ :args=>[["double", "P"], ["double", "mu"]],
285
+ :desc=>
286
+ "These functions compute the cumulative distribution functions\n" +
287
+ "P(x), Q(x) and their inverses for the exponential\n" +
288
+ "distribution with mean mu."},
289
+ {:func_name=>"gsl_cdf_exponential_Qinv",
290
+ :func_type=>"double",
291
+ :args=>[["double", "Q"], ["double", "mu"]],
292
+ :desc=>
293
+ "These functions compute the cumulative distribution functions\n" +
294
+ "P(x), Q(x) and their inverses for the exponential\n" +
295
+ "distribution with mean mu."},
296
+ {:func_name=>"gsl_ran_laplace",
297
+ :func_type=>"double",
298
+ :args=>[["const gsl_rng *", "r"], ["double", "a"]],
299
+ :desc=>
300
+ "This function returns a random variate from the Laplace distribution\n" +
301
+ "with width a. The distribution is,\n" +
302
+ "\n" +
303
+ "p(x) dx = @{1 \\over 2 a@} \\exp(-|x/a|) dx\n" +
304
+ "\n" +
305
+ "for -\\infty < x < \\infty."},
306
+ {:func_name=>"gsl_ran_laplace_pdf",
307
+ :func_type=>"double",
308
+ :args=>[["double", "x"], ["double", "a"]],
309
+ :desc=>
310
+ "This function computes the probability density p(x) at x\n" +
311
+ "for a Laplace distribution with width a, using the formula\n" +
312
+ "given above."},
313
+ {:func_name=>"gsl_cdf_laplace_P",
314
+ :func_type=>"double",
315
+ :args=>[["double", "x"], ["double", "a"]],
316
+ :desc=>
317
+ "These functions compute the cumulative distribution functions\n" +
318
+ "P(x), Q(x) and their inverses for the Laplace\n" +
319
+ "distribution with width a."},
320
+ {:func_name=>"gsl_cdf_laplace_Q",
321
+ :func_type=>"double",
322
+ :args=>[["double", "x"], ["double", "a"]],
323
+ :desc=>
324
+ "These functions compute the cumulative distribution functions\n" +
325
+ "P(x), Q(x) and their inverses for the Laplace\n" +
326
+ "distribution with width a."},
327
+ {:func_name=>"gsl_cdf_laplace_Pinv",
328
+ :func_type=>"double",
329
+ :args=>[["double", "P"], ["double", "a"]],
330
+ :desc=>
331
+ "These functions compute the cumulative distribution functions\n" +
332
+ "P(x), Q(x) and their inverses for the Laplace\n" +
333
+ "distribution with width a."},
334
+ {:func_name=>"gsl_cdf_laplace_Qinv",
335
+ :func_type=>"double",
336
+ :args=>[["double", "Q"], ["double", "a"]],
337
+ :desc=>
338
+ "These functions compute the cumulative distribution functions\n" +
339
+ "P(x), Q(x) and their inverses for the Laplace\n" +
340
+ "distribution with width a."},
341
+ {:func_name=>"gsl_ran_exppow",
342
+ :func_type=>"double",
343
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
344
+ :desc=>
345
+ "This function returns a random variate from the exponential power distribution\n" +
346
+ "with scale parameter a and exponent b. The distribution is,\n" +
347
+ "\n" +
348
+ "p(x) dx = @{1 \\over 2 a \\Gamma(1+1/b)@} \\exp(-|x/a|^b) dx\n" +
349
+ "\n" +
350
+ "for $x \\ge 0$\n" +
351
+ "x >= 0. For b = 1 this reduces to the Laplace\n" +
352
+ "distribution. For b = 2 it has the same form as a Gaussian\n" +
353
+ "distribution, but with $a = \\sqrt{2} \\sigma$\n" +
354
+ "a = \\sqrt@{2@} \\sigma."},
355
+ {:func_name=>"gsl_ran_exppow_pdf",
356
+ :func_type=>"double",
357
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
358
+ :desc=>
359
+ "This function computes the probability density p(x) at x\n" +
360
+ "for an exponential power distribution with scale parameter a\n" +
361
+ "and exponent b, using the formula given above."},
362
+ {:func_name=>"gsl_cdf_exppow_P",
363
+ :func_type=>"double",
364
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
365
+ :desc=>
366
+ "These functions compute the cumulative distribution functions\n" +
367
+ "P(x), Q(x) for the exponential power distribution with\n" +
368
+ "parameters a and b."},
369
+ {:func_name=>"gsl_cdf_exppow_Q",
370
+ :func_type=>"double",
371
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
372
+ :desc=>
373
+ "These functions compute the cumulative distribution functions\n" +
374
+ "P(x), Q(x) for the exponential power distribution with\n" +
375
+ "parameters a and b."},
376
+ {:func_name=>"gsl_ran_cauchy",
377
+ :func_type=>"double",
378
+ :args=>[["const gsl_rng *", "r"], ["double", "a"]],
379
+ :desc=>
380
+ "This function returns a random variate from the Cauchy distribution with\n" +
381
+ "scale parameter a. The probability distribution for Cauchy\n" +
382
+ "random variates is,\n" +
383
+ "\n" +
384
+ "p(x) dx = @{1 \\over a\\pi (1 + (x/a)^2) @} dx\n" +
385
+ "\n" +
386
+ "for x in the range -\\infty to +\\infty. The Cauchy\n" +
387
+ "distribution is also known as the Lorentz distribution."},
388
+ {:func_name=>"gsl_ran_cauchy_pdf",
389
+ :func_type=>"double",
390
+ :args=>[["double", "x"], ["double", "a"]],
391
+ :desc=>
392
+ "This function computes the probability density p(x) at x\n" +
393
+ "for a Cauchy distribution with scale parameter a, using the formula\n" +
394
+ "given above."},
395
+ {:func_name=>"gsl_cdf_cauchy_P",
396
+ :func_type=>"double",
397
+ :args=>[["double", "x"], ["double", "a"]],
398
+ :desc=>
399
+ "These functions compute the cumulative distribution functions\n" +
400
+ "P(x), Q(x) and their inverses for the Cauchy\n" +
401
+ "distribution with scale parameter a."},
402
+ {:func_name=>"gsl_cdf_cauchy_Q",
403
+ :func_type=>"double",
404
+ :args=>[["double", "x"], ["double", "a"]],
405
+ :desc=>
406
+ "These functions compute the cumulative distribution functions\n" +
407
+ "P(x), Q(x) and their inverses for the Cauchy\n" +
408
+ "distribution with scale parameter a."},
409
+ {:func_name=>"gsl_cdf_cauchy_Pinv",
410
+ :func_type=>"double",
411
+ :args=>[["double", "P"], ["double", "a"]],
412
+ :desc=>
413
+ "These functions compute the cumulative distribution functions\n" +
414
+ "P(x), Q(x) and their inverses for the Cauchy\n" +
415
+ "distribution with scale parameter a."},
416
+ {:func_name=>"gsl_cdf_cauchy_Qinv",
417
+ :func_type=>"double",
418
+ :args=>[["double", "Q"], ["double", "a"]],
419
+ :desc=>
420
+ "These functions compute the cumulative distribution functions\n" +
421
+ "P(x), Q(x) and their inverses for the Cauchy\n" +
422
+ "distribution with scale parameter a."},
423
+ {:func_name=>"gsl_ran_rayleigh",
424
+ :func_type=>"double",
425
+ :args=>[["const gsl_rng *", "r"], ["double", "sigma"]],
426
+ :desc=>
427
+ "This function returns a random variate from the Rayleigh distribution with\n" +
428
+ "scale parameter sigma. The distribution is,\n" +
429
+ "\n" +
430
+ "p(x) dx = @{x \\over \\sigma^2@} \\exp(- x^2/(2 \\sigma^2)) dx\n" +
431
+ "\n" +
432
+ "for x > 0."},
433
+ {:func_name=>"gsl_ran_rayleigh_pdf",
434
+ :func_type=>"double",
435
+ :args=>[["double", "x"], ["double", "sigma"]],
436
+ :desc=>
437
+ "This function computes the probability density p(x) at x\n" +
438
+ "for a Rayleigh distribution with scale parameter sigma, using the\n" +
439
+ "formula given above."},
440
+ {:func_name=>"gsl_cdf_rayleigh_P",
441
+ :func_type=>"double",
442
+ :args=>[["double", "x"], ["double", "sigma"]],
443
+ :desc=>
444
+ "These functions compute the cumulative distribution functions\n" +
445
+ "P(x), Q(x) and their inverses for the Rayleigh\n" +
446
+ "distribution with scale parameter sigma."},
447
+ {:func_name=>"gsl_cdf_rayleigh_Q",
448
+ :func_type=>"double",
449
+ :args=>[["double", "x"], ["double", "sigma"]],
450
+ :desc=>
451
+ "These functions compute the cumulative distribution functions\n" +
452
+ "P(x), Q(x) and their inverses for the Rayleigh\n" +
453
+ "distribution with scale parameter sigma."},
454
+ {:func_name=>"gsl_cdf_rayleigh_Pinv",
455
+ :func_type=>"double",
456
+ :args=>[["double", "P"], ["double", "sigma"]],
457
+ :desc=>
458
+ "These functions compute the cumulative distribution functions\n" +
459
+ "P(x), Q(x) and their inverses for the Rayleigh\n" +
460
+ "distribution with scale parameter sigma."},
461
+ {:func_name=>"gsl_cdf_rayleigh_Qinv",
462
+ :func_type=>"double",
463
+ :args=>[["double", "Q"], ["double", "sigma"]],
464
+ :desc=>
465
+ "These functions compute the cumulative distribution functions\n" +
466
+ "P(x), Q(x) and their inverses for the Rayleigh\n" +
467
+ "distribution with scale parameter sigma."},
468
+ {:func_name=>"gsl_ran_rayleigh_tail",
469
+ :func_type=>"double",
470
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "sigma"]],
471
+ :desc=>
472
+ "This function returns a random variate from the tail of the Rayleigh\n" +
473
+ "distribution with scale parameter sigma and a lower limit of\n" +
474
+ "a. The distribution is,\n" +
475
+ "\n" +
476
+ "p(x) dx = @{x \\over \\sigma^2@} \\exp ((a^2 - x^2) /(2 \\sigma^2)) dx\n" +
477
+ "\n" +
478
+ "for x > a."},
479
+ {:func_name=>"gsl_ran_rayleigh_tail_pdf",
480
+ :func_type=>"double",
481
+ :args=>[["double", "x"], ["double", "a"], ["double", "sigma"]],
482
+ :desc=>
483
+ "This function computes the probability density p(x) at x\n" +
484
+ "for a Rayleigh tail distribution with scale parameter sigma and\n" +
485
+ "lower limit a, using the formula given above."},
486
+ {:func_name=>"gsl_ran_landau",
487
+ :func_type=>"double",
488
+ :args=>[["const gsl_rng *", "r"]],
489
+ :desc=>
490
+ "This function returns a random variate from the Landau distribution. The\n" +
491
+ "probability distribution for Landau random variates is defined\n" +
492
+ "analytically by the complex integral,\n" +
493
+ "\n" +
494
+ "p(x) = (1/(2 \\pi i)) \\int_@{c-i\\infty@}^@{c+i\\infty@} ds exp(s log(s) + x s) \n" +
495
+ "For numerical purposes it is more convenient to use the following\n" +
496
+ "equivalent form of the integral,\n" +
497
+ "\n" +
498
+ "p(x) = (1/\\pi) \\int_0^\\infty dt \\exp(-t \\log(t) - x t) \\sin(\\pi t)."},
499
+ {:func_name=>"gsl_ran_landau_pdf",
500
+ :func_type=>"double",
501
+ :args=>[["double", "x"]],
502
+ :desc=>
503
+ "This function computes the probability density p(x) at x\n" +
504
+ "for the Landau distribution using an approximation to the formula given\n" +
505
+ "above."},
506
+ {:func_name=>"gsl_ran_levy",
507
+ :func_type=>"double",
508
+ :args=>[["const gsl_rng *", "r"], ["double", "c"], ["double", "alpha"]],
509
+ :desc=>
510
+ "This function returns a random variate from the Levy symmetric stable\n" +
511
+ "distribution with scale c and exponent alpha. The symmetric\n" +
512
+ "stable probability distribution is defined by a Fourier transform,\n" +
513
+ "\n" +
514
+ "p(x) = @{1 \\over 2 \\pi@} \\int_@{-\\infty@}^@{+\\infty@} dt \\exp(-it x - |c t|^alpha)\n" +
515
+ "\n" +
516
+ "There is no explicit solution for the form of p(x) and the\n" +
517
+ "library does not define a corresponding pdf function. For\n" +
518
+ "\\alpha = 1 the distribution reduces to the Cauchy distribution. For\n" +
519
+ "\\alpha = 2 it is a Gaussian distribution with $\\sigma = \\sqrt{2} c$ \n" +
520
+ "\\sigma = \\sqrt@{2@} c. For \\alpha < 1 the tails of the\n" +
521
+ "distribution become extremely wide.\n" +
522
+ "\n" +
523
+ "The algorithm only works for $0 < \\alpha \\le 2$\n" +
524
+ "0 < alpha <= 2."},
525
+ {:func_name=>"gsl_ran_levy_skew",
526
+ :func_type=>"double",
527
+ :args=>
528
+ [["const gsl_rng *", "r"],
529
+ ["double", "c"],
530
+ ["double", "alpha"],
531
+ ["double", "beta"]],
532
+ :desc=>
533
+ "This function returns a random variate from the Levy skew stable\n" +
534
+ "distribution with scale c, exponent alpha and skewness\n" +
535
+ "parameter beta. The skewness parameter must lie in the range\n" +
536
+ "[-1,1]. The Levy skew stable probability distribution is defined\n" +
537
+ "by a Fourier transform,\n" +
538
+ "\n" +
539
+ "p(x) = @{1 \\over 2 \\pi@} \\int_@{-\\infty@}^@{+\\infty@} dt \\exp(-it x - |c t|^alpha (1-i beta sign(t) tan(pi alpha/2)))\n" +
540
+ "\n" +
541
+ "When \\alpha = 1 the term \\tan(\\pi \\alpha/2) is replaced by\n" +
542
+ "-(2/\\pi)\\log|t|. There is no explicit solution for the form of\n" +
543
+ "p(x) and the library does not define a corresponding pdf\n" +
544
+ "function. For \\alpha = 2 the distribution reduces to a Gaussian\n" +
545
+ "distribution with $\\sigma = \\sqrt{2} c$ \n" +
546
+ "\\sigma = \\sqrt@{2@} c and the skewness parameter has no effect. \n" +
547
+ "For \\alpha < 1 the tails of the distribution become extremely\n" +
548
+ "wide. The symmetric distribution corresponds to \\beta =\n" +
549
+ "0.\n" +
550
+ "\n" +
551
+ "The algorithm only works for $0 < \\alpha \\le 2$\n" +
552
+ "0 < alpha <= 2."},
553
+ {:func_name=>"gsl_ran_gamma",
554
+ :func_type=>"double",
555
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
556
+ :desc=>
557
+ "This function returns a random variate from the gamma\n" +
558
+ "distribution. The distribution function is,\n" +
559
+ "\n" +
560
+ "p(x) dx = @{1 \\over \\Gamma(a) b^a@} x^@{a-1@} e^@{-x/b@} dx\n" +
561
+ "\n" +
562
+ "for x > 0.\n" +
563
+ "If X and Y are independent gamma-distributed random\n" +
564
+ "variables of order a and b, then X+Y has a gamma\n" +
565
+ "distribution of order a+b.\n" +
566
+ "\n" +
567
+ "The gamma distribution with an integer parameter a is known as the Erlang distribution.\n" +
568
+ "\n" +
569
+ "The variates are computed using the Marsaglia-Tsang fast gamma method.\n" +
570
+ "This function for this method was previously called\n" +
571
+ "gsl_ran_gamma_mt and can still be accessed using this name."},
572
+ {:func_name=>"gsl_ran_gamma_knuth",
573
+ :func_type=>"double",
574
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
575
+ :desc=>
576
+ "This function returns a gamma variate using the algorithms from Knuth (vol 2)."},
577
+ {:func_name=>"gsl_ran_gamma_pdf",
578
+ :func_type=>"double",
579
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
580
+ :desc=>
581
+ "This function computes the probability density p(x) at x\n" +
582
+ "for a gamma distribution with parameters a and b, using the\n" +
583
+ "formula given above."},
584
+ {:func_name=>"gsl_cdf_gamma_P",
585
+ :func_type=>"double",
586
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
587
+ :desc=>
588
+ "These functions compute the cumulative distribution functions\n" +
589
+ "P(x), Q(x) and their inverses for the gamma\n" +
590
+ "distribution with parameters a and b."},
591
+ {:func_name=>"gsl_cdf_gamma_Q",
592
+ :func_type=>"double",
593
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
594
+ :desc=>
595
+ "These functions compute the cumulative distribution functions\n" +
596
+ "P(x), Q(x) and their inverses for the gamma\n" +
597
+ "distribution with parameters a and b."},
598
+ {:func_name=>"gsl_cdf_gamma_Pinv",
599
+ :func_type=>"double",
600
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
601
+ :desc=>
602
+ "These functions compute the cumulative distribution functions\n" +
603
+ "P(x), Q(x) and their inverses for the gamma\n" +
604
+ "distribution with parameters a and b."},
605
+ {:func_name=>"gsl_cdf_gamma_Qinv",
606
+ :func_type=>"double",
607
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
608
+ :desc=>
609
+ "These functions compute the cumulative distribution functions\n" +
610
+ "P(x), Q(x) and their inverses for the gamma\n" +
611
+ "distribution with parameters a and b."},
612
+ {:func_name=>"gsl_ran_flat",
613
+ :func_type=>"double",
614
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
615
+ :desc=>
616
+ "This function returns a random variate from the flat (uniform)\n" +
617
+ "distribution from a to b. The distribution is,\n" +
618
+ "\n" +
619
+ "p(x) dx = @{1 \\over (b-a)@} dx\n" +
620
+ "\n" +
621
+ "if $a \\le x < b$\n" +
622
+ "a <= x < b and 0 otherwise."},
623
+ {:func_name=>"gsl_ran_flat_pdf",
624
+ :func_type=>"double",
625
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
626
+ :desc=>
627
+ "This function computes the probability density p(x) at x\n" +
628
+ "for a uniform distribution from a to b, using the formula\n" +
629
+ "given above."},
630
+ {:func_name=>"gsl_cdf_flat_P",
631
+ :func_type=>"double",
632
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
633
+ :desc=>
634
+ "These functions compute the cumulative distribution functions\n" +
635
+ "P(x), Q(x) and their inverses for a uniform distribution\n" +
636
+ "from a to b."},
637
+ {:func_name=>"gsl_cdf_flat_Q",
638
+ :func_type=>"double",
639
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
640
+ :desc=>
641
+ "These functions compute the cumulative distribution functions\n" +
642
+ "P(x), Q(x) and their inverses for a uniform distribution\n" +
643
+ "from a to b."},
644
+ {:func_name=>"gsl_cdf_flat_Pinv",
645
+ :func_type=>"double",
646
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
647
+ :desc=>
648
+ "These functions compute the cumulative distribution functions\n" +
649
+ "P(x), Q(x) and their inverses for a uniform distribution\n" +
650
+ "from a to b."},
651
+ {:func_name=>"gsl_cdf_flat_Qinv",
652
+ :func_type=>"double",
653
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
654
+ :desc=>
655
+ "These functions compute the cumulative distribution functions\n" +
656
+ "P(x), Q(x) and their inverses for a uniform distribution\n" +
657
+ "from a to b."},
658
+ {:func_name=>"gsl_ran_lognormal",
659
+ :func_type=>"double",
660
+ :args=>[["const gsl_rng *", "r"], ["double", "zeta"], ["double", "sigma"]],
661
+ :desc=>
662
+ "This function returns a random variate from the lognormal\n" +
663
+ "distribution. The distribution function is,\n" +
664
+ "\n" +
665
+ "p(x) dx = @{1 \\over x \\sqrt@{2 \\pi \\sigma^2@} @} \\exp(-(\\ln(x) - \\zeta)^2/2 \\sigma^2) dx\n" +
666
+ "\n" +
667
+ "for x > 0."},
668
+ {:func_name=>"gsl_ran_lognormal_pdf",
669
+ :func_type=>"double",
670
+ :args=>[["double", "x"], ["double", "zeta"], ["double", "sigma"]],
671
+ :desc=>
672
+ "This function computes the probability density p(x) at x\n" +
673
+ "for a lognormal distribution with parameters zeta and sigma,\n" +
674
+ "using the formula given above."},
675
+ {:func_name=>"gsl_cdf_lognormal_P",
676
+ :func_type=>"double",
677
+ :args=>[["double", "x"], ["double", "zeta"], ["double", "sigma"]],
678
+ :desc=>
679
+ "These functions compute the cumulative distribution functions\n" +
680
+ "P(x), Q(x) and their inverses for the lognormal\n" +
681
+ "distribution with parameters zeta and sigma."},
682
+ {:func_name=>"gsl_cdf_lognormal_Q",
683
+ :func_type=>"double",
684
+ :args=>[["double", "x"], ["double", "zeta"], ["double", "sigma"]],
685
+ :desc=>
686
+ "These functions compute the cumulative distribution functions\n" +
687
+ "P(x), Q(x) and their inverses for the lognormal\n" +
688
+ "distribution with parameters zeta and sigma."},
689
+ {:func_name=>"gsl_cdf_lognormal_Pinv",
690
+ :func_type=>"double",
691
+ :args=>[["double", "P"], ["double", "zeta"], ["double", "sigma"]],
692
+ :desc=>
693
+ "These functions compute the cumulative distribution functions\n" +
694
+ "P(x), Q(x) and their inverses for the lognormal\n" +
695
+ "distribution with parameters zeta and sigma."},
696
+ {:func_name=>"gsl_cdf_lognormal_Qinv",
697
+ :func_type=>"double",
698
+ :args=>[["double", "Q"], ["double", "zeta"], ["double", "sigma"]],
699
+ :desc=>
700
+ "These functions compute the cumulative distribution functions\n" +
701
+ "P(x), Q(x) and their inverses for the lognormal\n" +
702
+ "distribution with parameters zeta and sigma."},
703
+ {:func_name=>"gsl_ran_chisq",
704
+ :func_type=>"double",
705
+ :args=>[["const gsl_rng *", "r"], ["double", "nu"]],
706
+ :desc=>
707
+ "This function returns a random variate from the chi-squared distribution\n" +
708
+ "with nu degrees of freedom. The distribution function is,\n" +
709
+ "\n" +
710
+ "p(x) dx = @{1 \\over 2 \\Gamma(\\nu/2) @} (x/2)^@{\\nu/2 - 1@} \\exp(-x/2) dx\n" +
711
+ "\n" +
712
+ "for $x \\ge 0$\n" +
713
+ "x >= 0. "},
714
+ {:func_name=>"gsl_ran_chisq_pdf",
715
+ :func_type=>"double",
716
+ :args=>[["double", "x"], ["double", "nu"]],
717
+ :desc=>
718
+ "This function computes the probability density p(x) at x\n" +
719
+ "for a chi-squared distribution with nu degrees of freedom, using\n" +
720
+ "the formula given above."},
721
+ {:func_name=>"gsl_cdf_chisq_P",
722
+ :func_type=>"double",
723
+ :args=>[["double", "x"], ["double", "nu"]],
724
+ :desc=>
725
+ "These functions compute the cumulative distribution functions\n" +
726
+ "P(x), Q(x) and their inverses for the chi-squared\n" +
727
+ "distribution with nu degrees of freedom."},
728
+ {:func_name=>"gsl_cdf_chisq_Q",
729
+ :func_type=>"double",
730
+ :args=>[["double", "x"], ["double", "nu"]],
731
+ :desc=>
732
+ "These functions compute the cumulative distribution functions\n" +
733
+ "P(x), Q(x) and their inverses for the chi-squared\n" +
734
+ "distribution with nu degrees of freedom."},
735
+ {:func_name=>"gsl_cdf_chisq_Pinv",
736
+ :func_type=>"double",
737
+ :args=>[["double", "P"], ["double", "nu"]],
738
+ :desc=>
739
+ "These functions compute the cumulative distribution functions\n" +
740
+ "P(x), Q(x) and their inverses for the chi-squared\n" +
741
+ "distribution with nu degrees of freedom."},
742
+ {:func_name=>"gsl_cdf_chisq_Qinv",
743
+ :func_type=>"double",
744
+ :args=>[["double", "Q"], ["double", "nu"]],
745
+ :desc=>
746
+ "These functions compute the cumulative distribution functions\n" +
747
+ "P(x), Q(x) and their inverses for the chi-squared\n" +
748
+ "distribution with nu degrees of freedom."},
749
+ {:func_name=>"gsl_ran_fdist",
750
+ :func_type=>"double",
751
+ :args=>[["const gsl_rng *", "r"], ["double", "nu1"], ["double", "nu2"]],
752
+ :desc=>
753
+ "This function returns a random variate from the F-distribution with degrees of freedom nu1 and nu2. The distribution function is,\n" +
754
+ "\n" +
755
+ "p(x) dx = \n" +
756
+ " @{ \\Gamma((\\nu_1 + \\nu_2)/2)\n" +
757
+ " \\over \\Gamma(\\nu_1/2) \\Gamma(\\nu_2/2) @} \n" +
758
+ " \\nu_1^@{\\nu_1/2@} \\nu_2^@{\\nu_2/2@} \n" +
759
+ " x^@{\\nu_1/2 - 1@} (\\nu_2 + \\nu_1 x)^@{-\\nu_1/2 -\\nu_2/2@}\n" +
760
+ "\n" +
761
+ "for $x \\ge 0$\n" +
762
+ "x >= 0. "},
763
+ {:func_name=>"gsl_ran_fdist_pdf",
764
+ :func_type=>"double",
765
+ :args=>[["double", "x"], ["double", "nu1"], ["double", "nu2"]],
766
+ :desc=>
767
+ "This function computes the probability density p(x) at x\n" +
768
+ "for an F-distribution with nu1 and nu2 degrees of freedom,\n" +
769
+ "using the formula given above."},
770
+ {:func_name=>"gsl_cdf_fdist_P",
771
+ :func_type=>"double",
772
+ :args=>[["double", "x"], ["double", "nu1"], ["double", "nu2"]],
773
+ :desc=>
774
+ "These functions compute the cumulative distribution functions\n" +
775
+ "P(x), Q(x) and their inverses for the F-distribution\n" +
776
+ "with nu1 and nu2 degrees of freedom."},
777
+ {:func_name=>"gsl_cdf_fdist_Q",
778
+ :func_type=>"double",
779
+ :args=>[["double", "x"], ["double", "nu1"], ["double", "nu2"]],
780
+ :desc=>
781
+ "These functions compute the cumulative distribution functions\n" +
782
+ "P(x), Q(x) and their inverses for the F-distribution\n" +
783
+ "with nu1 and nu2 degrees of freedom."},
784
+ {:func_name=>"gsl_cdf_fdist_Pinv",
785
+ :func_type=>"double",
786
+ :args=>[["double", "P"], ["double", "nu1"], ["double", "nu2"]],
787
+ :desc=>
788
+ "These functions compute the cumulative distribution functions\n" +
789
+ "P(x), Q(x) and their inverses for the F-distribution\n" +
790
+ "with nu1 and nu2 degrees of freedom."},
791
+ {:func_name=>"gsl_cdf_fdist_Qinv",
792
+ :func_type=>"double",
793
+ :args=>[["double", "Q"], ["double", "nu1"], ["double", "nu2"]],
794
+ :desc=>
795
+ "These functions compute the cumulative distribution functions\n" +
796
+ "P(x), Q(x) and their inverses for the F-distribution\n" +
797
+ "with nu1 and nu2 degrees of freedom."},
798
+ {:func_name=>"gsl_ran_tdist",
799
+ :func_type=>"double",
800
+ :args=>[["const gsl_rng *", "r"], ["double", "nu"]],
801
+ :desc=>
802
+ "This function returns a random variate from the t-distribution. The\n" +
803
+ "distribution function is,\n" +
804
+ "\n" +
805
+ "p(x) dx = @{\\Gamma((\\nu + 1)/2) \\over \\sqrt@{\\pi \\nu@} \\Gamma(\\nu/2)@}\n" +
806
+ " (1 + x^2/\\nu)^@{-(\\nu + 1)/2@} dx\n" +
807
+ "\n" +
808
+ "for -\\infty < x < +\\infty."},
809
+ {:func_name=>"gsl_ran_tdist_pdf",
810
+ :func_type=>"double",
811
+ :args=>[["double", "x"], ["double", "nu"]],
812
+ :desc=>
813
+ "This function computes the probability density p(x) at x\n" +
814
+ "for a t-distribution with nu degrees of freedom, using the formula\n" +
815
+ "given above."},
816
+ {:func_name=>"gsl_cdf_tdist_P",
817
+ :func_type=>"double",
818
+ :args=>[["double", "x"], ["double", "nu"]],
819
+ :desc=>
820
+ "These functions compute the cumulative distribution functions\n" +
821
+ "P(x), Q(x) and their inverses for the t-distribution\n" +
822
+ "with nu degrees of freedom."},
823
+ {:func_name=>"gsl_cdf_tdist_Q",
824
+ :func_type=>"double",
825
+ :args=>[["double", "x"], ["double", "nu"]],
826
+ :desc=>
827
+ "These functions compute the cumulative distribution functions\n" +
828
+ "P(x), Q(x) and their inverses for the t-distribution\n" +
829
+ "with nu degrees of freedom."},
830
+ {:func_name=>"gsl_cdf_tdist_Pinv",
831
+ :func_type=>"double",
832
+ :args=>[["double", "P"], ["double", "nu"]],
833
+ :desc=>
834
+ "These functions compute the cumulative distribution functions\n" +
835
+ "P(x), Q(x) and their inverses for the t-distribution\n" +
836
+ "with nu degrees of freedom."},
837
+ {:func_name=>"gsl_cdf_tdist_Qinv",
838
+ :func_type=>"double",
839
+ :args=>[["double", "Q"], ["double", "nu"]],
840
+ :desc=>
841
+ "These functions compute the cumulative distribution functions\n" +
842
+ "P(x), Q(x) and their inverses for the t-distribution\n" +
843
+ "with nu degrees of freedom."},
844
+ {:func_name=>"gsl_ran_beta",
845
+ :func_type=>"double",
846
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
847
+ :desc=>
848
+ "This function returns a random variate from the beta\n" +
849
+ "distribution. The distribution function is,\n" +
850
+ "\n" +
851
+ "p(x) dx = @{\\Gamma(a+b) \\over \\Gamma(a) \\Gamma(b)@} x^@{a-1@} (1-x)^@{b-1@} dx\n" +
852
+ "\n" +
853
+ "for $0 \\le x \\le 1$\n" +
854
+ "0 <= x <= 1."},
855
+ {:func_name=>"gsl_ran_beta_pdf",
856
+ :func_type=>"double",
857
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
858
+ :desc=>
859
+ "This function computes the probability density p(x) at x\n" +
860
+ "for a beta distribution with parameters a and b, using the\n" +
861
+ "formula given above."},
862
+ {:func_name=>"gsl_cdf_beta_P",
863
+ :func_type=>"double",
864
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
865
+ :desc=>
866
+ "These functions compute the cumulative distribution functions\n" +
867
+ "P(x), Q(x) and their inverses for the beta\n" +
868
+ "distribution with parameters a and b."},
869
+ {:func_name=>"gsl_cdf_beta_Q",
870
+ :func_type=>"double",
871
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
872
+ :desc=>
873
+ "These functions compute the cumulative distribution functions\n" +
874
+ "P(x), Q(x) and their inverses for the beta\n" +
875
+ "distribution with parameters a and b."},
876
+ {:func_name=>"gsl_cdf_beta_Pinv",
877
+ :func_type=>"double",
878
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
879
+ :desc=>
880
+ "These functions compute the cumulative distribution functions\n" +
881
+ "P(x), Q(x) and their inverses for the beta\n" +
882
+ "distribution with parameters a and b."},
883
+ {:func_name=>"gsl_cdf_beta_Qinv",
884
+ :func_type=>"double",
885
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
886
+ :desc=>
887
+ "These functions compute the cumulative distribution functions\n" +
888
+ "P(x), Q(x) and their inverses for the beta\n" +
889
+ "distribution with parameters a and b."},
890
+ {:func_name=>"gsl_ran_logistic",
891
+ :func_type=>"double",
892
+ :args=>[["const gsl_rng *", "r"], ["double", "a"]],
893
+ :desc=>
894
+ "This function returns a random variate from the logistic\n" +
895
+ "distribution. The distribution function is,\n" +
896
+ "\n" +
897
+ "p(x) dx = @{ \\exp(-x/a) \\over a (1 + \\exp(-x/a))^2 @} dx\n" +
898
+ "\n" +
899
+ "for -\\infty < x < +\\infty."},
900
+ {:func_name=>"gsl_ran_logistic_pdf",
901
+ :func_type=>"double",
902
+ :args=>[["double", "x"], ["double", "a"]],
903
+ :desc=>
904
+ "This function computes the probability density p(x) at x\n" +
905
+ "for a logistic distribution with scale parameter a, using the\n" +
906
+ "formula given above."},
907
+ {:func_name=>"gsl_cdf_logistic_P",
908
+ :func_type=>"double",
909
+ :args=>[["double", "x"], ["double", "a"]],
910
+ :desc=>
911
+ "These functions compute the cumulative distribution functions\n" +
912
+ "P(x), Q(x) and their inverses for the logistic\n" +
913
+ "distribution with scale parameter a."},
914
+ {:func_name=>"gsl_cdf_logistic_Q",
915
+ :func_type=>"double",
916
+ :args=>[["double", "x"], ["double", "a"]],
917
+ :desc=>
918
+ "These functions compute the cumulative distribution functions\n" +
919
+ "P(x), Q(x) and their inverses for the logistic\n" +
920
+ "distribution with scale parameter a."},
921
+ {:func_name=>"gsl_cdf_logistic_Pinv",
922
+ :func_type=>"double",
923
+ :args=>[["double", "P"], ["double", "a"]],
924
+ :desc=>
925
+ "These functions compute the cumulative distribution functions\n" +
926
+ "P(x), Q(x) and their inverses for the logistic\n" +
927
+ "distribution with scale parameter a."},
928
+ {:func_name=>"gsl_cdf_logistic_Qinv",
929
+ :func_type=>"double",
930
+ :args=>[["double", "Q"], ["double", "a"]],
931
+ :desc=>
932
+ "These functions compute the cumulative distribution functions\n" +
933
+ "P(x), Q(x) and their inverses for the logistic\n" +
934
+ "distribution with scale parameter a."},
935
+ {:func_name=>"gsl_ran_pareto",
936
+ :func_type=>"double",
937
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
938
+ :desc=>
939
+ "This function returns a random variate from the Pareto distribution of\n" +
940
+ "order a. The distribution function is,\n" +
941
+ "\n" +
942
+ "p(x) dx = (a/b) / (x/b)^@{a+1@} dx\n" +
943
+ "\n" +
944
+ "for $x \\ge b$\n" +
945
+ "x >= b."},
946
+ {:func_name=>"gsl_ran_pareto_pdf",
947
+ :func_type=>"double",
948
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
949
+ :desc=>
950
+ "This function computes the probability density p(x) at x\n" +
951
+ "for a Pareto distribution with exponent a and scale b, using\n" +
952
+ "the formula given above."},
953
+ {:func_name=>"gsl_cdf_pareto_P",
954
+ :func_type=>"double",
955
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
956
+ :desc=>
957
+ "These functions compute the cumulative distribution functions\n" +
958
+ "P(x), Q(x) and their inverses for the Pareto\n" +
959
+ "distribution with exponent a and scale b."},
960
+ {:func_name=>"gsl_cdf_pareto_Q",
961
+ :func_type=>"double",
962
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
963
+ :desc=>
964
+ "These functions compute the cumulative distribution functions\n" +
965
+ "P(x), Q(x) and their inverses for the Pareto\n" +
966
+ "distribution with exponent a and scale b."},
967
+ {:func_name=>"gsl_cdf_pareto_Pinv",
968
+ :func_type=>"double",
969
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
970
+ :desc=>
971
+ "These functions compute the cumulative distribution functions\n" +
972
+ "P(x), Q(x) and their inverses for the Pareto\n" +
973
+ "distribution with exponent a and scale b."},
974
+ {:func_name=>"gsl_cdf_pareto_Qinv",
975
+ :func_type=>"double",
976
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
977
+ :desc=>
978
+ "These functions compute the cumulative distribution functions\n" +
979
+ "P(x), Q(x) and their inverses for the Pareto\n" +
980
+ "distribution with exponent a and scale b."},
981
+ {:func_name=>"gsl_ran_dir_2d",
982
+ :func_type=>"void",
983
+ :args=>[["const gsl_rng *", "r"], ["double *", "x"], ["double *", "y"]],
984
+ :desc=>
985
+ "This function returns a random direction vector v =\n" +
986
+ "(x,y) in two dimensions. The vector is normalized such that\n" +
987
+ "|v|^2 = x^2 + y^2 = 1. The obvious way to do this is to take a\n" +
988
+ "uniform random number between 0 and 2\\pi and let x and\n" +
989
+ "y be the sine and cosine respectively. Two trig functions would\n" +
990
+ "have been expensive in the old days, but with modern hardware\n" +
991
+ "implementations, this is sometimes the fastest way to go. This is the\n" +
992
+ "case for the Pentium (but not the case for the Sun Sparcstation).\n" +
993
+ "One can avoid the trig evaluations by choosing x and\n" +
994
+ "y in the interior of a unit circle (choose them at random from the\n" +
995
+ "interior of the enclosing square, and then reject those that are outside\n" +
996
+ "the unit circle), and then dividing by $\\sqrt{x^2 + y^2}$\n" +
997
+ "\\sqrt@{x^2 + y^2@}.\n" +
998
+ "A much cleverer approach, attributed to von Neumann (See Knuth, v2, 3rd\n" +
999
+ "ed, p140, exercise 23), requires neither trig nor a square root. In\n" +
1000
+ "this approach, u and v are chosen at random from the\n" +
1001
+ "interior of a unit circle, and then x=(u^2-v^2)/(u^2+v^2) and\n" +
1002
+ "y=2uv/(u^2+v^2)."},
1003
+ {:func_name=>"gsl_ran_dir_2d_trig_method",
1004
+ :func_type=>"void",
1005
+ :args=>[["const gsl_rng *", "r"], ["double *", "x"], ["double *", "y"]],
1006
+ :desc=>
1007
+ "This function returns a random direction vector v =\n" +
1008
+ "(x,y) in two dimensions. The vector is normalized such that\n" +
1009
+ "|v|^2 = x^2 + y^2 = 1. The obvious way to do this is to take a\n" +
1010
+ "uniform random number between 0 and 2\\pi and let x and\n" +
1011
+ "y be the sine and cosine respectively. Two trig functions would\n" +
1012
+ "have been expensive in the old days, but with modern hardware\n" +
1013
+ "implementations, this is sometimes the fastest way to go. This is the\n" +
1014
+ "case for the Pentium (but not the case for the Sun Sparcstation).\n" +
1015
+ "One can avoid the trig evaluations by choosing x and\n" +
1016
+ "y in the interior of a unit circle (choose them at random from the\n" +
1017
+ "interior of the enclosing square, and then reject those that are outside\n" +
1018
+ "the unit circle), and then dividing by $\\sqrt{x^2 + y^2}$\n" +
1019
+ "\\sqrt@{x^2 + y^2@}.\n" +
1020
+ "A much cleverer approach, attributed to von Neumann (See Knuth, v2, 3rd\n" +
1021
+ "ed, p140, exercise 23), requires neither trig nor a square root. In\n" +
1022
+ "this approach, u and v are chosen at random from the\n" +
1023
+ "interior of a unit circle, and then x=(u^2-v^2)/(u^2+v^2) and\n" +
1024
+ "y=2uv/(u^2+v^2)."},
1025
+ {:func_name=>"gsl_ran_dir_3d",
1026
+ :func_type=>"void",
1027
+ :args=>
1028
+ [["const gsl_rng *", "r"],
1029
+ ["double *", "x"],
1030
+ ["double *", "y"],
1031
+ ["double *", "z"]],
1032
+ :desc=>
1033
+ "This function returns a random direction vector v =\n" +
1034
+ "(x,y,z) in three dimensions. The vector is normalized\n" +
1035
+ "such that |v|^2 = x^2 + y^2 + z^2 = 1. The method employed is\n" +
1036
+ "due to Robert E. Knop (CACM 13, 326 (1970)), and explained in Knuth, v2,\n" +
1037
+ "3rd ed, p136. It uses the surprising fact that the distribution\n" +
1038
+ "projected along any axis is actually uniform (this is only true for 3\n" +
1039
+ "dimensions)."},
1040
+ {:func_name=>"gsl_ran_dir_nd",
1041
+ :func_type=>"void",
1042
+ :args=>[["const gsl_rng *", "r"], ["size_t", "n"], ["double *", "x"]],
1043
+ :desc=>
1044
+ "\n" +
1045
+ "This function returns a random direction vector\n" +
1046
+ "$v = (x_1,x_2,\\ldots,x_n)$\n" +
1047
+ "v = (x_1,x_2,...,x_n) in n dimensions. The vector is normalized\n" +
1048
+ "such that \n" +
1049
+ "$|v|^2 = x_1^2 + x_2^2 + \\cdots + x_n^2 = 1$\n" +
1050
+ "|v|^2 = x_1^2 + x_2^2 + ... + x_n^2 = 1. The method\n" +
1051
+ "uses the fact that a multivariate Gaussian distribution is spherically\n" +
1052
+ "symmetric. Each component is generated to have a Gaussian distribution,\n" +
1053
+ "and then the components are normalized. The method is described by\n" +
1054
+ "Knuth, v2, 3rd ed, p135--136, and attributed to G. W. Brown, Modern\n" +
1055
+ "Mathematics for the Engineer (1956)."},
1056
+ {:func_name=>"gsl_ran_weibull",
1057
+ :func_type=>"double",
1058
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
1059
+ :desc=>
1060
+ "This function returns a random variate from the Weibull distribution. The\n" +
1061
+ "distribution function is,\n" +
1062
+ "\n" +
1063
+ "p(x) dx = @{b \\over a^b@} x^@{b-1@} \\exp(-(x/a)^b) dx\n" +
1064
+ "\n" +
1065
+ "for $x \\ge 0$\n" +
1066
+ "x >= 0."},
1067
+ {:func_name=>"gsl_ran_weibull_pdf",
1068
+ :func_type=>"double",
1069
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1070
+ :desc=>
1071
+ "This function computes the probability density p(x) at x\n" +
1072
+ "for a Weibull distribution with scale a and exponent b,\n" +
1073
+ "using the formula given above."},
1074
+ {:func_name=>"gsl_cdf_weibull_P",
1075
+ :func_type=>"double",
1076
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1077
+ :desc=>
1078
+ "These functions compute the cumulative distribution functions\n" +
1079
+ "P(x), Q(x) and their inverses for the Weibull\n" +
1080
+ "distribution with scale a and exponent b."},
1081
+ {:func_name=>"gsl_cdf_weibull_Q",
1082
+ :func_type=>"double",
1083
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1084
+ :desc=>
1085
+ "These functions compute the cumulative distribution functions\n" +
1086
+ "P(x), Q(x) and their inverses for the Weibull\n" +
1087
+ "distribution with scale a and exponent b."},
1088
+ {:func_name=>"gsl_cdf_weibull_Pinv",
1089
+ :func_type=>"double",
1090
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
1091
+ :desc=>
1092
+ "These functions compute the cumulative distribution functions\n" +
1093
+ "P(x), Q(x) and their inverses for the Weibull\n" +
1094
+ "distribution with scale a and exponent b."},
1095
+ {:func_name=>"gsl_cdf_weibull_Qinv",
1096
+ :func_type=>"double",
1097
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
1098
+ :desc=>
1099
+ "These functions compute the cumulative distribution functions\n" +
1100
+ "P(x), Q(x) and their inverses for the Weibull\n" +
1101
+ "distribution with scale a and exponent b."},
1102
+ {:func_name=>"gsl_ran_gumbel1",
1103
+ :func_type=>"double",
1104
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
1105
+ :desc=>
1106
+ "This function returns a random variate from the Type-1 Gumbel\n" +
1107
+ "distribution. The Type-1 Gumbel distribution function is,\n" +
1108
+ "\n" +
1109
+ "p(x) dx = a b \\exp(-(b \\exp(-ax) + ax)) dx\n" +
1110
+ "\n" +
1111
+ "for -\\infty < x < \\infty. "},
1112
+ {:func_name=>"gsl_ran_gumbel1_pdf",
1113
+ :func_type=>"double",
1114
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1115
+ :desc=>
1116
+ "This function computes the probability density p(x) at x\n" +
1117
+ "for a Type-1 Gumbel distribution with parameters a and b,\n" +
1118
+ "using the formula given above."},
1119
+ {:func_name=>"gsl_cdf_gumbel1_P",
1120
+ :func_type=>"double",
1121
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1122
+ :desc=>
1123
+ "These functions compute the cumulative distribution functions\n" +
1124
+ "P(x), Q(x) and their inverses for the Type-1 Gumbel\n" +
1125
+ "distribution with parameters a and b."},
1126
+ {:func_name=>"gsl_cdf_gumbel1_Q",
1127
+ :func_type=>"double",
1128
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1129
+ :desc=>
1130
+ "These functions compute the cumulative distribution functions\n" +
1131
+ "P(x), Q(x) and their inverses for the Type-1 Gumbel\n" +
1132
+ "distribution with parameters a and b."},
1133
+ {:func_name=>"gsl_cdf_gumbel1_Pinv",
1134
+ :func_type=>"double",
1135
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
1136
+ :desc=>
1137
+ "These functions compute the cumulative distribution functions\n" +
1138
+ "P(x), Q(x) and their inverses for the Type-1 Gumbel\n" +
1139
+ "distribution with parameters a and b."},
1140
+ {:func_name=>"gsl_cdf_gumbel1_Qinv",
1141
+ :func_type=>"double",
1142
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
1143
+ :desc=>
1144
+ "These functions compute the cumulative distribution functions\n" +
1145
+ "P(x), Q(x) and their inverses for the Type-1 Gumbel\n" +
1146
+ "distribution with parameters a and b."},
1147
+ {:func_name=>"gsl_ran_gumbel2",
1148
+ :func_type=>"double",
1149
+ :args=>[["const gsl_rng *", "r"], ["double", "a"], ["double", "b"]],
1150
+ :desc=>
1151
+ "This function returns a random variate from the Type-2 Gumbel\n" +
1152
+ "distribution. The Type-2 Gumbel distribution function is,\n" +
1153
+ "\n" +
1154
+ "p(x) dx = a b x^@{-a-1@} \\exp(-b x^@{-a@}) dx\n" +
1155
+ "\n" +
1156
+ "for 0 < x < \\infty."},
1157
+ {:func_name=>"gsl_ran_gumbel2_pdf",
1158
+ :func_type=>"double",
1159
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1160
+ :desc=>
1161
+ "This function computes the probability density p(x) at x\n" +
1162
+ "for a Type-2 Gumbel distribution with parameters a and b,\n" +
1163
+ "using the formula given above."},
1164
+ {:func_name=>"gsl_cdf_gumbel2_P",
1165
+ :func_type=>"double",
1166
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1167
+ :desc=>
1168
+ "These functions compute the cumulative distribution functions\n" +
1169
+ "P(x), Q(x) and their inverses for the Type-2 Gumbel\n" +
1170
+ "distribution with parameters a and b."},
1171
+ {:func_name=>"gsl_cdf_gumbel2_Q",
1172
+ :func_type=>"double",
1173
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
1174
+ :desc=>
1175
+ "These functions compute the cumulative distribution functions\n" +
1176
+ "P(x), Q(x) and their inverses for the Type-2 Gumbel\n" +
1177
+ "distribution with parameters a and b."},
1178
+ {:func_name=>"gsl_cdf_gumbel2_Pinv",
1179
+ :func_type=>"double",
1180
+ :args=>[["double", "P"], ["double", "a"], ["double", "b"]],
1181
+ :desc=>
1182
+ "These functions compute the cumulative distribution functions\n" +
1183
+ "P(x), Q(x) and their inverses for the Type-2 Gumbel\n" +
1184
+ "distribution with parameters a and b."},
1185
+ {:func_name=>"gsl_cdf_gumbel2_Qinv",
1186
+ :func_type=>"double",
1187
+ :args=>[["double", "Q"], ["double", "a"], ["double", "b"]],
1188
+ :desc=>
1189
+ "These functions compute the cumulative distribution functions\n" +
1190
+ "P(x), Q(x) and their inverses for the Type-2 Gumbel\n" +
1191
+ "distribution with parameters a and b."},
1192
+ {:func_name=>"gsl_ran_dirichlet",
1193
+ :func_type=>"void",
1194
+ :args=>
1195
+ [["const gsl_rng *", "r"],
1196
+ ["size_t", "K"],
1197
+ ["const double", "alpha[]"],
1198
+ ["double", "theta[]"]],
1199
+ :desc=>
1200
+ "This function returns an array of K random variates from a Dirichlet\n" +
1201
+ "distribution of order K-1. The distribution function is\n" +
1202
+ "\n" +
1203
+ "p(\\theta_1, ..., \\theta_K) d\\theta_1 ... d\\theta_K = \n" +
1204
+ " (1/Z) \\prod_@{i=1@}^K \\theta_i^@{\\alpha_i - 1@} \\delta(1 -\\sum_@{i=1@}^K \\theta_i) d\\theta_1 ... d\\theta_K\n" +
1205
+ "\n" +
1206
+ "for $\\theta_i \\ge 0$ \n" +
1207
+ "theta_i >= 0\n" +
1208
+ "and $\\alpha_i > 0$ \n" +
1209
+ "alpha_i > 0. The delta function ensures that \\sum \\theta_i = 1.\n" +
1210
+ "The normalization factor Z is\n" +
1211
+ "\n" +
1212
+ "Z = @{\\prod_@{i=1@}^K \\Gamma(\\alpha_i)@} / @{\\Gamma( \\sum_@{i=1@}^K \\alpha_i)@}\n" +
1213
+ "\n" +
1214
+ "The random variates are generated by sampling K values \n" +
1215
+ "from gamma distributions with parameters \n" +
1216
+ "$a=\\alpha_i$, $b=1$ \n" +
1217
+ "a=alpha_i, b=1, \n" +
1218
+ "and renormalizing. \n" +
1219
+ "See A.M. Law, W.D. Kelton, Simulation Modeling and Analysis (1991)."},
1220
+ {:func_name=>"gsl_ran_dirichlet_pdf",
1221
+ :func_type=>"double",
1222
+ :args=>
1223
+ [["size_t", "K"], ["const double", "alpha[]"], ["const double", "theta[]"]],
1224
+ :desc=>
1225
+ "This function computes the probability density \n" +
1226
+ "$p(\\theta_1, \\ldots , \\theta_K)$\n" +
1227
+ "p(\\theta_1, ... , \\theta_K)\n" +
1228
+ "at theta[K] for a Dirichlet distribution with parameters \n" +
1229
+ "alpha[K], using the formula given above."},
1230
+ {:func_name=>"gsl_ran_dirichlet_lnpdf",
1231
+ :func_type=>"double",
1232
+ :args=>
1233
+ [["size_t", "K"], ["const double", "alpha[]"], ["const double", "theta[]"]],
1234
+ :desc=>
1235
+ "This function computes the logarithm of the probability density \n" +
1236
+ "$p(\\theta_1, \\ldots , \\theta_K)$\n" +
1237
+ "p(\\theta_1, ... , \\theta_K)\n" +
1238
+ "for a Dirichlet distribution with parameters \n" +
1239
+ "alpha[K]."},
1240
+ {:func_name=>"gsl_ran_discrete_preproc",
1241
+ :func_type=>"gsl_ran_discrete_t *",
1242
+ :args=>[["size_t", "K"], ["const double *", "P"]],
1243
+ :desc=>
1244
+ "This function returns a pointer to a structure that contains the lookup\n" +
1245
+ "table for the discrete random number generator. The array P[] contains\n" +
1246
+ "the probabilities of the discrete events; these array elements must all be \n" +
1247
+ "positive, but they needn't add up to one (so you can think of them more\n" +
1248
+ "generally as ``weights'')---the preprocessor will normalize appropriately.\n" +
1249
+ "This return value is used\n" +
1250
+ "as an argument for the gsl_ran_discrete function below."},
1251
+ {:func_name=>"gsl_ran_discrete",
1252
+ :func_type=>"size_t",
1253
+ :args=>[["const gsl_rng *", "r"], ["const gsl_ran_discrete_t *", "g"]],
1254
+ :desc=>
1255
+ "After the preprocessor, above, has been called, you use this function to\n" +
1256
+ "get the discrete random numbers."},
1257
+ {:func_name=>"gsl_ran_discrete_pdf",
1258
+ :func_type=>"double",
1259
+ :args=>[["size_t", "k"], ["const gsl_ran_discrete_t *", "g"]],
1260
+ :desc=>
1261
+ "Returns the probability P[k] of observing the variable k.\n" +
1262
+ "Since P[k] is not stored as part of the lookup table, it must be\n" +
1263
+ "recomputed; this computation takes O(K), so if K is large\n" +
1264
+ "and you care about the original array P[k] used to create the\n" +
1265
+ "lookup table, then you should just keep this original array P[k]\n" +
1266
+ "around."},
1267
+ {:func_name=>"gsl_ran_discrete_free",
1268
+ :func_type=>"void",
1269
+ :args=>[["gsl_ran_discrete_t *", "g"]],
1270
+ :desc=>"De-allocates the lookup table pointed to by g."},
1271
+ {:func_name=>"gsl_ran_poisson",
1272
+ :func_type=>"unsigned int",
1273
+ :args=>[["const gsl_rng *", "r"], ["double", "mu"]],
1274
+ :desc=>
1275
+ "This function returns a random integer from the Poisson distribution\n" +
1276
+ "with mean mu. The probability distribution for Poisson variates is,\n" +
1277
+ "\n" +
1278
+ "p(k) = @{\\mu^k \\over k!@} \\exp(-\\mu)\n" +
1279
+ "\n" +
1280
+ "for $k \\ge 0$\n" +
1281
+ "k >= 0."},
1282
+ {:func_name=>"gsl_ran_poisson_pdf",
1283
+ :func_type=>"double",
1284
+ :args=>[["unsigned int", "k"], ["double", "mu"]],
1285
+ :desc=>
1286
+ "This function computes the probability p(k) of obtaining k\n" +
1287
+ "from a Poisson distribution with mean mu, using the formula\n" +
1288
+ "given above."},
1289
+ {:func_name=>"gsl_cdf_poisson_P",
1290
+ :func_type=>"double",
1291
+ :args=>[["unsigned int", "k"], ["double", "mu"]],
1292
+ :desc=>
1293
+ "These functions compute the cumulative distribution functions\n" +
1294
+ "P(k), Q(k) for the Poisson distribution with parameter\n" +
1295
+ "mu."},
1296
+ {:func_name=>"gsl_cdf_poisson_Q",
1297
+ :func_type=>"double",
1298
+ :args=>[["unsigned int", "k"], ["double", "mu"]],
1299
+ :desc=>
1300
+ "These functions compute the cumulative distribution functions\n" +
1301
+ "P(k), Q(k) for the Poisson distribution with parameter\n" +
1302
+ "mu."},
1303
+ {:func_name=>"gsl_ran_bernoulli",
1304
+ :func_type=>"unsigned int",
1305
+ :args=>[["const gsl_rng *", "r"], ["double", "p"]],
1306
+ :desc=>
1307
+ "This function returns either 0 or 1, the result of a Bernoulli trial\n" +
1308
+ "with probability p. The probability distribution for a Bernoulli\n" +
1309
+ "trial is,\n" +
1310
+ "\n" +
1311
+ "p(0) = 1 - p\n" +
1312
+ "p(1) = p\n"},
1313
+ {:func_name=>"gsl_ran_bernoulli_pdf",
1314
+ :func_type=>"double",
1315
+ :args=>[["unsigned int", "k"], ["double", "p"]],
1316
+ :desc=>
1317
+ "This function computes the probability p(k) of obtaining\n" +
1318
+ "k from a Bernoulli distribution with probability parameter\n" +
1319
+ "p, using the formula given above."},
1320
+ {:func_name=>"gsl_ran_binomial",
1321
+ :func_type=>"unsigned int",
1322
+ :args=>[["const gsl_rng *", "r"], ["double", "p"], ["unsigned int", "n"]],
1323
+ :desc=>
1324
+ "This function returns a random integer from the binomial distribution,\n" +
1325
+ "the number of successes in n independent trials with probability\n" +
1326
+ "p. The probability distribution for binomial variates is,\n" +
1327
+ "\n" +
1328
+ "p(k) = @{n! \\over k! (n-k)! @} p^k (1-p)^@{n-k@}\n" +
1329
+ "\n" +
1330
+ "for $0 \\le k \\le n$\n" +
1331
+ "0 <= k <= n."},
1332
+ {:func_name=>"gsl_ran_binomial_pdf",
1333
+ :func_type=>"double",
1334
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1335
+ :desc=>
1336
+ "This function computes the probability p(k) of obtaining k\n" +
1337
+ "from a binomial distribution with parameters p and n, using\n" +
1338
+ "the formula given above."},
1339
+ {:func_name=>"gsl_cdf_binomial_P",
1340
+ :func_type=>"double",
1341
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1342
+ :desc=>
1343
+ "These functions compute the cumulative distribution functions\n" +
1344
+ "P(k), Q(k) for the binomial\n" +
1345
+ "distribution with parameters p and n."},
1346
+ {:func_name=>"gsl_cdf_binomial_Q",
1347
+ :func_type=>"double",
1348
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1349
+ :desc=>
1350
+ "These functions compute the cumulative distribution functions\n" +
1351
+ "P(k), Q(k) for the binomial\n" +
1352
+ "distribution with parameters p and n."},
1353
+ {:func_name=>"gsl_ran_multinomial",
1354
+ :func_type=>"void",
1355
+ :args=>
1356
+ [["const gsl_rng *", "r"],
1357
+ ["size_t", "K"],
1358
+ ["unsigned int", "N"],
1359
+ ["const double", "p[]"],
1360
+ ["unsigned int", "n[]"]],
1361
+ :desc=>
1362
+ "\n" +
1363
+ "This function computes a random sample n[] from the multinomial\n" +
1364
+ "distribution formed by N trials from an underlying distribution\n" +
1365
+ "p[K]. The distribution function for n[] is,\n" +
1366
+ "\n" +
1367
+ "P(n_1, n_2, ..., n_K) = \n" +
1368
+ " (N!/(n_1! n_2! ... n_K!)) p_1^n_1 p_2^n_2 ... p_K^n_K\n" +
1369
+ "\n" +
1370
+ "where ($n_1$, $n_2$, $\\ldots$, $n_K$)\n" +
1371
+ "(n_1, n_2, ..., n_K) \n" +
1372
+ "are nonnegative integers with \n" +
1373
+ "$\\sum_{k=1}^{K} n_k =N$ \n" +
1374
+ "sum_@{k=1@}^K n_k = N,\n" +
1375
+ "and\n" +
1376
+ "$(p_1, p_2, \\ldots, p_K)$ \n" +
1377
+ "(p_1, p_2, ..., p_K)\n" +
1378
+ "is a probability distribution with \\sum p_i = 1. \n" +
1379
+ "If the array p[K] is not normalized then its entries will be\n" +
1380
+ "treated as weights and normalized appropriately. The arrays n[]\n" +
1381
+ "and p[] must both be of length K.\n" +
1382
+ "\n" +
1383
+ "Random variates are generated using the conditional binomial method (see\n" +
1384
+ "C.S. Davis, The computer generation of multinomial random\n" +
1385
+ "variates, Comp. Stat. Data Anal. 16 (1993) 205--217 for details)."},
1386
+ {:func_name=>"gsl_ran_multinomial_pdf",
1387
+ :func_type=>"double",
1388
+ :args=>
1389
+ [["size_t", "K"], ["const double", "p[]"], ["const unsigned int", "n[]"]],
1390
+ :desc=>
1391
+ "This function computes the probability \n" +
1392
+ "$P(n_1, n_2, \\ldots, n_K)$\n" +
1393
+ "P(n_1, n_2, ..., n_K)\n" +
1394
+ "of sampling n[K] from a multinomial distribution \n" +
1395
+ "with parameters p[K], using the formula given above."},
1396
+ {:func_name=>"gsl_ran_multinomial_lnpdf",
1397
+ :func_type=>"double",
1398
+ :args=>
1399
+ [["size_t", "K"], ["const double", "p[]"], ["const unsigned int", "n[]"]],
1400
+ :desc=>
1401
+ "This function returns the logarithm of the probability for the\n" +
1402
+ "multinomial distribution $P(n_1, n_2, \\ldots, n_K)$\n" +
1403
+ "P(n_1, n_2, ..., n_K) with parameters p[K]."},
1404
+ {:func_name=>"gsl_ran_negative_binomial",
1405
+ :func_type=>"unsigned int",
1406
+ :args=>[["const gsl_rng *", "r"], ["double", "p"], ["double", "n"]],
1407
+ :desc=>
1408
+ "This function returns a random integer from the negative binomial\n" +
1409
+ "distribution, the number of failures occurring before n successes\n" +
1410
+ "in independent trials with probability p of success. The\n" +
1411
+ "probability distribution for negative binomial variates is,\n" +
1412
+ "\n" +
1413
+ "p(k) = @{\\Gamma(n + k) \\over \\Gamma(k+1) \\Gamma(n) @} p^n (1-p)^k\n" +
1414
+ "\n" +
1415
+ "Note that n is not required to be an integer."},
1416
+ {:func_name=>"gsl_ran_negative_binomial_pdf",
1417
+ :func_type=>"double",
1418
+ :args=>[["unsigned int", "k"], ["double", "p"], ["double", "n"]],
1419
+ :desc=>
1420
+ "This function computes the probability p(k) of obtaining k\n" +
1421
+ "from a negative binomial distribution with parameters p and\n" +
1422
+ "n, using the formula given above."},
1423
+ {:func_name=>"gsl_cdf_negative_binomial_P",
1424
+ :func_type=>"double",
1425
+ :args=>[["unsigned int", "k"], ["double", "p"], ["double", "n"]],
1426
+ :desc=>
1427
+ "These functions compute the cumulative distribution functions\n" +
1428
+ "P(k), Q(k) for the negative binomial distribution with\n" +
1429
+ "parameters p and n."},
1430
+ {:func_name=>"gsl_cdf_negative_binomial_Q",
1431
+ :func_type=>"double",
1432
+ :args=>[["unsigned int", "k"], ["double", "p"], ["double", "n"]],
1433
+ :desc=>
1434
+ "These functions compute the cumulative distribution functions\n" +
1435
+ "P(k), Q(k) for the negative binomial distribution with\n" +
1436
+ "parameters p and n."},
1437
+ {:func_name=>"gsl_ran_pascal",
1438
+ :func_type=>"unsigned int",
1439
+ :args=>[["const gsl_rng *", "r"], ["double", "p"], ["unsigned int", "n"]],
1440
+ :desc=>
1441
+ "This function returns a random integer from the Pascal distribution. The\n" +
1442
+ "Pascal distribution is simply a negative binomial distribution with an\n" +
1443
+ "integer value of n.\n" +
1444
+ "\n" +
1445
+ "p(k) = @{(n + k - 1)! \\over k! (n - 1)! @} p^n (1-p)^k\n" +
1446
+ "\n" +
1447
+ "for $k \\ge 0$\n" +
1448
+ "k >= 0"},
1449
+ {:func_name=>"gsl_ran_pascal_pdf",
1450
+ :func_type=>"double",
1451
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1452
+ :desc=>
1453
+ "This function computes the probability p(k) of obtaining k\n" +
1454
+ "from a Pascal distribution with parameters p and\n" +
1455
+ "n, using the formula given above."},
1456
+ {:func_name=>"gsl_cdf_pascal_P",
1457
+ :func_type=>"double",
1458
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1459
+ :desc=>
1460
+ "These functions compute the cumulative distribution functions\n" +
1461
+ "P(k), Q(k) for the Pascal distribution with\n" +
1462
+ "parameters p and n."},
1463
+ {:func_name=>"gsl_cdf_pascal_Q",
1464
+ :func_type=>"double",
1465
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
1466
+ :desc=>
1467
+ "These functions compute the cumulative distribution functions\n" +
1468
+ "P(k), Q(k) for the Pascal distribution with\n" +
1469
+ "parameters p and n."},
1470
+ {:func_name=>"gsl_ran_geometric",
1471
+ :func_type=>"unsigned int",
1472
+ :args=>[["const gsl_rng *", "r"], ["double", "p"]],
1473
+ :desc=>
1474
+ "This function returns a random integer from the geometric distribution,\n" +
1475
+ "the number of independent trials with probability p until the\n" +
1476
+ "first success. The probability distribution for geometric variates\n" +
1477
+ "is,\n" +
1478
+ "\n" +
1479
+ "p(k) = p (1-p)^(k-1)\n" +
1480
+ "\n" +
1481
+ "for $k \\ge 1$\n" +
1482
+ "k >= 1. Note that the distribution begins with k=1 with this\n" +
1483
+ "definition. There is another convention in which the exponent k-1 \n" +
1484
+ "is replaced by k."},
1485
+ {:func_name=>"gsl_ran_geometric_pdf",
1486
+ :func_type=>"double",
1487
+ :args=>[["unsigned int", "k"], ["double", "p"]],
1488
+ :desc=>
1489
+ "This function computes the probability p(k) of obtaining k\n" +
1490
+ "from a geometric distribution with probability parameter p, using\n" +
1491
+ "the formula given above."},
1492
+ {:func_name=>"gsl_cdf_geometric_P",
1493
+ :func_type=>"double",
1494
+ :args=>[["unsigned int", "k"], ["double", "p"]],
1495
+ :desc=>
1496
+ "These functions compute the cumulative distribution functions\n" +
1497
+ "P(k), Q(k) for the geometric distribution with parameter\n" +
1498
+ "p."},
1499
+ {:func_name=>"gsl_cdf_geometric_Q",
1500
+ :func_type=>"double",
1501
+ :args=>[["unsigned int", "k"], ["double", "p"]],
1502
+ :desc=>
1503
+ "These functions compute the cumulative distribution functions\n" +
1504
+ "P(k), Q(k) for the geometric distribution with parameter\n" +
1505
+ "p."},
1506
+ {:func_name=>"gsl_ran_hypergeometric",
1507
+ :func_type=>"unsigned int",
1508
+ :args=>
1509
+ [["const gsl_rng *", "r"],
1510
+ ["unsigned int", "n1"],
1511
+ ["unsigned int", "n2"],
1512
+ ["unsigned int", "t"]],
1513
+ :desc=>
1514
+ "This function returns a random integer from the hypergeometric\n" +
1515
+ "distribution. The probability distribution for hypergeometric\n" +
1516
+ "random variates is,\n" +
1517
+ "\n" +
1518
+ "p(k) = C(n_1, k) C(n_2, t - k) / C(n_1 + n_2, t)\n" +
1519
+ "\n" +
1520
+ "where C(a,b) = a!/(b!(a-b)!) and \n" +
1521
+ "$t \\leq n_1 + n_2$\n" +
1522
+ "t <= n_1 + n_2. The domain of k is \n" +
1523
+ "$\\hbox{max}(0,t-n_2), \\ldots, \\hbox{min}(t,n_1)$ \n" +
1524
+ "max(0,t-n_2), ..., min(t,n_1).\n" +
1525
+ "\n" +
1526
+ "If a population contains n_1 elements of ``type 1'' and\n" +
1527
+ "n_2 elements of ``type 2'' then the hypergeometric\n" +
1528
+ "distribution gives the probability of obtaining k elements of\n" +
1529
+ "``type 1'' in t samples from the population without\n" +
1530
+ "replacement."},
1531
+ {:func_name=>"gsl_ran_hypergeometric_pdf",
1532
+ :func_type=>"double",
1533
+ :args=>
1534
+ [["unsigned int", "k"],
1535
+ ["unsigned int", "n1"],
1536
+ ["unsigned int", "n2"],
1537
+ ["unsigned int", "t"]],
1538
+ :desc=>
1539
+ "This function computes the probability p(k) of obtaining k\n" +
1540
+ "from a hypergeometric distribution with parameters n1, n2,\n" +
1541
+ "t, using the formula given above."},
1542
+ {:func_name=>"gsl_cdf_hypergeometric_P",
1543
+ :func_type=>"double",
1544
+ :args=>
1545
+ [["unsigned int", "k"],
1546
+ ["unsigned int", "n1"],
1547
+ ["unsigned int", "n2"],
1548
+ ["unsigned int", "t"]],
1549
+ :desc=>
1550
+ "These functions compute the cumulative distribution functions\n" +
1551
+ "P(k), Q(k) for the hypergeometric distribution with\n" +
1552
+ "parameters n1, n2 and t."},
1553
+ {:func_name=>"gsl_cdf_hypergeometric_Q",
1554
+ :func_type=>"double",
1555
+ :args=>
1556
+ [["unsigned int", "k"],
1557
+ ["unsigned int", "n1"],
1558
+ ["unsigned int", "n2"],
1559
+ ["unsigned int", "t"]],
1560
+ :desc=>
1561
+ "These functions compute the cumulative distribution functions\n" +
1562
+ "P(k), Q(k) for the hypergeometric distribution with\n" +
1563
+ "parameters n1, n2 and t."},
1564
+ {:func_name=>"gsl_ran_logarithmic",
1565
+ :func_type=>"unsigned int",
1566
+ :args=>[["const gsl_rng *", "r"], ["double", "p"]],
1567
+ :desc=>
1568
+ "This function returns a random integer from the logarithmic\n" +
1569
+ "distribution. The probability distribution for logarithmic random variates\n" +
1570
+ "is,\n" +
1571
+ "\n" +
1572
+ "p(k) = @{-1 \\over \\log(1-p)@} @{(p^k \\over k)@}\n" +
1573
+ "\n" +
1574
+ "for $k \\ge 1$\n" +
1575
+ "k >= 1."},
1576
+ {:func_name=>"gsl_ran_logarithmic_pdf",
1577
+ :func_type=>"double",
1578
+ :args=>[["unsigned int", "k"], ["double", "p"]],
1579
+ :desc=>
1580
+ "This function computes the probability p(k) of obtaining k\n" +
1581
+ "from a logarithmic distribution with probability parameter p,\n" +
1582
+ "using the formula given above."},
1583
+ {:func_name=>"gsl_ran_shuffle",
1584
+ :func_type=>"void",
1585
+ :args=>
1586
+ [["const gsl_rng *", "r"],
1587
+ ["void *", "base"],
1588
+ ["size_t", "n"],
1589
+ ["size_t", "size"]],
1590
+ :desc=>
1591
+ "\n" +
1592
+ "This function randomly shuffles the order of n objects, each of\n" +
1593
+ "size size, stored in the array base[0..n-1]. The\n" +
1594
+ "output of the random number generator r is used to produce the\n" +
1595
+ "permutation. The algorithm generates all possible n!\n" +
1596
+ "permutations with equal probability, assuming a perfect source of random\n" +
1597
+ "numbers.\n" +
1598
+ "\n" +
1599
+ "The following code shows how to shuffle the numbers from 0 to 51,\n" +
1600
+ "\n" +
1601
+ "int a[52];\n" +
1602
+ "\n" +
1603
+ "for (i = 0; i < 52; i++)\n" +
1604
+ " @{\n" +
1605
+ " a[i] = i;\n" +
1606
+ " @}\n" +
1607
+ "\n" +
1608
+ "gsl_ran_shuffle (r, a, 52, sizeof (int));\n"},
1609
+ {:func_name=>"gsl_ran_choose",
1610
+ :func_type=>"int",
1611
+ :args=>
1612
+ [["const gsl_rng *", "r"],
1613
+ ["void *", "dest"],
1614
+ ["size_t", "k"],
1615
+ ["void *", "src"],
1616
+ ["size_t", "n"],
1617
+ ["size_t", "size"]],
1618
+ :desc=>
1619
+ "This function fills the array dest[k] with k objects taken\n" +
1620
+ "randomly from the n elements of the array\n" +
1621
+ "src[0..n-1]. The objects are each of size size. The\n" +
1622
+ "output of the random number generator r is used to make the\n" +
1623
+ "selection. The algorithm ensures all possible samples are equally\n" +
1624
+ "likely, assuming a perfect source of randomness.\n" +
1625
+ "\n" +
1626
+ "The objects are sampled without replacement, thus each object can\n" +
1627
+ "only appear once in dest[k]. It is required that k be less\n" +
1628
+ "than or equal to n. The objects in dest will be in the\n" +
1629
+ "same relative order as those in src. You will need to call\n" +
1630
+ "gsl_ran_shuffle(r, dest, n, size) if you want to randomize the\n" +
1631
+ "order.\n" +
1632
+ "\n" +
1633
+ "The following code shows how to select a random sample of three unique\n" +
1634
+ "numbers from the set 0 to 99,\n" +
1635
+ "\n" +
1636
+ "double a[3], b[100];\n" +
1637
+ "\n" +
1638
+ "for (i = 0; i < 100; i++)\n" +
1639
+ " @{\n" +
1640
+ " b[i] = (double) i;\n" +
1641
+ " @}\n" +
1642
+ "\n" +
1643
+ "gsl_ran_choose (r, a, 3, b, 100, sizeof (double));\n"},
1644
+ {:func_name=>"gsl_ran_sample",
1645
+ :func_type=>"void",
1646
+ :args=>
1647
+ [["const gsl_rng *", "r"],
1648
+ ["void *", "dest"],
1649
+ ["size_t", "k"],
1650
+ ["void *", "src"],
1651
+ ["size_t", "n"],
1652
+ ["size_t", "size"]],
1653
+ :desc=>
1654
+ "This function is like gsl_ran_choose but samples k items\n" +
1655
+ "from the original array of n items src with replacement, so\n" +
1656
+ "the same object can appear more than once in the output sequence\n" +
1657
+ "dest. There is no requirement that k be less than n\n" +
1658
+ "in this case."}]