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,872 @@
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_linear_tsvd",
57
+ :func_type=>"int",
58
+ :args=>
59
+ [["const gsl_matrix *", "X"],
60
+ ["const gsl_vector *", "y"],
61
+ ["const double", "tol"],
62
+ ["gsl_vector *", "c"],
63
+ ["gsl_matrix *", "cov"],
64
+ ["double *", "chisq"],
65
+ ["size_t *", "rank"],
66
+ ["gsl_multifit_linear_workspace *", "work"]],
67
+ :desc=>
68
+ "This function computes the best-fit parameters c of the model\n" +
69
+ "y = X c for the observations y and the matrix of\n" +
70
+ "predictor variables X, using a truncated SVD expansion.\n" +
71
+ "Singular values which satisfy s_i \\le tol \\times s_0\n" +
72
+ "are discarded from the fit, where s_0 is the largest singular value.\n" +
73
+ "The p-by-p variance-covariance matrix of the model parameters\n" +
74
+ "cov is set to \\sigma^2 (X^T X)^{-1}, where \\sigma is\n" +
75
+ "the standard deviation of the fit residuals.\n" +
76
+ "The sum of squares of the residuals from the best-fit,\n" +
77
+ "\\chi^2, is returned in chisq. The effective rank\n" +
78
+ "(number of singular values used in solution) is returned in rank.\n" +
79
+ "If the coefficient of\n" +
80
+ "determination is desired, it can be computed from the expression\n" +
81
+ "R^2 = 1 - \\chi^2 / TSS, where the total sum of squares (TSS) of\n" +
82
+ "the observations y may be computed from gsl_stats_tss."},
83
+ {:func_name=>"gsl_multifit_wlinear",
84
+ :func_type=>"int",
85
+ :args=>
86
+ [["const gsl_matrix *", "X"],
87
+ ["const gsl_vector *", "w"],
88
+ ["const gsl_vector *", "y"],
89
+ ["gsl_vector *", "c"],
90
+ ["gsl_matrix *", "cov"],
91
+ ["double *", "chisq"],
92
+ ["gsl_multifit_linear_workspace *", "work"]],
93
+ :desc=>
94
+ "This function computes the best-fit parameters c of the weighted\n" +
95
+ "model y = X c for the observations y with weights w\n" +
96
+ "and the matrix of predictor variables X, using the preallocated\n" +
97
+ "workspace provided in work. The p-by-p covariance matrix of the model\n" +
98
+ "parameters cov is computed as (X^T W X)^{-1}. The weighted\n" +
99
+ "sum of squares of the residuals from the best-fit, \\chi^2, is\n" +
100
+ "returned in chisq. If the coefficient of determination is\n" +
101
+ "desired, it can be computed from the expression R^2 = 1 - \\chi^2\n" +
102
+ "/ WTSS, where the weighted total sum of squares (WTSS) of the\n" +
103
+ "observations y may be computed from gsl_stats_wtss."},
104
+ {:func_name=>"gsl_multifit_wlinear_tsvd",
105
+ :func_type=>"int",
106
+ :args=>
107
+ [["const gsl_matrix *", "X"],
108
+ ["const gsl_vector *", "w"],
109
+ ["const gsl_vector *", "y"],
110
+ ["const double", "tol"],
111
+ ["gsl_vector *", "c"],
112
+ ["gsl_matrix *", "cov"],
113
+ ["double *", "chisq"],
114
+ ["size_t *", "rank"],
115
+ ["gsl_multifit_linear_workspace *", "work"]],
116
+ :desc=>
117
+ "This function computes the best-fit parameters c of the weighted\n" +
118
+ "model y = X c for the observations y with weights w\n" +
119
+ "and the matrix of predictor variables X, using a truncated SVD expansion.\n" +
120
+ "Singular values which satisfy s_i \\le tol \\times s_0\n" +
121
+ "are discarded from the fit, where s_0 is the largest singular value.\n" +
122
+ "The p-by-p covariance matrix of the model\n" +
123
+ "parameters cov is computed as (X^T W X)^{-1}. The weighted\n" +
124
+ "sum of squares of the residuals from the best-fit, \\chi^2, is\n" +
125
+ "returned in chisq. The effective rank of the system (number of\n" +
126
+ "singular values used in the solution) is returned in rank.\n" +
127
+ "If the coefficient of determination is\n" +
128
+ "desired, it can be computed from the expression R^2 = 1 - \\chi^2\n" +
129
+ "/ WTSS, where the weighted total sum of squares (WTSS) of the\n" +
130
+ "observations y may be computed from gsl_stats_wtss."},
131
+ {:func_name=>"gsl_multifit_linear_est",
132
+ :func_type=>"int",
133
+ :args=>
134
+ [["const gsl_vector *", "x"],
135
+ ["const gsl_vector *", "c"],
136
+ ["const gsl_matrix *", "cov"],
137
+ ["double *", "y"],
138
+ ["double *", "y_err"]],
139
+ :desc=>
140
+ "This function uses the best-fit multilinear regression coefficients\n" +
141
+ "c and their covariance matrix\n" +
142
+ "cov to compute the fitted function value\n" +
143
+ "y and its standard deviation y_err for the model y = x.c \n" +
144
+ "at the point x."},
145
+ {:func_name=>"gsl_multifit_linear_residuals",
146
+ :func_type=>"int",
147
+ :args=>
148
+ [["const gsl_matrix *", "X"],
149
+ ["const gsl_vector *", "y"],
150
+ ["const gsl_vector *", "c"],
151
+ ["gsl_vector *", "r"]],
152
+ :desc=>
153
+ "This function computes the vector of residuals r = y - X c for\n" +
154
+ "the observations y, coefficients c and matrix of predictor\n" +
155
+ "variables X."},
156
+ {:func_name=>"gsl_multifit_linear_rank",
157
+ :func_type=>"size_t",
158
+ :args=>
159
+ [["const double", "tol"],
160
+ ["const gsl_multifit_linear_workspace *", "work"]],
161
+ :desc=>
162
+ "This function returns the rank of the matrix X which must first have its\n" +
163
+ "singular value decomposition computed. The rank is computed by counting the number\n" +
164
+ "of singular values \\sigma_j which satisfy \\sigma_j > tol \\times \\sigma_0,\n" +
165
+ "where \\sigma_0 is the largest singular value."},
166
+ {:func_name=>"gsl_multifit_linear_stdform1",
167
+ :func_type=>"int",
168
+ :args=>
169
+ [["const gsl_vector *", "L"],
170
+ ["const gsl_matrix *", "X"],
171
+ ["const gsl_vector *", "y"],
172
+ ["gsl_matrix *", "Xs"],
173
+ ["gsl_vector *", "ys"],
174
+ ["gsl_multifit_linear_workspace *", "work"]],
175
+ :desc=>
176
+ "These functions define a regularization matrix\n" +
177
+ "L = diag(l_0,l_1,...,l_{p-1}).\n" +
178
+ "The diagonal matrix element l_i is provided by the\n" +
179
+ "ith element of the input vector L.\n" +
180
+ "The n-by-p least squares matrix X and\n" +
181
+ "vector y of length n are then\n" +
182
+ "converted to standard form as described above and the parameters\n" +
183
+ "(\\tilde{X},\\tilde{y}) are stored in Xs and ys\n" +
184
+ "on output. Xs and ys have the same dimensions as\n" +
185
+ "X and y. Optional data weights may be supplied in the\n" +
186
+ "vector w of length n. In order to apply this transformation,\n" +
187
+ "L^{-1} must exist and so none of the l_i\n" +
188
+ "may be zero. After the standard form system has been solved,\n" +
189
+ "use gsl_multifit_linear_genform1 to recover the original solution vector.\n" +
190
+ "It is allowed to have X = Xs and y = ys for an in-place transform.\n" +
191
+ "In order to perform a weighted regularized fit with L = I, the user may\n" +
192
+ "call gsl_multifit_linear_applyW to convert to standard form."},
193
+ {:func_name=>"gsl_multifit_linear_wstdform1",
194
+ :func_type=>"int",
195
+ :args=>
196
+ [["const gsl_vector *", "L"],
197
+ ["const gsl_matrix *", "X"],
198
+ ["const gsl_vector *", "w"],
199
+ ["const gsl_vector *", "y"],
200
+ ["gsl_matrix *", "Xs"],
201
+ ["gsl_vector *", "ys"],
202
+ ["gsl_multifit_linear_workspace *", "work"]],
203
+ :desc=>
204
+ "These functions define a regularization matrix\n" +
205
+ "L = diag(l_0,l_1,...,l_{p-1}).\n" +
206
+ "The diagonal matrix element l_i is provided by the\n" +
207
+ "ith element of the input vector L.\n" +
208
+ "The n-by-p least squares matrix X and\n" +
209
+ "vector y of length n are then\n" +
210
+ "converted to standard form as described above and the parameters\n" +
211
+ "(\\tilde{X},\\tilde{y}) are stored in Xs and ys\n" +
212
+ "on output. Xs and ys have the same dimensions as\n" +
213
+ "X and y. Optional data weights may be supplied in the\n" +
214
+ "vector w of length n. In order to apply this transformation,\n" +
215
+ "L^{-1} must exist and so none of the l_i\n" +
216
+ "may be zero. After the standard form system has been solved,\n" +
217
+ "use gsl_multifit_linear_genform1 to recover the original solution vector.\n" +
218
+ "It is allowed to have X = Xs and y = ys for an in-place transform.\n" +
219
+ "In order to perform a weighted regularized fit with L = I, the user may\n" +
220
+ "call gsl_multifit_linear_applyW to convert to standard form."},
221
+ {:func_name=>"gsl_multifit_linear_L_decomp",
222
+ :func_type=>"int",
223
+ :args=>[["gsl_matrix *", "L"], ["gsl_vector *", "tau"]],
224
+ :desc=>
225
+ "This function factors the m-by-p regularization matrix\n" +
226
+ "L into a form needed for the later transformation to standard form. L\n" +
227
+ "may have any number of rows m. If m \\ge p the QR decomposition of\n" +
228
+ "L is computed and stored in L on output. If m < p, the QR decomposition\n" +
229
+ "of L^T is computed and stored in L on output. On output,\n" +
230
+ "the Householder scalars are stored in the vector tau of size MIN(m,p).\n" +
231
+ "These outputs will be used by gsl_multifit_linear_wstdform2 to complete the\n" +
232
+ "transformation to standard form."},
233
+ {:func_name=>"gsl_multifit_linear_stdform2",
234
+ :func_type=>"int",
235
+ :args=>
236
+ [["const gsl_matrix *", "LQR"],
237
+ ["const gsl_vector *", "Ltau"],
238
+ ["const gsl_matrix *", "X"],
239
+ ["const gsl_vector *", "y"],
240
+ ["gsl_matrix *", "Xs"],
241
+ ["gsl_vector *", "ys"],
242
+ ["gsl_matrix *", "M"],
243
+ ["gsl_multifit_linear_workspace *", "work"]],
244
+ :desc=>
245
+ "These functions convert the least squares system (X,y,W,L) to standard\n" +
246
+ "form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
247
+ "respectively. The m-by-p regularization matrix L is specified by the inputs\n" +
248
+ "LQR and Ltau, which are outputs from gsl_multifit_linear_L_decomp.\n" +
249
+ "The dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
250
+ "depend on whether m is larger or less than p. For m \\ge p,\n" +
251
+ "Xs is n-by-p, ys is n-by-1, and M is\n" +
252
+ "not used. For m < p, Xs is (n - p + m)-by-m,\n" +
253
+ "ys is (n - p + m)-by-1, and M is additional n-by-p workspace,\n" +
254
+ "which is required to recover the original solution vector after the system has been\n" +
255
+ "solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
256
+ "vector w of length n, where W = diag(w)."},
257
+ {:func_name=>"gsl_multifit_linear_wstdform2",
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 *", "w"],
264
+ ["const gsl_vector *", "y"],
265
+ ["gsl_matrix *", "Xs"],
266
+ ["gsl_vector *", "ys"],
267
+ ["gsl_matrix *", "M"],
268
+ ["gsl_multifit_linear_workspace *", "work"]],
269
+ :desc=>
270
+ "These functions convert the least squares system (X,y,W,L) to standard\n" +
271
+ "form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
272
+ "respectively. The m-by-p regularization matrix L is specified by the inputs\n" +
273
+ "LQR and Ltau, which are outputs from gsl_multifit_linear_L_decomp.\n" +
274
+ "The dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
275
+ "depend on whether m is larger or less than p. For m \\ge p,\n" +
276
+ "Xs is n-by-p, ys is n-by-1, and M is\n" +
277
+ "not used. For m < p, Xs is (n - p + m)-by-m,\n" +
278
+ "ys is (n - p + m)-by-1, and M is additional n-by-p workspace,\n" +
279
+ "which is required to recover the original solution vector after the system has been\n" +
280
+ "solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
281
+ "vector w of length n, where W = diag(w)."},
282
+ {:func_name=>"gsl_multifit_linear_solve",
283
+ :func_type=>"int",
284
+ :args=>
285
+ [["const double", "lambda"],
286
+ ["const gsl_matrix *", "Xs"],
287
+ ["const gsl_vector *", "ys"],
288
+ ["gsl_vector *", "cs"],
289
+ ["double *", "rnorm"],
290
+ ["double *", "snorm"],
291
+ ["gsl_multifit_linear_workspace *", "work"]],
292
+ :desc=>
293
+ "This function computes the regularized best-fit parameters \\tilde{c}\n" +
294
+ "which minimize the cost function\n" +
295
+ "\\chi^2 = || \\tilde{y} - \\tilde{X} \\tilde{c} ||^2 + \\lambda^2 || \\tilde{c} ||^2 which is\n" +
296
+ "in standard form. The least squares system must therefore be converted\n" +
297
+ "to standard form prior to calling this function.\n" +
298
+ "The observation vector \\tilde{y} is provided in ys and the matrix of\n" +
299
+ "predictor variables \\tilde{X} in Xs. The solution vector \\tilde{c} is\n" +
300
+ "returned in cs, which has length min(m,p). The SVD of Xs must be computed prior\n" +
301
+ "to calling this function, using gsl_multifit_linear_svd.\n" +
302
+ "The regularization parameter \\lambda is provided in lambda.\n" +
303
+ "The residual norm || \\tilde{y} - \\tilde{X} \\tilde{c} || = ||y - X c||_W is returned in rnorm.\n" +
304
+ "The solution norm || \\tilde{c} || = ||L c|| is returned in\n" +
305
+ "snorm."},
306
+ {:func_name=>"gsl_multifit_linear_genform1",
307
+ :func_type=>"int",
308
+ :args=>
309
+ [["const gsl_vector *", "L"],
310
+ ["const gsl_vector *", "cs"],
311
+ ["gsl_vector *", "c"],
312
+ ["gsl_multifit_linear_workspace *", "work"]],
313
+ :desc=>
314
+ "After a regularized system has been solved with\n" +
315
+ "L = diag(\\l_0,\\l_1,...,\\l_{p-1}),\n" +
316
+ "this function backtransforms the standard form solution vector cs\n" +
317
+ "to recover the solution vector of the original problem c. The\n" +
318
+ "diagonal matrix elements l_i are provided in\n" +
319
+ "the vector L. It is allowed to have c = cs for an\n" +
320
+ "in-place transform."},
321
+ {:func_name=>"gsl_multifit_linear_genform2",
322
+ :func_type=>"int",
323
+ :args=>
324
+ [["const gsl_matrix *", "LQR"],
325
+ ["const gsl_vector *", "Ltau"],
326
+ ["const gsl_matrix *", "X"],
327
+ ["const gsl_vector *", "y"],
328
+ ["const gsl_vector *", "cs"],
329
+ ["const gsl_matrix *", "M"],
330
+ ["gsl_vector *", "c"],
331
+ ["gsl_multifit_linear_workspace *", "work"]],
332
+ :desc=>
333
+ "After a regularized system has been solved with a general rectangular matrix L,\n" +
334
+ "specified by (LQR,Ltau), this function backtransforms the standard form solution cs\n" +
335
+ "to recover the solution vector of the original problem, which is stored in c,\n" +
336
+ "of length p. The original least squares matrix and observation vector are provided in\n" +
337
+ "X and y respectively. M is the matrix computed by\n" +
338
+ "gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
339
+ "w must also be supplied."},
340
+ {:func_name=>"gsl_multifit_linear_wgenform2",
341
+ :func_type=>"int",
342
+ :args=>
343
+ [["const gsl_matrix *", "LQR"],
344
+ ["const gsl_vector *", "Ltau"],
345
+ ["const gsl_matrix *", "X"],
346
+ ["const gsl_vector *", "w"],
347
+ ["const gsl_vector *", "y"],
348
+ ["const gsl_vector *", "cs"],
349
+ ["const gsl_matrix *", "M"],
350
+ ["gsl_vector *", "c"],
351
+ ["gsl_multifit_linear_workspace *", "work"]],
352
+ :desc=>
353
+ "After a regularized system has been solved with a general rectangular matrix L,\n" +
354
+ "specified by (LQR,Ltau), this function backtransforms the standard form solution cs\n" +
355
+ "to recover the solution vector of the original problem, which is stored in c,\n" +
356
+ "of length p. The original least squares matrix and observation vector are provided in\n" +
357
+ "X and y respectively. M is the matrix computed by\n" +
358
+ "gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
359
+ "w must also be supplied."},
360
+ {:func_name=>"gsl_multifit_linear_applyW",
361
+ :func_type=>"int",
362
+ :args=>
363
+ [["const gsl_matrix *", "X"],
364
+ ["const gsl_vector *", "w"],
365
+ ["const gsl_vector *", "y"],
366
+ ["gsl_matrix *", "WX"],
367
+ ["gsl_vector *", "Wy"]],
368
+ :desc=>
369
+ "For weighted least squares systems with L = I, this function may be used to\n" +
370
+ "convert the system to standard form by applying the weight matrix W = diag(w)\n" +
371
+ "to the least squares matrix X and observation vector y. On output, WX\n" +
372
+ "is equal to W^{1/2} X and Wy is equal to W^{1/2} y. It is allowed\n" +
373
+ "for WX = X and Wy = y for an in-place transform."},
374
+ {:func_name=>"gsl_multifit_linear_lcurve",
375
+ :func_type=>"int",
376
+ :args=>
377
+ [["const gsl_vector *", "y"],
378
+ ["gsl_vector *", "reg_param"],
379
+ ["gsl_vector *", "rho"],
380
+ ["gsl_vector *", "eta"],
381
+ ["gsl_multifit_linear_workspace *", "work"]],
382
+ :desc=>
383
+ "This function computes the L-curve for a least squares system\n" +
384
+ "using the right hand side vector y and the SVD decomposition\n" +
385
+ "of the least squares matrix X, which must be provided\n" +
386
+ "to gsl_multifit_linear_svd prior to\n" +
387
+ "calling this function. The output vectors reg_param,\n" +
388
+ "rho, and eta must all be the same size, and will\n" +
389
+ "contain the regularization parameters \\lambda_i, residual norms\n" +
390
+ "||y - X c_i||, and solution norms || L c_i ||\n" +
391
+ "which compose the L-curve, where c_i is the regularized\n" +
392
+ "solution vector corresponding to \\lambda_i.\n" +
393
+ "The user may determine the number of points on the L-curve by\n" +
394
+ "adjusting the size of these input arrays. The regularization\n" +
395
+ "parameters \\lambda_i are estimated from the singular values\n" +
396
+ "of X, and chosen to represent the most relevant portion of\n" +
397
+ "the L-curve."},
398
+ {:func_name=>"gsl_multifit_linear_lcorner",
399
+ :func_type=>"int",
400
+ :args=>
401
+ [["const gsl_vector *", "rho"],
402
+ ["const gsl_vector *", "eta"],
403
+ ["size_t *", "idx"]],
404
+ :desc=>
405
+ "This function attempts to locate the corner of the L-curve\n" +
406
+ "(||y - X c||, ||L c||) defined by the rho and eta\n" +
407
+ "input arrays respectively. The corner is defined as the point of maximum\n" +
408
+ "curvature of the L-curve in log-log scale. The rho and eta\n" +
409
+ "arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
410
+ "algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
411
+ "and uses the circle's radius to determine the curvature at\n" +
412
+ "the middle point. Therefore, the input array sizes must be\n" +
413
+ "\\ge 3. With more points provided for the L-curve, a better\n" +
414
+ "estimate of the curvature can be obtained. The array index\n" +
415
+ "corresponding to maximum curvature (ie: the corner) is returned\n" +
416
+ "in idx. If the input arrays contain colinear points,\n" +
417
+ "this function could fail and return GSL_EINVAL."},
418
+ {:func_name=>"gsl_multifit_linear_lcorner2",
419
+ :func_type=>"int",
420
+ :args=>
421
+ [["const gsl_vector *", "reg_param"],
422
+ ["const gsl_vector *", "eta"],
423
+ ["size_t *", "idx"]],
424
+ :desc=>
425
+ "This function attempts to locate the corner of an alternate L-curve\n" +
426
+ "(\\lambda^2, ||L c||^2) studied by Rezghi and Hosseini, 2009.\n" +
427
+ "This alternate L-curve can provide better estimates of the\n" +
428
+ "regularization parameter for smooth solution vectors. The regularization\n" +
429
+ "parameters \\lambda and solution norms ||L c|| are provided\n" +
430
+ "in the reg_param and eta input arrays respectively. The\n" +
431
+ "corner is defined as the point of maximum curvature of this\n" +
432
+ "alternate L-curve in linear scale. The reg_param and eta\n" +
433
+ "arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
434
+ "algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
435
+ "and uses the circle's radius to determine the curvature at\n" +
436
+ "the middle point. Therefore, the input array sizes must be\n" +
437
+ "\\ge 3. With more points provided for the L-curve, a better\n" +
438
+ "estimate of the curvature can be obtained. The array index\n" +
439
+ "corresponding to maximum curvature (ie: the corner) is returned\n" +
440
+ "in idx. If the input arrays contain colinear points,\n" +
441
+ "this function could fail and return GSL_EINVAL."},
442
+ {:func_name=>"gsl_multifit_linear_gcv_init",
443
+ :func_type=>"int",
444
+ :args=>
445
+ [["const gsl_vector *", "y"],
446
+ ["gsl_vector *", "reg_param"],
447
+ ["gsl_vector *", "UTy"],
448
+ ["double *", "delta0"],
449
+ ["gsl_multifit_linear_workspace *", "work"]],
450
+ :desc=>
451
+ "This function performs some initialization in preparation for computing\n" +
452
+ "the GCV curve and its minimum. The right hand side vector is provided\n" +
453
+ "in y. On output, reg_param is set to a vector of regularization\n" +
454
+ "parameters in decreasing order and may be of any size. The vector\n" +
455
+ "UTy of size p is set to U^T y. The parameter\n" +
456
+ "delta0 is needed for subsequent steps of the GCV calculation."},
457
+ {:func_name=>"gsl_multifit_linear_gcv_curve",
458
+ :func_type=>"int",
459
+ :args=>
460
+ [["const gsl_vector *", "reg_param"],
461
+ ["const gsl_vector *", "UTy"],
462
+ ["const double", "delta0"],
463
+ ["gsl_vector *", "G"],
464
+ ["gsl_multifit_linear_workspace *", "work"]],
465
+ :desc=>
466
+ "This funtion calculates the GCV curve G(\\lambda) and stores it in\n" +
467
+ "G on output, which must be the same size as reg_param. The\n" +
468
+ "inputs reg_param, UTy and delta0 are computed in\n" +
469
+ "gsl_multifit_linear_gcv_init."},
470
+ {:func_name=>"gsl_multifit_linear_gcv_min",
471
+ :func_type=>"int",
472
+ :args=>
473
+ [["const gsl_vector *", "reg_param"],
474
+ ["const gsl_vector *", "UTy"],
475
+ ["const gsl_vector *", "G"],
476
+ ["const double", "delta0"],
477
+ ["double *", "lambda"],
478
+ ["gsl_multifit_linear_workspace *", "work"]],
479
+ :desc=>
480
+ "This function computes the value of the regularization parameter\n" +
481
+ "which minimizes the GCV curve G(\\lambda) and stores it in\n" +
482
+ "lambda. The input G is calculated by\n" +
483
+ "gsl_multifit_linear_gcv_curve and the inputs\n" +
484
+ "reg_param, UTy and delta0 are computed by\n" +
485
+ "gsl_multifit_linear_gcv_init."},
486
+ {:func_name=>"gsl_multifit_linear_gcv_calc",
487
+ :func_type=>"double",
488
+ :args=>
489
+ [["const double", "lambda"],
490
+ ["const gsl_vector *", "UTy"],
491
+ ["const double", "delta0"],
492
+ ["gsl_multifit_linear_workspace *", "work"]],
493
+ :desc=>
494
+ "This function returns the value of the GCV curve G(\\lambda) corresponding\n" +
495
+ "to the input lambda."},
496
+ {:func_name=>"gsl_multifit_linear_gcv",
497
+ :func_type=>"int",
498
+ :args=>
499
+ [["const gsl_vector *", "y"],
500
+ ["gsl_vector *", "reg_param"],
501
+ ["gsl_vector *", "G"],
502
+ ["double *", "lambda"],
503
+ ["double *", "G_lambda"],
504
+ ["gsl_multifit_linear_workspace *", "work"]],
505
+ :desc=>
506
+ "This function combines the steps gcv_init, gcv_curve,\n" +
507
+ "and gcv_min defined above into a single function. The input\n" +
508
+ "y is the right hand side vector. On output, reg_param and\n" +
509
+ "G, which must be the same size, are set to vectors of\n" +
510
+ "\\lambda and G(\\lambda) values respectively. The\n" +
511
+ "output lambda is set to the optimal value of \\lambda\n" +
512
+ "which minimizes the GCV curve. The minimum value of the GCV curve is\n" +
513
+ "returned in G_lambda."},
514
+ {:func_name=>"gsl_multifit_linear_Lk",
515
+ :func_type=>"int",
516
+ :args=>[["const size_t", "p"], ["const size_t", "k"], ["gsl_matrix *", "L"]],
517
+ :desc=>
518
+ "This function computes the discrete approximation to the derivative operator L_k of\n" +
519
+ "order k on a regular grid of p points and stores it in L. The dimensions of L are\n" +
520
+ "(p-k)-by-p."},
521
+ {:func_name=>"gsl_multifit_linear_Lsobolev",
522
+ :func_type=>"int",
523
+ :args=>
524
+ [["const size_t", "p"],
525
+ ["const size_t", "kmax"],
526
+ ["const gsl_vector *", "alpha"],
527
+ ["gsl_matrix *", "L"],
528
+ ["gsl_multifit_linear_workspace *", "work"]],
529
+ :desc=>
530
+ "This function computes the regularization matrix L corresponding to the weighted Sobolov norm\n" +
531
+ "||L c||^2 = \\sum_k \\alpha_k^2 ||L_k c||^2 where L_k approximates the derivative\n" +
532
+ "operator of order k. This regularization norm can be useful in applications where\n" +
533
+ "it is necessary to smooth several derivatives of the solution. p is the number of\n" +
534
+ "model parameters, kmax is the highest derivative to include in the summation above, and\n" +
535
+ "alpha is the vector of weights of size kmax + 1, where alpha[k] = \\alpha_k\n" +
536
+ "is the weight assigned to the derivative of order k. The output matrix L is size\n" +
537
+ "p-by-p and upper triangular."},
538
+ {:func_name=>"gsl_multifit_linear_rcond",
539
+ :func_type=>"double",
540
+ :args=>[["const gsl_multifit_linear_workspace *", "work"]],
541
+ :desc=>
542
+ "This function returns the reciprocal condition number of the least squares matrix X,\n" +
543
+ "defined as the ratio of the smallest and largest singular values, rcond = \\sigma_{min}/\\sigma_{max}.\n" +
544
+ "The routine gsl_multifit_linear_svd must first be called to compute the SVD of X."},
545
+ {:func_name=>"gsl_multifit_robust_alloc",
546
+ :func_type=>"gsl_multifit_robust_workspace *",
547
+ :args=>
548
+ [["const gsl_multifit_robust_type *", "T"],
549
+ ["const size_t", "n"],
550
+ ["const size_t", "p"]],
551
+ :desc=>
552
+ "This function allocates a workspace for fitting a model to n\n" +
553
+ "observations using p parameters. The size of the workspace\n" +
554
+ "is O(np + p^2). The type T specifies the\n" +
555
+ "function \\psi and can be selected from the following choices.\n" +
556
+ "\n" +
557
+ "\n" +
558
+ "\n" +
559
+ "\n" +
560
+ "\n"},
561
+ {:func_name=>"gsl_multifit_robust_free",
562
+ :func_type=>"void",
563
+ :args=>[["gsl_multifit_robust_workspace *", "w"]],
564
+ :desc=>"This function frees the memory associated with the workspace w."},
565
+ {:func_name=>"gsl_multifit_robust_name",
566
+ :func_type=>"const char *",
567
+ :args=>[["const gsl_multifit_robust_workspace *", "w"]],
568
+ :desc=>
569
+ "This function returns the name of the robust type T specified to gsl_multifit_robust_alloc."},
570
+ {:func_name=>"gsl_multifit_robust_tune",
571
+ :func_type=>"int",
572
+ :args=>[["const double", "tune"], ["gsl_multifit_robust_workspace *", "w"]],
573
+ :desc=>
574
+ "This function sets the tuning constant t used to adjust the residuals at each iteration to tune.\n" +
575
+ "Decreasing the tuning constant increases the downweight assigned to large residuals, while increasing\n" +
576
+ "the tuning constant decreases the downweight assigned to large residuals."},
577
+ {:func_name=>"gsl_multifit_robust_maxiter",
578
+ :func_type=>"int",
579
+ :args=>
580
+ [["const size_t", "maxiter"], ["gsl_multifit_robust_workspace *", "w"]],
581
+ :desc=>
582
+ "This function sets the maximum number of iterations in the iteratively\n" +
583
+ "reweighted least squares algorithm to maxiter. By default,\n" +
584
+ "this value is set to 100 by gsl_multifit_robust_alloc."},
585
+ {:func_name=>"gsl_multifit_robust_weights",
586
+ :func_type=>"int",
587
+ :args=>
588
+ [["const gsl_vector *", "r"],
589
+ ["gsl_vector *", "wts"],
590
+ ["gsl_multifit_robust_workspace *", "w"]],
591
+ :desc=>
592
+ "This function assigns weights to the vector wts using the residual vector r and\n" +
593
+ "previously specified weighting function. The output weights are given by wts_i = w(r_i / (t \\sigma)),\n" +
594
+ "where the weighting functions w are detailed in gsl_multifit_robust_alloc. \\sigma\n" +
595
+ "is an estimate of the residual standard deviation based on the Median-Absolute-Deviation and t\n" +
596
+ "is the tuning constant. This\n" +
597
+ "function is useful if the user wishes to implement their own robust regression rather than using\n" +
598
+ "the supplied gsl_multifit_robust routine below."},
599
+ {:func_name=>"gsl_multifit_robust",
600
+ :func_type=>"int",
601
+ :args=>
602
+ [["const gsl_matrix *", "X"],
603
+ ["const gsl_vector *", "y"],
604
+ ["gsl_vector *", "c"],
605
+ ["gsl_matrix *", "cov"],
606
+ ["gsl_multifit_robust_workspace *", "w"]],
607
+ :desc=>
608
+ "This function computes the best-fit parameters c of the model\n" +
609
+ "y = X c for the observations y and the matrix of\n" +
610
+ "predictor variables X, attemping to reduce the influence\n" +
611
+ "of outliers using the algorithm outlined above.\n" +
612
+ "The p-by-p variance-covariance matrix of the model parameters\n" +
613
+ "cov is estimated as \\sigma^2 (X^T X)^{-1}, where \\sigma is\n" +
614
+ "an approximation of the residual standard deviation using the theory of robust\n" +
615
+ "regression. Special care must be taken when estimating \\sigma and\n" +
616
+ "other statistics such as R^2, and so these\n" +
617
+ "are computed internally and are available by calling the function\n" +
618
+ "gsl_multifit_robust_statistics.\n" +
619
+ "\n" +
620
+ "If the coefficients do not converge within the maximum iteration\n" +
621
+ "limit, the function returns GSL_EMAXITER. In this case,\n" +
622
+ "the current estimates of the coefficients and covariance matrix\n" +
623
+ "are returned in c and cov and the internal fit statistics\n" +
624
+ "are computed with these estimates."},
625
+ {:func_name=>"gsl_multifit_robust_est",
626
+ :func_type=>"int",
627
+ :args=>
628
+ [["const gsl_vector *", "x"],
629
+ ["const gsl_vector *", "c"],
630
+ ["const gsl_matrix *", "cov"],
631
+ ["double *", "y"],
632
+ ["double *", "y_err"]],
633
+ :desc=>
634
+ "This function uses the best-fit robust regression coefficients\n" +
635
+ "c and their covariance matrix\n" +
636
+ "cov to compute the fitted function value\n" +
637
+ "y and its standard deviation y_err for the model y = x.c \n" +
638
+ "at the point x."},
639
+ {:func_name=>"gsl_multifit_robust_residuals",
640
+ :func_type=>"int",
641
+ :args=>
642
+ [["const gsl_matrix *", "X"],
643
+ ["const gsl_vector *", "y"],
644
+ ["const gsl_vector *", "c"],
645
+ ["gsl_vector *", "r"],
646
+ ["gsl_multifit_robust_workspace *", "w"]],
647
+ :desc=>
648
+ "This function computes the vector of studentized residuals\n" +
649
+ "r_i = {y_i - (X c)_i \\over \\sigma \\sqrt{1 - h_i}} for\n" +
650
+ "the observations y, coefficients c and matrix of predictor\n" +
651
+ "variables X. The routine gsl_multifit_robust must\n" +
652
+ "first be called to compute the statisical leverages h_i of\n" +
653
+ "the matrix X and residual standard deviation estimate \\sigma."},
654
+ {:func_name=>"gsl_multifit_robust_statistics",
655
+ :func_type=>"gsl_multifit_robust_stats",
656
+ :args=>[["const gsl_multifit_robust_workspace *", "w"]],
657
+ :desc=>
658
+ "This function returns a structure containing relevant statistics from a robust regression. The function\n" +
659
+ "gsl_multifit_robust must be called first to perform the regression and calculate these statistics.\n" +
660
+ "The returned gsl_multifit_robust_stats structure contains the following fields."},
661
+ {:func_name=>"gsl_multifit_nlinear_alloc",
662
+ :func_type=>"gsl_multifit_nlinear_workspace *",
663
+ :args=>
664
+ [["const gsl_multifit_nlinear_type *", "T"],
665
+ ["const gsl_multifit_nlinear_parameters *", "params"],
666
+ ["const size_t", "n"],
667
+ ["const size_t", "p"]],
668
+ :desc=>
669
+ "These functions return a pointer to a newly allocated instance of a\n" +
670
+ "derivative solver of type T for n observations and p\n" +
671
+ "parameters. The params input specifies a tunable set of\n" +
672
+ "parameters which will affect important details in each iteration\n" +
673
+ "of the trust region subproblem algorithm. It is recommended to start\n" +
674
+ "with the suggested default parameters (see\n" +
675
+ "gsl_multifit_nlinear_default_parameters and\n" +
676
+ "gsl_multilarge_nlinear_default_parameters) and then tune\n" +
677
+ "the parameters once the code is working correctly. See\n" +
678
+ "Nonlinear Least-Squares Tunable Parameters\n" +
679
+ "for descriptions of the various parameters.\n" +
680
+ "For example, the following code creates an instance of a\n" +
681
+ "Levenberg-Marquardt solver for 100 data points and 3 parameters,\n" +
682
+ "using suggested defaults:\n" +
683
+ "\n" +
684
+ "const gsl_multifit_nlinear_type * T \n" +
685
+ " = gsl_multifit_nlinear_lm;\n" +
686
+ "gsl_multifit_nlinear_parameters params\n" +
687
+ " = gsl_multifit_nlinear_default_parameters();\n" +
688
+ "gsl_multifit_nlinear_workspace * w \n" +
689
+ " = gsl_multifit_nlinear_alloc (T, &params, 100, 3);\n" +
690
+ "\n" +
691
+ "The number of observations n must be greater than or equal to\n" +
692
+ "parameters p.\n" +
693
+ "\n" +
694
+ "If there is insufficient memory to create the solver then the function\n" +
695
+ "returns a null pointer and the error handler is invoked with an error\n" +
696
+ "code of GSL_ENOMEM."},
697
+ {:func_name=>"gsl_multifit_nlinear_default_parameters",
698
+ :func_type=>"gsl_multifit_nlinear_parameters",
699
+ :args=>[["", "void"]],
700
+ :desc=>
701
+ "These functions return a set of recommended default parameters\n" +
702
+ "for use in solving nonlinear least squares problems. The user\n" +
703
+ "can tune each parameter to improve the performance on their\n" +
704
+ "particular problem, see\n" +
705
+ "Nonlinear Least-Squares Tunable Parameters."},
706
+ {:func_name=>"gsl_multifit_nlinear_init",
707
+ :func_type=>"int",
708
+ :args=>
709
+ [["const gsl_vector *", "x"],
710
+ ["gsl_multifit_nlinear_fdf *", "fdf"],
711
+ ["gsl_multifit_nlinear_workspace *", "w"]],
712
+ :desc=>
713
+ "These functions initialize, or reinitialize, an existing workspace w\n" +
714
+ "to use the system fdf and the initial guess\n" +
715
+ "x. See Nonlinear Least-Squares Function Definition\n" +
716
+ "for a description of the fdf structure.\n" +
717
+ "\n" +
718
+ "Optionally, a weight vector wts can be given to perform\n" +
719
+ "a weighted nonlinear regression. Here, the weighting matrix is\n" +
720
+ "W = diag(w_1,w_2,...,w_n)."},
721
+ {:func_name=>"gsl_multifit_nlinear_winit",
722
+ :func_type=>"int",
723
+ :args=>
724
+ [["const gsl_vector *", "x"],
725
+ ["const gsl_vector *", "wts"],
726
+ ["gsl_multifit_nlinear_fdf *", "fdf"],
727
+ ["gsl_multifit_nlinear_workspace *", "w"]],
728
+ :desc=>
729
+ "These functions initialize, or reinitialize, an existing workspace w\n" +
730
+ "to use the system fdf and the initial guess\n" +
731
+ "x. See Nonlinear Least-Squares Function Definition\n" +
732
+ "for a description of the fdf structure.\n" +
733
+ "\n" +
734
+ "Optionally, a weight vector wts can be given to perform\n" +
735
+ "a weighted nonlinear regression. Here, the weighting matrix is\n" +
736
+ "W = diag(w_1,w_2,...,w_n)."},
737
+ {:func_name=>"gsl_multifit_nlinear_free",
738
+ :func_type=>"void",
739
+ :args=>[["gsl_multifit_nlinear_workspace *", "w"]],
740
+ :desc=>
741
+ "These functions free all the memory associated with the workspace w."},
742
+ {:func_name=>"gsl_multifit_nlinear_name",
743
+ :func_type=>"const char *",
744
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
745
+ :desc=>
746
+ "These functions return a pointer to the name of the solver. For example,\n" +
747
+ "\n" +
748
+ "printf (\"w is a '%s' solver\\n\", \n" +
749
+ " gsl_multifit_nlinear_name (w));\n" +
750
+ "\n" +
751
+ "would print something like w is a 'trust-region' solver."},
752
+ {:func_name=>"gsl_multifit_nlinear_trs_name",
753
+ :func_type=>"const char *",
754
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
755
+ :desc=>
756
+ "These functions return a pointer to the name of the trust region subproblem\n" +
757
+ "method. For example,\n" +
758
+ "\n" +
759
+ "printf (\"w is a '%s' solver\\n\", \n" +
760
+ " gsl_multifit_nlinear_trs_name (w));\n" +
761
+ "\n" +
762
+ "would print something like w is a 'levenberg-marquardt' solver."},
763
+ {:func_name=>"gsl_multifit_nlinear_iterate",
764
+ :func_type=>"int",
765
+ :args=>[["gsl_multifit_nlinear_workspace *", "w"]],
766
+ :desc=>
767
+ "These functions perform a single iteration of the solver w. If\n" +
768
+ "the iteration encounters an unexpected problem then an error code will\n" +
769
+ "be returned. The solver workspace maintains a current estimate of the\n" +
770
+ "best-fit parameters at all times."},
771
+ {:func_name=>"gsl_multifit_nlinear_position",
772
+ :func_type=>"gsl_vector *",
773
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
774
+ :desc=>
775
+ "These functions return the current position x (i.e. best-fit\n" +
776
+ "parameters) of the solver w."},
777
+ {:func_name=>"gsl_multifit_nlinear_residual",
778
+ :func_type=>"gsl_vector *",
779
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
780
+ :desc=>
781
+ "These functions return the current residual vector f(x) of the\n" +
782
+ "solver w. For weighted systems, the residual vector includes the\n" +
783
+ "weighting factor \\sqrt{W}."},
784
+ {:func_name=>"gsl_multifit_nlinear_jac",
785
+ :func_type=>"gsl_matrix *",
786
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
787
+ :desc=>
788
+ "This function returns a pointer to the n-by-p Jacobian matrix for the\n" +
789
+ "current iteration of the solver w. This function is available only for the\n" +
790
+ "gsl_multifit_nlinear interface."},
791
+ {:func_name=>"gsl_multifit_nlinear_niter",
792
+ :func_type=>"size_t",
793
+ :args=>[["const gsl_multifit_nlinear_workspace *", "w"]],
794
+ :desc=>
795
+ "These functions return the number of iterations performed so far.\n" +
796
+ "The iteration counter is updated on each call to the\n" +
797
+ "_iterate functions above, and reset to 0 in the\n" +
798
+ "_init functions."},
799
+ {:func_name=>"gsl_multifit_nlinear_rcond",
800
+ :func_type=>"int",
801
+ :args=>
802
+ [["double *", "rcond"], ["const gsl_multifit_nlinear_workspace *", "w"]],
803
+ :desc=>
804
+ "This function estimates the reciprocal condition number\n" +
805
+ "of the Jacobian matrix at the current position x and\n" +
806
+ "stores it in rcond. The computed value is only an estimate\n" +
807
+ "to give the user a guideline as to the conditioning of their particular\n" +
808
+ "problem. Its calculation is based on which factorization\n" +
809
+ "method is used (Cholesky, QR, or SVD). \n"},
810
+ {:func_name=>"gsl_multifit_nlinear_test",
811
+ :func_type=>"int",
812
+ :args=>
813
+ [["const double", "xtol"],
814
+ ["const double", "gtol"],
815
+ ["const double", "ftol"],
816
+ ["int *", "info"],
817
+ ["const gsl_multifit_nlinear_workspace *", "w"]],
818
+ :desc=>
819
+ "These functions test for convergence of the minimization method\n" +
820
+ "using the following criteria:\n" +
821
+ "\n" +
822
+ "\n" +
823
+ "If none of the tests succeed, info is set to 0 and the\n" +
824
+ "function returns GSL_CONTINUE, indicating further iterations\n" +
825
+ "are required.\n"},
826
+ {:func_name=>"gsl_multifit_nlinear_covar",
827
+ :func_type=>"int",
828
+ :args=>
829
+ [["const gsl_matrix *", "J"],
830
+ ["const double", "epsrel"],
831
+ ["gsl_matrix *", "covar"]],
832
+ :desc=>
833
+ "This function computes the covariance matrix of best-fit parameters\n" +
834
+ "using the Jacobian matrix J and stores it in covar.\n" +
835
+ "The parameter epsrel is used to remove linear-dependent columns\n" +
836
+ "when J is rank deficient.\n" +
837
+ "\n" +
838
+ "The covariance matrix is given by,\n" +
839
+ "\n" +
840
+ "covar = (J^T J)^@{-1@}\n" +
841
+ "\n" +
842
+ "or in the weighted case,\n" +
843
+ "\n" +
844
+ "covar = (J^T W J)^@{-1@}\n" +
845
+ "\n" +
846
+ "and is computed using the factored form of the Jacobian (Cholesky, QR, or SVD).\n" +
847
+ "Any columns of R which satisfy \n" +
848
+ "\n" +
849
+ "|R_@{kk@}| <= epsrel |R_@{11@}|\n" +
850
+ "\n" +
851
+ "are considered linearly-dependent and are excluded from the covariance\n" +
852
+ "matrix (the corresponding rows and columns of the covariance matrix are\n" +
853
+ "set to zero).\n" +
854
+ "\n" +
855
+ "If the minimisation uses the weighted least-squares function\n" +
856
+ "f_i = (Y(x, t_i) - y_i) / \\sigma_i then the covariance\n" +
857
+ "matrix above gives the statistical error on the best-fit parameters\n" +
858
+ "resulting from the Gaussian errors \\sigma_i on \n" +
859
+ "the underlying data y_i. This can be verified from the relation \n" +
860
+ "\\delta f = J \\delta c and the fact that the fluctuations in f\n" +
861
+ "from the data y_i are normalised by \\sigma_i and \n" +
862
+ "so satisfy $\\langle \\delta f \\delta f^T \\rangle = I$\n" +
863
+ "<\\delta f \\delta f^T> = I.\n" +
864
+ "\n" +
865
+ "For an unweighted least-squares function f_i = (Y(x, t_i) -\n" +
866
+ "y_i) the covariance matrix above should be multiplied by the variance\n" +
867
+ "of the residuals about the best-fit \\sigma^2 = \\sum (y_i - Y(x,t_i))^2 / (n-p)\n" +
868
+ "to give the variance-covariance\n" +
869
+ "matrix \\sigma^2 C. This estimates the statistical error on the\n" +
870
+ "best-fit parameters from the scatter of the underlying data.\n" +
871
+ "\n" +
872
+ "For more information about covariance matrices see Fitting Overview."}]