numo-gsl 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/README.md +84 -0
  4. data/Rakefile +16 -0
  5. data/ext/numo/gsl/cdf/depend +17 -0
  6. data/ext/numo/gsl/cdf/erbpp_cdf.rb +44 -0
  7. data/ext/numo/gsl/cdf/extconf.rb +9 -0
  8. data/ext/numo/gsl/cdf/func_def.rb +610 -0
  9. data/ext/numo/gsl/const/const_def.rb +419 -0
  10. data/ext/numo/gsl/const/depend +17 -0
  11. data/ext/numo/gsl/const/erbpp_const.rb +30 -0
  12. data/ext/numo/gsl/const/extconf.rb +9 -0
  13. data/ext/numo/gsl/err/depend +1 -0
  14. data/ext/numo/gsl/err/err.c +22 -0
  15. data/ext/numo/gsl/err/extconf.rb +9 -0
  16. data/ext/numo/gsl/extconf_gsl.rb +44 -0
  17. data/ext/numo/gsl/fit/depend +17 -0
  18. data/ext/numo/gsl/fit/erbpp_fit.rb +74 -0
  19. data/ext/numo/gsl/fit/extconf.rb +9 -0
  20. data/ext/numo/gsl/fit/func_def.rb +129 -0
  21. data/ext/numo/gsl/fit/tmpl/check_1d.c +9 -0
  22. data/ext/numo/gsl/fit/tmpl/fit_linear.c +53 -0
  23. data/ext/numo/gsl/fit/tmpl/fit_linear_est.c +56 -0
  24. data/ext/numo/gsl/fit/tmpl/fit_mul.c +50 -0
  25. data/ext/numo/gsl/fit/tmpl/fit_mul_est.c +47 -0
  26. data/ext/numo/gsl/fit/tmpl/fit_wlinear.c +59 -0
  27. data/ext/numo/gsl/fit/tmpl/fit_wmul.c +56 -0
  28. data/ext/numo/gsl/gen/erbpp2.rb +306 -0
  29. data/ext/numo/gsl/gen/erbpp_gsl.rb +166 -0
  30. data/ext/numo/gsl/gen/func_parser.rb +520 -0
  31. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_DFloat.c +40 -0
  32. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ.c +41 -0
  33. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ_x2.c +44 -0
  34. data/ext/numo/gsl/gen/tmpl/c_DFloat_x2_f_DFloat_x2.c +45 -0
  35. data/ext/numo/gsl/gen/tmpl/c_double_f_double.c +16 -0
  36. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet.c +16 -0
  37. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet_x2.c +17 -0
  38. data/ext/numo/gsl/gen/tmpl/c_double_f_void.c +15 -0
  39. data/ext/numo/gsl/gen/tmpl/c_double_x2_f_void.c +17 -0
  40. data/ext/numo/gsl/gen/tmpl/c_new_DFloat.c +29 -0
  41. data/ext/numo/gsl/gen/tmpl/c_new_double.c +22 -0
  42. data/ext/numo/gsl/gen/tmpl/c_new_f_other.c +25 -0
  43. data/ext/numo/gsl/gen/tmpl/c_new_sizet.c +22 -0
  44. data/ext/numo/gsl/gen/tmpl/c_new_sizet_double.c +23 -0
  45. data/ext/numo/gsl/gen/tmpl/c_new_sizet_x2.c +23 -0
  46. data/ext/numo/gsl/gen/tmpl/c_new_void.c +21 -0
  47. data/ext/numo/gsl/gen/tmpl/c_other_f_void.c +19 -0
  48. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat.c +46 -0
  49. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x2.c +41 -0
  50. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x3.c +44 -0
  51. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x4.c +47 -0
  52. data/ext/numo/gsl/gen/tmpl/c_self_f_SZ_x2_DFloat.c +45 -0
  53. data/ext/numo/gsl/gen/tmpl/c_self_f_double.c +17 -0
  54. data/ext/numo/gsl/gen/tmpl/c_self_f_other.c +17 -0
  55. data/ext/numo/gsl/gen/tmpl/c_self_f_sizet.c +21 -0
  56. data/ext/numo/gsl/gen/tmpl/c_self_f_void.c +14 -0
  57. data/ext/numo/gsl/gen/tmpl/c_sizet_f_void.c +15 -0
  58. data/ext/numo/gsl/gen/tmpl/c_sizet_x2_f_void.c +17 -0
  59. data/ext/numo/gsl/gen/tmpl/c_str_f_void.c +15 -0
  60. data/ext/numo/gsl/gen/tmpl/c_super_new_void.c +18 -0
  61. data/ext/numo/gsl/gen/tmpl/c_uint_f_void.c +15 -0
  62. data/ext/numo/gsl/gen/tmpl/c_ulong_f_void.c +15 -0
  63. data/ext/numo/gsl/gen/tmpl/c_void_f_double.c +17 -0
  64. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x2.c +18 -0
  65. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x4.c +20 -0
  66. data/ext/numo/gsl/gen/tmpl/c_void_f_ulong.c +17 -0
  67. data/ext/numo/gsl/gen/tmpl/c_void_f_void.c +14 -0
  68. data/ext/numo/gsl/gen/tmpl/cast_1d_contiguous.c +15 -0
  69. data/ext/numo/gsl/gen/tmpl/cast_2d_contiguous.c +15 -0
  70. data/ext/numo/gsl/gen/tmpl/class.c +26 -0
  71. data/ext/numo/gsl/gen/tmpl/create_new_narray.c +26 -0
  72. data/ext/numo/gsl/gen/tmpl/init_class.c +10 -0
  73. data/ext/numo/gsl/gen/tmpl/init_module.c +12 -0
  74. data/ext/numo/gsl/gen/tmpl/lib.c +41 -0
  75. data/ext/numo/gsl/gen/tmpl/m_DFloat_Int_f_DFloat.c +38 -0
  76. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat.c +35 -0
  77. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_Int.c +39 -0
  78. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_UInt.c +39 -0
  79. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double.c +42 -0
  80. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double_x2.c +47 -0
  81. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_int.c +42 -0
  82. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x2.c +38 -0
  83. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x3.c +41 -0
  84. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c +36 -0
  85. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt.c +36 -0
  86. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32.c +36 -0
  87. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double.c +43 -0
  88. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_uint.c +49 -0
  89. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_x2.c +48 -0
  90. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_uint_x3.c +51 -0
  91. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double.c +43 -0
  92. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_uint.c +50 -0
  93. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_x2.c +48 -0
  94. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_uint_x3.c +51 -0
  95. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat.c +41 -0
  96. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat_x2.c +44 -0
  97. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c +46 -0
  98. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat.c +36 -0
  99. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat_x3.c +42 -0
  100. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat.c +42 -0
  101. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat_x2.c +45 -0
  102. data/ext/numo/gsl/gen/tmpl/mod_func_noloop.c +54 -0
  103. data/ext/numo/gsl/gen/tmpl/mod_func_scalar.c +27 -0
  104. data/ext/numo/gsl/gen/tmpl/module.c +9 -0
  105. data/ext/numo/gsl/histogram/depend +17 -0
  106. data/ext/numo/gsl/histogram/erbpp_histogram.rb +109 -0
  107. data/ext/numo/gsl/histogram/extconf.rb +9 -0
  108. data/ext/numo/gsl/histogram/func_def.rb +763 -0
  109. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_2d_get.c +54 -0
  110. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_field.c +35 -0
  111. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_get.c +47 -0
  112. data/ext/numo/gsl/histogram/tmpl/c_DFloat_x2_f_get_range.c +56 -0
  113. data/ext/numo/gsl/histogram/tmpl/c_bool_f_other.c +19 -0
  114. data/ext/numo/gsl/histogram/tmpl/c_bool_f_pdf_init.c +24 -0
  115. data/ext/numo/gsl/histogram/tmpl/c_self_f_2d_set_ranges.c +26 -0
  116. data/ext/numo/gsl/histogram/tmpl/c_self_f_set_ranges.c +21 -0
  117. data/ext/numo/gsl/histogram/tmpl/c_sizet_f_field.c +15 -0
  118. data/ext/numo/gsl/interp/depend +17 -0
  119. data/ext/numo/gsl/interp/erbpp_interp.rb +59 -0
  120. data/ext/numo/gsl/interp/extconf.rb +9 -0
  121. data/ext/numo/gsl/interp/func_def.rb +816 -0
  122. data/ext/numo/gsl/interp/parse_interp.rb +67 -0
  123. data/ext/numo/gsl/interp/tmpl/interp2d_new.c +36 -0
  124. data/ext/numo/gsl/interp/tmpl/interp2d_type_new.c +17 -0
  125. data/ext/numo/gsl/interp/tmpl/interp_bsearch.c +57 -0
  126. data/ext/numo/gsl/interp/tmpl/interp_new.c +29 -0
  127. data/ext/numo/gsl/interp/tmpl/interp_type_new.c +16 -0
  128. data/ext/numo/gsl/interp/tmpl/spline2d_eval.c +61 -0
  129. data/ext/numo/gsl/interp/tmpl/spline_eval.c +55 -0
  130. data/ext/numo/gsl/interp/tmpl/spline_integ.c +56 -0
  131. data/ext/numo/gsl/interp/type_def.rb +9 -0
  132. data/ext/numo/gsl/multifit/depend +17 -0
  133. data/ext/numo/gsl/multifit/erbpp_multifit.rb +99 -0
  134. data/ext/numo/gsl/multifit/extconf.rb +9 -0
  135. data/ext/numo/gsl/multifit/func_2.1.rb +1035 -0
  136. data/ext/numo/gsl/multifit/func_2.2.1.rb +736 -0
  137. data/ext/numo/gsl/multifit/func_2.2.rb +736 -0
  138. data/ext/numo/gsl/multifit/func_2.3.rb +872 -0
  139. data/ext/numo/gsl/multifit/func_def.rb +1012 -0
  140. data/ext/numo/gsl/multifit/tmpl/multifit_linear.c +66 -0
  141. data/ext/numo/gsl/multifit/tmpl/multifit_linear_est.c +48 -0
  142. data/ext/numo/gsl/multifit/tmpl/multifit_linear_residuals.c +47 -0
  143. data/ext/numo/gsl/multifit/tmpl/multifit_wlinear.c +70 -0
  144. data/ext/numo/gsl/multifit/type_def.rb +1 -0
  145. data/ext/numo/gsl/numo_gsl.h +117 -0
  146. data/ext/numo/gsl/pdf/depend +17 -0
  147. data/ext/numo/gsl/pdf/erbpp_pdf.rb +26 -0
  148. data/ext/numo/gsl/pdf/extconf.rb +9 -0
  149. data/ext/numo/gsl/pdf/func_2.2.1.rb +306 -0
  150. data/ext/numo/gsl/pdf/func_2.2.rb +306 -0
  151. data/ext/numo/gsl/pdf/func_2.3.rb +306 -0
  152. data/ext/numo/gsl/pdf/func_def.rb +282 -0
  153. data/ext/numo/gsl/pdf/parse_pdf.rb +42 -0
  154. data/ext/numo/gsl/pdf/tmpl/dirichlet.c +39 -0
  155. data/ext/numo/gsl/pdf/tmpl/multinomial.c +39 -0
  156. data/ext/numo/gsl/poly/depend +17 -0
  157. data/ext/numo/gsl/poly/erbpp_poly.rb +70 -0
  158. data/ext/numo/gsl/poly/extconf.rb +9 -0
  159. data/ext/numo/gsl/poly/func_def.rb +234 -0
  160. data/ext/numo/gsl/poly/tmpl/poly_complex_solve.c +59 -0
  161. data/ext/numo/gsl/poly/tmpl/poly_eval.c +70 -0
  162. data/ext/numo/gsl/poly/tmpl/poly_eval_derivs.c +40 -0
  163. data/ext/numo/gsl/ran/depend +17 -0
  164. data/ext/numo/gsl/ran/erbpp_ran.rb +42 -0
  165. data/ext/numo/gsl/ran/extconf.rb +9 -0
  166. data/ext/numo/gsl/ran/func_2.2.1.rb +1658 -0
  167. data/ext/numo/gsl/ran/func_2.2.rb +1658 -0
  168. data/ext/numo/gsl/ran/func_2.3.rb +1658 -0
  169. data/ext/numo/gsl/ran/func_def.rb +1594 -0
  170. data/ext/numo/gsl/ran/parse_ran.rb +10 -0
  171. data/ext/numo/gsl/rng/depend +17 -0
  172. data/ext/numo/gsl/rng/erbpp_rng.rb +58 -0
  173. data/ext/numo/gsl/rng/extconf.rb +9 -0
  174. data/ext/numo/gsl/rng/func_def.rb +230 -0
  175. data/ext/numo/gsl/rng/parse_rng.rb +125 -0
  176. data/ext/numo/gsl/rng/tmpl/ran.c +40 -0
  177. data/ext/numo/gsl/rng/tmpl/ran_DFloat_f_DFloat.c +28 -0
  178. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x2.c +45 -0
  179. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x3.c +51 -0
  180. data/ext/numo/gsl/rng/tmpl/ran_multinomial.c +32 -0
  181. data/ext/numo/gsl/rng/tmpl/rng_DFloat.c +29 -0
  182. data/ext/numo/gsl/rng/tmpl/rng_UInt.c +44 -0
  183. data/ext/numo/gsl/rng/tmpl/rng_alloc.c +24 -0
  184. data/ext/numo/gsl/rng/tmpl/rng_type_new.c +14 -0
  185. data/ext/numo/gsl/rng/type_def.rb +63 -0
  186. data/ext/numo/gsl/rstat/depend +17 -0
  187. data/ext/numo/gsl/rstat/erbpp_rstat.rb +64 -0
  188. data/ext/numo/gsl/rstat/extconf.rb +9 -0
  189. data/ext/numo/gsl/rstat/func_2.2.1.rb +116 -0
  190. data/ext/numo/gsl/rstat/func_2.2.rb +116 -0
  191. data/ext/numo/gsl/rstat/func_2.3.rb +123 -0
  192. data/ext/numo/gsl/rstat/func_def.rb +102 -0
  193. data/ext/numo/gsl/sf/depend +17 -0
  194. data/ext/numo/gsl/sf/erbpp_sf.rb +51 -0
  195. data/ext/numo/gsl/sf/extconf.rb +9 -0
  196. data/ext/numo/gsl/sf/func_def.rb +4703 -0
  197. data/ext/numo/gsl/sf/parse_sf.rb +277 -0
  198. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat.c +50 -0
  199. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat_x2.c +52 -0
  200. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x3_DFloat_x2.c +55 -0
  201. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_DFloat_mode.c +47 -0
  202. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_lmax_array.c +41 -0
  203. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_nmin_nmax_array.c +49 -0
  204. data/ext/numo/gsl/spmatrix/const_2.2.1.rb +3 -0
  205. data/ext/numo/gsl/spmatrix/const_2.2.rb +3 -0
  206. data/ext/numo/gsl/spmatrix/const_2.3.rb +3 -0
  207. data/ext/numo/gsl/spmatrix/const_def.rb +2 -0
  208. data/ext/numo/gsl/spmatrix/depend +17 -0
  209. data/ext/numo/gsl/spmatrix/erbpp_spmatrix.rb +100 -0
  210. data/ext/numo/gsl/spmatrix/extconf.rb +9 -0
  211. data/ext/numo/gsl/spmatrix/func_2.2.1.rb +297 -0
  212. data/ext/numo/gsl/spmatrix/func_2.2.rb +297 -0
  213. data/ext/numo/gsl/spmatrix/func_2.3.rb +297 -0
  214. data/ext/numo/gsl/spmatrix/func_def.rb +218 -0
  215. data/ext/numo/gsl/spmatrix/parse_spmatrix.rb +70 -0
  216. data/ext/numo/gsl/spmatrix/tmpl/itersolve_iterate.c +47 -0
  217. data/ext/numo/gsl/spmatrix/tmpl/itersolve_new.c +22 -0
  218. data/ext/numo/gsl/spmatrix/tmpl/itersolve_type_new.c +16 -0
  219. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemm.c +35 -0
  220. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemv.c +43 -0
  221. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_add.c +22 -0
  222. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c +28 -0
  223. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_new.c +40 -0
  224. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_sp2d.c +25 -0
  225. data/ext/numo/gsl/spmatrix/type_def.rb +1 -0
  226. data/ext/numo/gsl/stats/depend +17 -0
  227. data/ext/numo/gsl/stats/erbpp_stats.rb +29 -0
  228. data/ext/numo/gsl/stats/extconf.rb +9 -0
  229. data/ext/numo/gsl/stats/func_2.2.1.rb +608 -0
  230. data/ext/numo/gsl/stats/func_2.2.rb +608 -0
  231. data/ext/numo/gsl/stats/func_2.3.rb +608 -0
  232. data/ext/numo/gsl/stats/func_def.rb +608 -0
  233. data/ext/numo/gsl/stats/parse_stats.rb +63 -0
  234. data/ext/numo/gsl/stats/tmpl/stats_1a0p.c +37 -0
  235. data/ext/numo/gsl/stats/tmpl/stats_1a0p_index.c +60 -0
  236. data/ext/numo/gsl/stats/tmpl/stats_1a1p.c +41 -0
  237. data/ext/numo/gsl/stats/tmpl/stats_1a2p.c +42 -0
  238. data/ext/numo/gsl/stats/tmpl/stats_2a0p.c +39 -0
  239. data/ext/numo/gsl/stats/tmpl/stats_2a1p.c +43 -0
  240. data/ext/numo/gsl/stats/tmpl/stats_2a2p.c +44 -0
  241. data/ext/numo/gsl/stats/tmpl/stats_minmax.c +37 -0
  242. data/ext/numo/gsl/stats/tmpl/stats_minmax_index.c +67 -0
  243. data/ext/numo/gsl/stats/tmpl/stats_spearman.c +46 -0
  244. data/ext/numo/gsl/sys/const_def.rb +21 -0
  245. data/ext/numo/gsl/sys/depend +17 -0
  246. data/ext/numo/gsl/sys/enum_def.rb +75 -0
  247. data/ext/numo/gsl/sys/erbpp_sys.rb +60 -0
  248. data/ext/numo/gsl/sys/extconf.rb +9 -0
  249. data/ext/numo/gsl/sys/func_def.rb +249 -0
  250. data/ext/numo/gsl/version.h +1 -0
  251. data/ext/numo/gsl/wavelet/depend +17 -0
  252. data/ext/numo/gsl/wavelet/erbpp_wavelet.rb +48 -0
  253. data/ext/numo/gsl/wavelet/extconf.rb +9 -0
  254. data/ext/numo/gsl/wavelet/func_def.rb +337 -0
  255. data/ext/numo/gsl/wavelet/parse_wavelet.rb +47 -0
  256. data/ext/numo/gsl/wavelet/tmpl/wavelet2d_transform.c +56 -0
  257. data/ext/numo/gsl/wavelet/tmpl/wavelet_array_check.c +56 -0
  258. data/ext/numo/gsl/wavelet/tmpl/wavelet_macro.c +1 -0
  259. data/ext/numo/gsl/wavelet/tmpl/wavelet_new.c +20 -0
  260. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform.c +55 -0
  261. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform2.c +22 -0
  262. data/ext/numo/gsl/wavelet/tmpl/wavelet_type_new.c +15 -0
  263. data/ext/numo/gsl/wavelet/type_def.rb +6 -0
  264. data/lib/numo/gsl.rb +17 -0
  265. data/numo-gsl.gemspec +33 -0
  266. metadata +367 -0
@@ -0,0 +1,736 @@
1
+ [{:func_name=>"gsl_multifit_linear_alloc",
2
+ :func_type=>"gsl_multifit_linear_workspace *",
3
+ :args=>[["const size_t", "n"], ["const size_t", "p"]],
4
+ :desc=>
5
+ "This function allocates a workspace for fitting a model to a maximum of n\n" +
6
+ "observations using a maximum of p parameters. The user may later supply\n" +
7
+ "a smaller least squares system if desired. The size of the workspace is\n" +
8
+ "O(np + p^2)."},
9
+ {:func_name=>"gsl_multifit_linear_free",
10
+ :func_type=>"void",
11
+ :args=>[["gsl_multifit_linear_workspace *", "work"]],
12
+ :desc=>"This function frees the memory associated with the workspace w."},
13
+ {:func_name=>"gsl_multifit_linear_svd",
14
+ :func_type=>"int",
15
+ :args=>
16
+ [["const gsl_matrix *", "X"], ["gsl_multifit_linear_workspace *", "work"]],
17
+ :desc=>
18
+ "This function performs a singular value decomposition of the\n" +
19
+ "matrix X and stores the SVD factors internally in work."},
20
+ {:func_name=>"gsl_multifit_linear_bsvd",
21
+ :func_type=>"int",
22
+ :args=>
23
+ [["const gsl_matrix *", "X"], ["gsl_multifit_linear_workspace *", "work"]],
24
+ :desc=>
25
+ "This function performs a singular value decomposition of the\n" +
26
+ "matrix X and stores the SVD factors internally in work.\n" +
27
+ "The matrix X is first balanced by applying column scaling\n" +
28
+ "factors to improve the accuracy of the singular values."},
29
+ {:func_name=>"gsl_multifit_linear",
30
+ :func_type=>"int",
31
+ :args=>
32
+ [["const gsl_matrix *", "X"],
33
+ ["const gsl_vector *", "y"],
34
+ ["gsl_vector *", "c"],
35
+ ["gsl_matrix *", "cov"],
36
+ ["double *", "chisq"],
37
+ ["gsl_multifit_linear_workspace *", "work"]],
38
+ :desc=>
39
+ "This function computes the best-fit parameters c of the model\n" +
40
+ "y = X c for the observations y and the matrix of\n" +
41
+ "predictor variables X, using the preallocated workspace provided\n" +
42
+ "in work. The p-by-p variance-covariance matrix of the model parameters\n" +
43
+ "cov is set to \\sigma^2 (X^T X)^{-1}, where \\sigma is\n" +
44
+ "the standard deviation of the fit residuals.\n" +
45
+ "The sum of squares of the residuals from the best-fit,\n" +
46
+ "\\chi^2, is returned in chisq. If the coefficient of\n" +
47
+ "determination is desired, it can be computed from the expression\n" +
48
+ "R^2 = 1 - \\chi^2 / TSS, where the total sum of squares (TSS) of\n" +
49
+ "the observations y may be computed from gsl_stats_tss.\n" +
50
+ "\n" +
51
+ "The best-fit is found by singular value decomposition of the matrix\n" +
52
+ "X using the modified Golub-Reinsch SVD algorithm, with column\n" +
53
+ "scaling to improve the accuracy of the singular values. Any components\n" +
54
+ "which have zero singular value (to machine precision) are discarded\n" +
55
+ "from the fit."},
56
+ {:func_name=>"gsl_multifit_wlinear",
57
+ :func_type=>"int",
58
+ :args=>
59
+ [["const gsl_matrix *", "X"],
60
+ ["const gsl_vector *", "w"],
61
+ ["const gsl_vector *", "y"],
62
+ ["gsl_vector *", "c"],
63
+ ["gsl_matrix *", "cov"],
64
+ ["double *", "chisq"],
65
+ ["gsl_multifit_linear_workspace *", "work"]],
66
+ :desc=>
67
+ "This function computes the best-fit parameters c of the weighted\n" +
68
+ "model y = X c for the observations y with weights w\n" +
69
+ "and the matrix of predictor variables X, using the preallocated\n" +
70
+ "workspace provided in work. The p-by-p covariance matrix of the model\n" +
71
+ "parameters cov is computed as (X^T W X)^{-1}. The weighted\n" +
72
+ "sum of squares of the residuals from the best-fit, \\chi^2, is\n" +
73
+ "returned in chisq. If the coefficient of determination is\n" +
74
+ "desired, it can be computed from the expression R^2 = 1 - \\chi^2\n" +
75
+ "/ WTSS, where the weighted total sum of squares (WTSS) of the\n" +
76
+ "observations y may be computed from gsl_stats_wtss."},
77
+ {:func_name=>"gsl_multifit_linear_est",
78
+ :func_type=>"int",
79
+ :args=>
80
+ [["const gsl_vector *", "x"],
81
+ ["const gsl_vector *", "c"],
82
+ ["const gsl_matrix *", "cov"],
83
+ ["double *", "y"],
84
+ ["double *", "y_err"]],
85
+ :desc=>
86
+ "This function uses the best-fit multilinear regression coefficients\n" +
87
+ "c and their covariance matrix\n" +
88
+ "cov to compute the fitted function value\n" +
89
+ "y and its standard deviation y_err for the model y = x.c \n" +
90
+ "at the point x."},
91
+ {:func_name=>"gsl_multifit_linear_residuals",
92
+ :func_type=>"int",
93
+ :args=>
94
+ [["const gsl_matrix *", "X"],
95
+ ["const gsl_vector *", "y"],
96
+ ["const gsl_vector *", "c"],
97
+ ["gsl_vector *", "r"]],
98
+ :desc=>
99
+ "This function computes the vector of residuals r = y - X c for\n" +
100
+ "the observations y, coefficients c and matrix of predictor\n" +
101
+ "variables X."},
102
+ {:func_name=>"gsl_multifit_linear_stdform1",
103
+ :func_type=>"int",
104
+ :args=>
105
+ [["const gsl_vector *", "L"],
106
+ ["const gsl_matrix *", "X"],
107
+ ["const gsl_vector *", "y"],
108
+ ["gsl_matrix *", "Xs"],
109
+ ["gsl_vector *", "ys"],
110
+ ["gsl_multifit_linear_workspace *", "work"]],
111
+ :desc=>
112
+ "These functions define a regularization matrix\n" +
113
+ "L = diag(l_0,l_1,...,l_{p-1}).\n" +
114
+ "The diagonal matrix element l_i is provided by the\n" +
115
+ "ith element of the input vector L.\n" +
116
+ "The n-by-p least squares matrix X and\n" +
117
+ "vector y of length n are then\n" +
118
+ "converted to standard form as described above and the parameters\n" +
119
+ "(\\tilde{X},\\tilde{y}) are stored in Xs and ys\n" +
120
+ "on output. Xs and ys have the same dimensions as\n" +
121
+ "X and y. Optional data weights may be supplied in the\n" +
122
+ "vector w of length n. In order to apply this transformation,\n" +
123
+ "L^{-1} must exist and so none of the l_i\n" +
124
+ "may be zero. After the standard form system has been solved,\n" +
125
+ "use gsl_multifit_linear_genform1 to recover the original solution vector.\n" +
126
+ "It is allowed to have X = Xs and y = ys for an in-place transform.\n" +
127
+ "In order to perform a weighted regularized fit with L = I, the user may\n" +
128
+ "call gsl_multifit_linear_applyW to convert to standard form."},
129
+ {:func_name=>"gsl_multifit_linear_wstdform1",
130
+ :func_type=>"int",
131
+ :args=>
132
+ [["const gsl_vector *", "L"],
133
+ ["const gsl_matrix *", "X"],
134
+ ["const gsl_vector *", "w"],
135
+ ["const gsl_vector *", "y"],
136
+ ["gsl_matrix *", "Xs"],
137
+ ["gsl_vector *", "ys"],
138
+ ["gsl_multifit_linear_workspace *", "work"]],
139
+ :desc=>
140
+ "These functions define a regularization matrix\n" +
141
+ "L = diag(l_0,l_1,...,l_{p-1}).\n" +
142
+ "The diagonal matrix element l_i is provided by the\n" +
143
+ "ith element of the input vector L.\n" +
144
+ "The n-by-p least squares matrix X and\n" +
145
+ "vector y of length n are then\n" +
146
+ "converted to standard form as described above and the parameters\n" +
147
+ "(\\tilde{X},\\tilde{y}) are stored in Xs and ys\n" +
148
+ "on output. Xs and ys have the same dimensions as\n" +
149
+ "X and y. Optional data weights may be supplied in the\n" +
150
+ "vector w of length n. In order to apply this transformation,\n" +
151
+ "L^{-1} must exist and so none of the l_i\n" +
152
+ "may be zero. After the standard form system has been solved,\n" +
153
+ "use gsl_multifit_linear_genform1 to recover the original solution vector.\n" +
154
+ "It is allowed to have X = Xs and y = ys for an in-place transform.\n" +
155
+ "In order to perform a weighted regularized fit with L = I, the user may\n" +
156
+ "call gsl_multifit_linear_applyW to convert to standard form."},
157
+ {:func_name=>"gsl_multifit_linear_L_decomp",
158
+ :func_type=>"int",
159
+ :args=>[["gsl_matrix *", "L"], ["gsl_vector *", "tau"]],
160
+ :desc=>
161
+ "This function factors the m-by-p regularization matrix\n" +
162
+ "L into a form needed for the later transformation to standard form. L\n" +
163
+ "may have any number of rows m. If m \\ge p the QR decomposition of\n" +
164
+ "L is computed and stored in L on output. If m < p, the QR decomposition\n" +
165
+ "of L^T is computed and stored in L on output. On output,\n" +
166
+ "the Householder scalars are stored in the vector tau of size MIN(m,p).\n" +
167
+ "These outputs will be used by gsl_multifit_linear_wstdform2 to complete the\n" +
168
+ "transformation to standard form."},
169
+ {:func_name=>"gsl_multifit_linear_stdform2",
170
+ :func_type=>"int",
171
+ :args=>
172
+ [["const gsl_matrix *", "LQR"],
173
+ ["const gsl_vector *", "Ltau"],
174
+ ["const gsl_matrix *", "X"],
175
+ ["const gsl_vector *", "y"],
176
+ ["gsl_matrix *", "Xs"],
177
+ ["gsl_vector *", "ys"],
178
+ ["gsl_matrix *", "M"],
179
+ ["gsl_multifit_linear_workspace *", "work"]],
180
+ :desc=>
181
+ "These functions convert the least squares system (X,y,W,L) to standard\n" +
182
+ "form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
183
+ "respectively. The m-by-p regularization matrix L is specified by the inputs\n" +
184
+ "LQR and Ltau, which are outputs from gsl_multifit_linear_L_decomp.\n" +
185
+ "The dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
186
+ "depend on whether m is larger or less than p. For m \\ge p,\n" +
187
+ "Xs is n-by-p, ys is n-by-1, and M is\n" +
188
+ "not used. For m < p, Xs is (n - p + m)-by-m,\n" +
189
+ "ys is (n - p + m)-by-1, and M is additional n-by-p workspace,\n" +
190
+ "which is required to recover the original solution vector after the system has been\n" +
191
+ "solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
192
+ "vector w of length n, where W = diag(w)."},
193
+ {:func_name=>"gsl_multifit_linear_wstdform2",
194
+ :func_type=>"int",
195
+ :args=>
196
+ [["const gsl_matrix *", "LQR"],
197
+ ["const gsl_vector *", "Ltau"],
198
+ ["const gsl_matrix *", "X"],
199
+ ["const gsl_vector *", "w"],
200
+ ["const gsl_vector *", "y"],
201
+ ["gsl_matrix *", "Xs"],
202
+ ["gsl_vector *", "ys"],
203
+ ["gsl_matrix *", "M"],
204
+ ["gsl_multifit_linear_workspace *", "work"]],
205
+ :desc=>
206
+ "These functions convert the least squares system (X,y,W,L) to standard\n" +
207
+ "form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
208
+ "respectively. The m-by-p regularization matrix L is specified by the inputs\n" +
209
+ "LQR and Ltau, which are outputs from gsl_multifit_linear_L_decomp.\n" +
210
+ "The dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
211
+ "depend on whether m is larger or less than p. For m \\ge p,\n" +
212
+ "Xs is n-by-p, ys is n-by-1, and M is\n" +
213
+ "not used. For m < p, Xs is (n - p + m)-by-m,\n" +
214
+ "ys is (n - p + m)-by-1, and M is additional n-by-p workspace,\n" +
215
+ "which is required to recover the original solution vector after the system has been\n" +
216
+ "solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
217
+ "vector w of length n, where W = diag(w)."},
218
+ {:func_name=>"gsl_multifit_linear_solve",
219
+ :func_type=>"int",
220
+ :args=>
221
+ [["const double", "lambda"],
222
+ ["const gsl_matrix *", "Xs"],
223
+ ["const gsl_vector *", "ys"],
224
+ ["gsl_vector *", "cs"],
225
+ ["double *", "rnorm"],
226
+ ["double *", "snorm"],
227
+ ["gsl_multifit_linear_workspace *", "work"]],
228
+ :desc=>
229
+ "This function computes the regularized best-fit parameters \\tilde{c}\n" +
230
+ "which minimize the cost function\n" +
231
+ "\\chi^2 = || \\tilde{y} - \\tilde{X} \\tilde{c} ||^2 + \\lambda^2 || \\tilde{c} ||^2 which is\n" +
232
+ "in standard form. The least squares system must therefore be converted\n" +
233
+ "to standard form prior to calling this function.\n" +
234
+ "The observation vector \\tilde{y} is provided in ys and the matrix of\n" +
235
+ "predictor variables \\tilde{X} in Xs. The solution vector \\tilde{c} is\n" +
236
+ "returned in cs, which has length min(m,p). The SVD of Xs must be computed prior\n" +
237
+ "to calling this function, using gsl_multifit_linear_svd.\n" +
238
+ "The regularization parameter \\lambda is provided in lambda.\n" +
239
+ "The residual norm || \\tilde{y} - \\tilde{X} \\tilde{c} || = ||y - X c||_W is returned in rnorm.\n" +
240
+ "The solution norm || \\tilde{c} || = ||L c|| is returned in\n" +
241
+ "snorm."},
242
+ {:func_name=>"gsl_multifit_linear_genform1",
243
+ :func_type=>"int",
244
+ :args=>
245
+ [["const gsl_vector *", "L"],
246
+ ["const gsl_vector *", "cs"],
247
+ ["gsl_vector *", "c"],
248
+ ["gsl_multifit_linear_workspace *", "work"]],
249
+ :desc=>
250
+ "After a regularized system has been solved with\n" +
251
+ "L = diag(\\l_0,\\l_1,...,\\l_{p-1}),\n" +
252
+ "this function backtransforms the standard form solution vector cs\n" +
253
+ "to recover the solution vector of the original problem c. The\n" +
254
+ "diagonal matrix elements l_i are provided in\n" +
255
+ "the vector L. It is allowed to have c = cs for an\n" +
256
+ "in-place transform."},
257
+ {:func_name=>"gsl_multifit_linear_genform2",
258
+ :func_type=>"int",
259
+ :args=>
260
+ [["const gsl_matrix *", "LQR"],
261
+ ["const gsl_vector *", "Ltau"],
262
+ ["const gsl_matrix *", "X"],
263
+ ["const gsl_vector *", "y"],
264
+ ["const gsl_vector *", "cs"],
265
+ ["const gsl_matrix *", "M"],
266
+ ["gsl_vector *", "c"],
267
+ ["gsl_multifit_linear_workspace *", "work"]],
268
+ :desc=>
269
+ "After a regularized system has been solved with a general rectangular matrix L,\n" +
270
+ "specified by (LQR,Ltau), this function backtransforms the standard form solution cs\n" +
271
+ "to recover the solution vector of the original problem, which is stored in c,\n" +
272
+ "of length p. The original least squares matrix and observation vector are provided in\n" +
273
+ "X and y respectively. M is the matrix computed by\n" +
274
+ "gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
275
+ "w must also be supplied."},
276
+ {:func_name=>"gsl_multifit_linear_wgenform2",
277
+ :func_type=>"int",
278
+ :args=>
279
+ [["const gsl_matrix *", "LQR"],
280
+ ["const gsl_vector *", "Ltau"],
281
+ ["const gsl_matrix *", "X"],
282
+ ["const gsl_vector *", "w"],
283
+ ["const gsl_vector *", "y"],
284
+ ["const gsl_vector *", "cs"],
285
+ ["const gsl_matrix *", "M"],
286
+ ["gsl_vector *", "c"],
287
+ ["gsl_multifit_linear_workspace *", "work"]],
288
+ :desc=>
289
+ "After a regularized system has been solved with a general rectangular matrix L,\n" +
290
+ "specified by (LQR,Ltau), this function backtransforms the standard form solution cs\n" +
291
+ "to recover the solution vector of the original problem, which is stored in c,\n" +
292
+ "of length p. The original least squares matrix and observation vector are provided in\n" +
293
+ "X and y respectively. M is the matrix computed by\n" +
294
+ "gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
295
+ "w must also be supplied."},
296
+ {:func_name=>"gsl_multifit_linear_applyW",
297
+ :func_type=>"int",
298
+ :args=>
299
+ [["const gsl_matrix *", "X"],
300
+ ["const gsl_vector *", "w"],
301
+ ["const gsl_vector *", "y"],
302
+ ["gsl_matrix *", "WX"],
303
+ ["gsl_vector *", "Wy"]],
304
+ :desc=>
305
+ "For weighted least squares systems with L = I, this function may be used to\n" +
306
+ "convert the system to standard form by applying the weight matrix W = diag(w)\n" +
307
+ "to the least squares matrix X and observation vector y. On output, WX\n" +
308
+ "is equal to W^{1/2} X and Wy is equal to W^{1/2} y. It is allowed\n" +
309
+ "for WX = X and Wy = y for an in-place transform."},
310
+ {:func_name=>"gsl_multifit_linear_lcurve",
311
+ :func_type=>"int",
312
+ :args=>
313
+ [["const gsl_vector *", "y"],
314
+ ["gsl_vector *", "reg_param"],
315
+ ["gsl_vector *", "rho"],
316
+ ["gsl_vector *", "eta"],
317
+ ["gsl_multifit_linear_workspace *", "work"]],
318
+ :desc=>
319
+ "This function computes the L-curve for a least squares system\n" +
320
+ "using the right hand side vector y and the SVD decomposition\n" +
321
+ "of the least squares matrix X, which must be provided\n" +
322
+ "to gsl_multifit_linear_svd prior to\n" +
323
+ "calling this function. The output vectors reg_param,\n" +
324
+ "rho, and eta must all be the same size, and will\n" +
325
+ "contain the regularization parameters \\lambda_i, residual norms\n" +
326
+ "||y - X c_i||, and solution norms || L c_i ||\n" +
327
+ "which compose the L-curve, where c_i is the regularized\n" +
328
+ "solution vector corresponding to \\lambda_i.\n" +
329
+ "The user may determine the number of points on the L-curve by\n" +
330
+ "adjusting the size of these input arrays. The regularization\n" +
331
+ "parameters \\lambda_i are estimated from the singular values\n" +
332
+ "of X, and chosen to represent the most relevant portion of\n" +
333
+ "the L-curve."},
334
+ {:func_name=>"gsl_multifit_linear_lcorner",
335
+ :func_type=>"int",
336
+ :args=>
337
+ [["const gsl_vector *", "rho"],
338
+ ["const gsl_vector *", "eta"],
339
+ ["size_t *", "idx"]],
340
+ :desc=>
341
+ "This function attempts to locate the corner of the L-curve\n" +
342
+ "(||y - X c||, ||L c||) defined by the rho and eta\n" +
343
+ "input arrays respectively. The corner is defined as the point of maximum\n" +
344
+ "curvature of the L-curve in log-log scale. The rho and eta\n" +
345
+ "arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
346
+ "algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
347
+ "and uses the circle's radius to determine the curvature at\n" +
348
+ "the middle point. Therefore, the input array sizes must be\n" +
349
+ "\\ge 3. With more points provided for the L-curve, a better\n" +
350
+ "estimate of the curvature can be obtained. The array index\n" +
351
+ "corresponding to maximum curvature (ie: the corner) is returned\n" +
352
+ "in idx. If the input arrays contain colinear points,\n" +
353
+ "this function could fail and return GSL_EINVAL."},
354
+ {:func_name=>"gsl_multifit_linear_lcorner2",
355
+ :func_type=>"int",
356
+ :args=>
357
+ [["const gsl_vector *", "reg_param"],
358
+ ["const gsl_vector *", "eta"],
359
+ ["size_t *", "idx"]],
360
+ :desc=>
361
+ "This function attempts to locate the corner of an alternate L-curve\n" +
362
+ "(\\lambda^2, ||L c||^2) studied by Rezghi and Hosseini, 2009.\n" +
363
+ "This alternate L-curve can provide better estimates of the\n" +
364
+ "regularization parameter for smooth solution vectors. The regularization\n" +
365
+ "parameters \\lambda and solution norms ||L c|| are provided\n" +
366
+ "in the reg_param and eta input arrays respectively. The\n" +
367
+ "corner is defined as the point of maximum curvature of this\n" +
368
+ "alternate L-curve in linear scale. The reg_param and eta\n" +
369
+ "arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
370
+ "algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
371
+ "and uses the circle's radius to determine the curvature at\n" +
372
+ "the middle point. Therefore, the input array sizes must be\n" +
373
+ "\\ge 3. With more points provided for the L-curve, a better\n" +
374
+ "estimate of the curvature can be obtained. The array index\n" +
375
+ "corresponding to maximum curvature (ie: the corner) is returned\n" +
376
+ "in idx. If the input arrays contain colinear points,\n" +
377
+ "this function could fail and return GSL_EINVAL."},
378
+ {:func_name=>"gsl_multifit_linear_Lk",
379
+ :func_type=>"int",
380
+ :args=>[["const size_t", "p"], ["const size_t", "k"], ["gsl_matrix *", "L"]],
381
+ :desc=>
382
+ "This function computes the discrete approximation to the derivative operator L_k of\n" +
383
+ "order k on a regular grid of p points and stores it in L. The dimensions of L are\n" +
384
+ "(p-k)-by-p."},
385
+ {:func_name=>"gsl_multifit_linear_Lsobolev",
386
+ :func_type=>"int",
387
+ :args=>
388
+ [["const size_t", "p"],
389
+ ["const size_t", "kmax"],
390
+ ["const gsl_vector *", "alpha"],
391
+ ["gsl_matrix *", "L"],
392
+ ["gsl_multifit_linear_workspace *", "work"]],
393
+ :desc=>
394
+ "This function computes the regularization matrix L corresponding to the weighted Sobolov norm\n" +
395
+ "||L c||^2 = \\sum_k \\alpha_k^2 ||L_k c||^2 where L_k approximates the derivative\n" +
396
+ "operator of order k. This regularization norm can be useful in applications where\n" +
397
+ "it is necessary to smooth several derivatives of the solution. p is the number of\n" +
398
+ "model parameters, kmax is the highest derivative to include in the summation above, and\n" +
399
+ "alpha is the vector of weights of size kmax + 1, where alpha[k] = \\alpha_k\n" +
400
+ "is the weight assigned to the derivative of order k. The output matrix L is size\n" +
401
+ "p-by-p and upper triangular."},
402
+ {:func_name=>"gsl_multifit_linear_rcond",
403
+ :func_type=>"double",
404
+ :args=>[["const gsl_multifit_linear_workspace *", "work"]],
405
+ :desc=>
406
+ "This function returns the reciprocal condition number of the least squares matrix X,\n" +
407
+ "defined as the ratio of the smallest and largest singular values, rcond = \\sigma_{min}/\\sigma_{max}.\n" +
408
+ "The routine gsl_multifit_linear_svd must first be called to compute the SVD of X."},
409
+ {:func_name=>"gsl_multifit_robust_alloc",
410
+ :func_type=>"gsl_multifit_robust_workspace *",
411
+ :args=>
412
+ [["const gsl_multifit_robust_type *", "T"],
413
+ ["const size_t", "n"],
414
+ ["const size_t", "p"]],
415
+ :desc=>
416
+ "This function allocates a workspace for fitting a model to n\n" +
417
+ "observations using p parameters. The size of the workspace\n" +
418
+ "is O(np + p^2). The type T specifies the\n" +
419
+ "function \\psi and can be selected from the following choices.\n" +
420
+ "\n" +
421
+ "\n" +
422
+ "\n" +
423
+ "\n" +
424
+ "\n"},
425
+ {:func_name=>"gsl_multifit_robust_free",
426
+ :func_type=>"void",
427
+ :args=>[["gsl_multifit_robust_workspace *", "w"]],
428
+ :desc=>"This function frees the memory associated with the workspace w."},
429
+ {:func_name=>"gsl_multifit_robust_name",
430
+ :func_type=>"const char *",
431
+ :args=>[["const gsl_multifit_robust_workspace *", "w"]],
432
+ :desc=>
433
+ "This function returns the name of the robust type T specified to gsl_multifit_robust_alloc."},
434
+ {:func_name=>"gsl_multifit_robust_tune",
435
+ :func_type=>"int",
436
+ :args=>[["const double", "tune"], ["gsl_multifit_robust_workspace *", "w"]],
437
+ :desc=>
438
+ "This function sets the tuning constant t used to adjust the residuals at each iteration to tune.\n" +
439
+ "Decreasing the tuning constant increases the downweight assigned to large residuals, while increasing\n" +
440
+ "the tuning constant decreases the downweight assigned to large residuals."},
441
+ {:func_name=>"gsl_multifit_robust_maxiter",
442
+ :func_type=>"int",
443
+ :args=>
444
+ [["const size_t", "maxiter"], ["gsl_multifit_robust_workspace *", "w"]],
445
+ :desc=>
446
+ "This function sets the maximum number of iterations in the iteratively\n" +
447
+ "reweighted least squares algorithm to maxiter. By default,\n" +
448
+ "this value is set to 100 by gsl_multifit_robust_alloc."},
449
+ {:func_name=>"gsl_multifit_robust_weights",
450
+ :func_type=>"int",
451
+ :args=>
452
+ [["const gsl_vector *", "r"],
453
+ ["gsl_vector *", "wts"],
454
+ ["gsl_multifit_robust_workspace *", "w"]],
455
+ :desc=>
456
+ "This function assigns weights to the vector wts using the residual vector r and\n" +
457
+ "previously specified weighting function. The output weights are given by wts_i = w(r_i / (t \\sigma)),\n" +
458
+ "where the weighting functions w are detailed in gsl_multifit_robust_alloc. \\sigma\n" +
459
+ "is an estimate of the residual standard deviation based on the Median-Absolute-Deviation and t\n" +
460
+ "is the tuning constant. This\n" +
461
+ "function is useful if the user wishes to implement their own robust regression rather than using\n" +
462
+ "the supplied gsl_multifit_robust routine below."},
463
+ {:func_name=>"gsl_multifit_robust",
464
+ :func_type=>"int",
465
+ :args=>
466
+ [["const gsl_matrix *", "X"],
467
+ ["const gsl_vector *", "y"],
468
+ ["gsl_vector *", "c"],
469
+ ["gsl_matrix *", "cov"],
470
+ ["gsl_multifit_robust_workspace *", "w"]],
471
+ :desc=>
472
+ "This function computes the best-fit parameters c of the model\n" +
473
+ "y = X c for the observations y and the matrix of\n" +
474
+ "predictor variables X, attemping to reduce the influence\n" +
475
+ "of outliers using the algorithm outlined above.\n" +
476
+ "The p-by-p variance-covariance matrix of the model parameters\n" +
477
+ "cov is estimated as \\sigma^2 (X^T X)^{-1}, where \\sigma is\n" +
478
+ "an approximation of the residual standard deviation using the theory of robust\n" +
479
+ "regression. Special care must be taken when estimating \\sigma and\n" +
480
+ "other statistics such as R^2, and so these\n" +
481
+ "are computed internally and are available by calling the function\n" +
482
+ "gsl_multifit_robust_statistics.\n" +
483
+ "\n" +
484
+ "If the coefficients do not converge within the maximum iteration\n" +
485
+ "limit, the function returns GSL_EMAXITER. In this case,\n" +
486
+ "the current estimates of the coefficients and covariance matrix\n" +
487
+ "are returned in c and cov and the internal fit statistics\n" +
488
+ "are computed with these estimates."},
489
+ {:func_name=>"gsl_multifit_robust_est",
490
+ :func_type=>"int",
491
+ :args=>
492
+ [["const gsl_vector *", "x"],
493
+ ["const gsl_vector *", "c"],
494
+ ["const gsl_matrix *", "cov"],
495
+ ["double *", "y"],
496
+ ["double *", "y_err"]],
497
+ :desc=>
498
+ "This function uses the best-fit robust regression coefficients\n" +
499
+ "c and their covariance matrix\n" +
500
+ "cov to compute the fitted function value\n" +
501
+ "y and its standard deviation y_err for the model y = x.c \n" +
502
+ "at the point x."},
503
+ {:func_name=>"gsl_multifit_robust_residuals",
504
+ :func_type=>"int",
505
+ :args=>
506
+ [["const gsl_matrix *", "X"],
507
+ ["const gsl_vector *", "y"],
508
+ ["const gsl_vector *", "c"],
509
+ ["gsl_vector *", "r"],
510
+ ["gsl_multifit_robust_workspace *", "w"]],
511
+ :desc=>
512
+ "This function computes the vector of studentized residuals\n" +
513
+ "r_i = {y_i - (X c)_i \\over \\sigma \\sqrt{1 - h_i}} for\n" +
514
+ "the observations y, coefficients c and matrix of predictor\n" +
515
+ "variables X. The routine gsl_multifit_robust must\n" +
516
+ "first be called to compute the statisical leverages h_i of\n" +
517
+ "the matrix X and residual standard deviation estimate \\sigma."},
518
+ {:func_name=>"gsl_multifit_robust_statistics",
519
+ :func_type=>"gsl_multifit_robust_stats",
520
+ :args=>[["const gsl_multifit_robust_workspace *", "w"]],
521
+ :desc=>
522
+ "This function returns a structure containing relevant statistics from a robust regression. The function\n" +
523
+ "gsl_multifit_robust must be called first to perform the regression and calculate these statistics.\n" +
524
+ "The returned gsl_multifit_robust_stats structure contains the following fields."},
525
+ {:func_name=>"gsl_multifit_nlinear_alloc",
526
+ :func_type=>"gsl_multifit_nlinear_workspace *",
527
+ :args=>
528
+ [["const gsl_multifit_nlinear_type *", "T"],
529
+ ["const gsl_multifit_nlinear_parameters *", "params"],
530
+ ["const size_t", "n"],
531
+ ["const size_t", "p"]],
532
+ :desc=>
533
+ "These functions return a pointer to a newly allocated instance of a\n" +
534
+ "derivative solver of type T for n observations and p\n" +
535
+ "parameters. The params input specifies a tunable set of\n" +
536
+ "parameters which will affect important details in each iteration\n" +
537
+ "of the trust region subproblem algorithm. It is recommended to start\n" +
538
+ "with the suggested default parameters (see\n" +
539
+ "gsl_multifit_nlinear_default_parameters and\n" +
540
+ "gsl_multilarge_nlinear_default_parameters) and then tune\n" +
541
+ "the parameters once the code is working correctly. See\n" +
542
+ "Nonlinear Least-Squares Tunable Parameters\n" +
543
+ "for descriptions of the various parameters.\n" +
544
+ "For example, the following code creates an instance of a\n" +
545
+ "Levenberg-Marquardt solver for 100 data points and 3 parameters,\n" +
546
+ "using suggested defaults:\n" +
547
+ "\n" +
548
+ "const gsl_multifit_nlinear_type * T \n" +
549
+ " = gsl_multifit_nlinear_lm;\n" +
550
+ "gsl_multifit_nlinear_parameters params\n" +
551
+ " = gsl_multifit_nlinear_default_parameters();\n" +
552
+ "gsl_multifit_nlinear_workspace * w \n" +
553
+ " = gsl_multifit_nlinear_alloc (T, &params, 100, 3);\n" +
554
+ "\n" +
555
+ "The number of observations n must be greater than or equal to\n" +
556
+ "parameters p.\n" +
557
+ "\n" +
558
+ "If there is insufficient memory to create the solver then the function\n" +
559
+ "returns a null pointer and the error handler is invoked with an error\n" +
560
+ "code of GSL_ENOMEM."},
561
+ {:func_name=>"gsl_multifit_nlinear_default_parameters",
562
+ :func_type=>"gsl_multifit_nlinear_parameters",
563
+ :args=>[["", "void"]],
564
+ :desc=>
565
+ "These functions return a set of recommended default parameters\n" +
566
+ "for use in solving nonlinear least squares problems. The user\n" +
567
+ "can tune each parameter to improve the performance on their\n" +
568
+ "particular problem, see\n" +
569
+ "Nonlinear Least-Squares Tunable Parameters."},
570
+ {:func_name=>"gsl_multifit_nlinear_init",
571
+ :func_type=>"int",
572
+ :args=>
573
+ [["const gsl_vector *", "x"],
574
+ ["gsl_multifit_nlinear_fdf *", "fdf"],
575
+ ["gsl_multifit_nlinear_workspace *", "w"]],
576
+ :desc=>
577
+ "These functions initialize, or reinitialize, an existing workspace w\n" +
578
+ "to use the system fdf and the initial guess\n" +
579
+ "x. See Nonlinear Least-Squares Function Definition\n" +
580
+ "for a description of the fdf structure.\n" +
581
+ "\n" +
582
+ "Optionally, a weight vector wts can be given to perform\n" +
583
+ "a weighted nonlinear regression. Here, the weighting matrix is\n" +
584
+ "W = diag(w_1,w_2,...,w_n)."},
585
+ {:func_name=>"gsl_multifit_nlinear_winit",
586
+ :func_type=>"int",
587
+ :args=>
588
+ [["const gsl_vector *", "x"],
589
+ ["const gsl_vector *", "wts"],
590
+ ["gsl_multifit_nlinear_fdf *", "fdf"],
591
+ ["gsl_multifit_nlinear_workspace *", "w"]],
592
+ :desc=>
593
+ "These functions initialize, or reinitialize, an existing workspace w\n" +
594
+ "to use the system fdf and the initial guess\n" +
595
+ "x. See Nonlinear Least-Squares Function Definition\n" +
596
+ "for a description of the fdf structure.\n" +
597
+ "\n" +
598
+ "Optionally, a weight vector wts can be given to perform\n" +
599
+ "a weighted nonlinear regression. Here, the weighting matrix is\n" +
600
+ "W = diag(w_1,w_2,...,w_n)."},
601
+ {:func_name=>"gsl_multifit_nlinear_free",
602
+ :func_type=>"void",
603
+ :args=>[["gsl_multifit_nlinear_workspace *", "w"]],
604
+ :desc=>
605
+ "These functions free all the memory associated with the workspace w."},
606
+ {:func_name=>"gsl_multifit_nlinear_name",
607
+ :func_type=>"const char *",
608
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
609
+ :desc=>
610
+ "These functions return a pointer to the name of the solver. For example,\n" +
611
+ "\n" +
612
+ "printf (\"w is a '%s' solver\\n\", \n" +
613
+ " gsl_multifit_nlinear_name (w));\n" +
614
+ "\n" +
615
+ "would print something like w is a 'trust-region' solver."},
616
+ {:func_name=>"gsl_multifit_nlinear_trs_name",
617
+ :func_type=>"const char *",
618
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
619
+ :desc=>
620
+ "These functions return a pointer to the name of the trust region subproblem\n" +
621
+ "method. For example,\n" +
622
+ "\n" +
623
+ "printf (\"w is a '%s' solver\\n\", \n" +
624
+ " gsl_multifit_nlinear_trs_name (w));\n" +
625
+ "\n" +
626
+ "would print something like w is a 'levenberg-marquardt' solver."},
627
+ {:func_name=>"gsl_multifit_nlinear_iterate",
628
+ :func_type=>"int",
629
+ :args=>[["gsl_multifit_nlinear_workspace *", "w"]],
630
+ :desc=>
631
+ "These functions perform a single iteration of the solver w. If\n" +
632
+ "the iteration encounters an unexpected problem then an error code will\n" +
633
+ "be returned. The solver workspace maintains a current estimate of the\n" +
634
+ "best-fit parameters at all times."},
635
+ {:func_name=>"gsl_multifit_nlinear_position",
636
+ :func_type=>"gsl_vector *",
637
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
638
+ :desc=>
639
+ "These functions return the current position x (i.e. best-fit\n" +
640
+ "parameters) of the solver w."},
641
+ {:func_name=>"gsl_multifit_nlinear_residual",
642
+ :func_type=>"gsl_vector *",
643
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
644
+ :desc=>
645
+ "These functions return the current residual vector f(x) of the\n" +
646
+ "solver w. For weighted systems, the residual vector includes the\n" +
647
+ "weighting factor \\sqrt{W}."},
648
+ {:func_name=>"gsl_multifit_nlinear_jac",
649
+ :func_type=>"gsl_matrix *",
650
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
651
+ :desc=>
652
+ "This function returns a pointer to the n-by-p Jacobian matrix for the\n" +
653
+ "current iteration of the solver w. This function is available only for the\n" +
654
+ "gsl_multifit_nlinear interface."},
655
+ {:func_name=>"gsl_multifit_nlinear_niter",
656
+ :func_type=>"size_t",
657
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
658
+ :desc=>
659
+ "These functions return the number of iterations performed so far.\n" +
660
+ "The iteration counter is updated on each call to the\n" +
661
+ "_iterate functions above, and reset to 0 in the\n" +
662
+ "_init functions."},
663
+ {:func_name=>"gsl_multifit_nlinear_rcond",
664
+ :func_type=>"int",
665
+ :args=>
666
+ [["double *", "rcond"], ["const gsl_multifit_nlinear_workspace *", "w"]],
667
+ :desc=>
668
+ "This function estimates the reciprocal condition number\n" +
669
+ "of the Jacobian matrix at the current position x and\n" +
670
+ "stores it in rcond. The computed value is only an estimate\n" +
671
+ "to give the user a guideline as to the conditioning of their particular\n" +
672
+ "problem. Its calculation is based on which factorization\n" +
673
+ "method is used (Cholesky, QR, or SVD). \n"},
674
+ {:func_name=>"gsl_multifit_nlinear_test",
675
+ :func_type=>"int",
676
+ :args=>
677
+ [["const double", "xtol"],
678
+ ["const double", "gtol"],
679
+ ["const double", "ftol"],
680
+ ["int *", "info"],
681
+ ["const gsl_multifit_nlinear_workspace *", "w"]],
682
+ :desc=>
683
+ "These functions test for convergence of the minimization method\n" +
684
+ "using the following criteria:\n" +
685
+ "\n" +
686
+ "\n" +
687
+ "If none of the tests succeed, info is set to 0 and the\n" +
688
+ "function returns GSL_CONTINUE, indicating further iterations\n" +
689
+ "are required.\n"},
690
+ {:func_name=>"gsl_multifit_nlinear_covar",
691
+ :func_type=>"int",
692
+ :args=>
693
+ [["const gsl_matrix *", "J"],
694
+ ["const double", "epsrel"],
695
+ ["gsl_matrix *", "covar"]],
696
+ :desc=>
697
+ "This function computes the covariance matrix of best-fit parameters\n" +
698
+ "using the Jacobian matrix J and stores it in covar.\n" +
699
+ "The parameter epsrel is used to remove linear-dependent columns\n" +
700
+ "when J is rank deficient.\n" +
701
+ "\n" +
702
+ "The covariance matrix is given by,\n" +
703
+ "\n" +
704
+ "covar = (J^T J)^@{-1@}\n" +
705
+ "\n" +
706
+ "or in the weighted case,\n" +
707
+ "\n" +
708
+ "covar = (J^T W J)^@{-1@}\n" +
709
+ "\n" +
710
+ "and is computed using the factored form of the Jacobian (Cholesky, QR, or SVD).\n" +
711
+ "Any columns of R which satisfy \n" +
712
+ "\n" +
713
+ "|R_@{kk@}| <= epsrel |R_@{11@}|\n" +
714
+ "\n" +
715
+ "are considered linearly-dependent and are excluded from the covariance\n" +
716
+ "matrix (the corresponding rows and columns of the covariance matrix are\n" +
717
+ "set to zero).\n" +
718
+ "\n" +
719
+ "If the minimisation uses the weighted least-squares function\n" +
720
+ "f_i = (Y(x, t_i) - y_i) / \\sigma_i then the covariance\n" +
721
+ "matrix above gives the statistical error on the best-fit parameters\n" +
722
+ "resulting from the Gaussian errors \\sigma_i on \n" +
723
+ "the underlying data y_i. This can be verified from the relation \n" +
724
+ "\\delta f = J \\delta c and the fact that the fluctuations in f\n" +
725
+ "from the data y_i are normalised by \\sigma_i and \n" +
726
+ "so satisfy $\\langle \\delta f \\delta f^T \\rangle = I$\n" +
727
+ "<\\delta f \\delta f^T> = I.\n" +
728
+ "\n" +
729
+ "For an unweighted least-squares function f_i = (Y(x, t_i) -\n" +
730
+ "y_i) the covariance matrix above should be multiplied by the variance\n" +
731
+ "of the residuals about the best-fit \\sigma^2 = \\sum (y_i - Y(x,t_i))^2 / (n-p)\n" +
732
+ "to give the variance-covariance\n" +
733
+ "matrix \\sigma^2 C. This estimates the statistical error on the\n" +
734
+ "best-fit parameters from the scatter of the underlying data.\n" +
735
+ "\n" +
736
+ "For more information about covariance matrices see Fitting Overview."}]