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