numo-gsl 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/README.md +84 -0
- data/Rakefile +16 -0
- data/ext/numo/gsl/cdf/depend +17 -0
- data/ext/numo/gsl/cdf/erbpp_cdf.rb +44 -0
- data/ext/numo/gsl/cdf/extconf.rb +9 -0
- data/ext/numo/gsl/cdf/func_def.rb +610 -0
- data/ext/numo/gsl/const/const_def.rb +419 -0
- data/ext/numo/gsl/const/depend +17 -0
- data/ext/numo/gsl/const/erbpp_const.rb +30 -0
- data/ext/numo/gsl/const/extconf.rb +9 -0
- data/ext/numo/gsl/err/depend +1 -0
- data/ext/numo/gsl/err/err.c +22 -0
- data/ext/numo/gsl/err/extconf.rb +9 -0
- data/ext/numo/gsl/extconf_gsl.rb +44 -0
- data/ext/numo/gsl/fit/depend +17 -0
- data/ext/numo/gsl/fit/erbpp_fit.rb +74 -0
- data/ext/numo/gsl/fit/extconf.rb +9 -0
- data/ext/numo/gsl/fit/func_def.rb +129 -0
- data/ext/numo/gsl/fit/tmpl/check_1d.c +9 -0
- data/ext/numo/gsl/fit/tmpl/fit_linear.c +53 -0
- data/ext/numo/gsl/fit/tmpl/fit_linear_est.c +56 -0
- data/ext/numo/gsl/fit/tmpl/fit_mul.c +50 -0
- data/ext/numo/gsl/fit/tmpl/fit_mul_est.c +47 -0
- data/ext/numo/gsl/fit/tmpl/fit_wlinear.c +59 -0
- data/ext/numo/gsl/fit/tmpl/fit_wmul.c +56 -0
- data/ext/numo/gsl/gen/erbpp2.rb +306 -0
- data/ext/numo/gsl/gen/erbpp_gsl.rb +166 -0
- data/ext/numo/gsl/gen/func_parser.rb +520 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_DFloat.c +40 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ.c +41 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ_x2.c +44 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_x2_f_DFloat_x2.c +45 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_double.c +16 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_sizet.c +16 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_sizet_x2.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_double_x2_f_void.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_new_DFloat.c +29 -0
- data/ext/numo/gsl/gen/tmpl/c_new_double.c +22 -0
- data/ext/numo/gsl/gen/tmpl/c_new_f_other.c +25 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet.c +22 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet_double.c +23 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet_x2.c +23 -0
- data/ext/numo/gsl/gen/tmpl/c_new_void.c +21 -0
- data/ext/numo/gsl/gen/tmpl/c_other_f_void.c +19 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat.c +46 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x2.c +41 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x3.c +44 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x4.c +47 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_SZ_x2_DFloat.c +45 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_double.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_other.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_sizet.c +21 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_void.c +14 -0
- data/ext/numo/gsl/gen/tmpl/c_sizet_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_sizet_x2_f_void.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_str_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_super_new_void.c +18 -0
- data/ext/numo/gsl/gen/tmpl/c_uint_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_ulong_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double_x2.c +18 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double_x4.c +20 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_ulong.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_void.c +14 -0
- data/ext/numo/gsl/gen/tmpl/cast_1d_contiguous.c +15 -0
- data/ext/numo/gsl/gen/tmpl/cast_2d_contiguous.c +15 -0
- data/ext/numo/gsl/gen/tmpl/class.c +26 -0
- data/ext/numo/gsl/gen/tmpl/create_new_narray.c +26 -0
- data/ext/numo/gsl/gen/tmpl/init_class.c +10 -0
- data/ext/numo/gsl/gen/tmpl/init_module.c +12 -0
- data/ext/numo/gsl/gen/tmpl/lib.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_Int_f_DFloat.c +38 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat.c +35 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_Int.c +39 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_UInt.c +39 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double_x2.c +47 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_int.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x2.c +38 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x3.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double.c +43 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_uint.c +49 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_x2.c +48 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_uint_x3.c +51 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double.c +43 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_uint.c +50 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_x2.c +48 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_uint_x3.c +51 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat_x2.c +44 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c +46 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat_x3.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat_x2.c +45 -0
- data/ext/numo/gsl/gen/tmpl/mod_func_noloop.c +54 -0
- data/ext/numo/gsl/gen/tmpl/mod_func_scalar.c +27 -0
- data/ext/numo/gsl/gen/tmpl/module.c +9 -0
- data/ext/numo/gsl/histogram/depend +17 -0
- data/ext/numo/gsl/histogram/erbpp_histogram.rb +109 -0
- data/ext/numo/gsl/histogram/extconf.rb +9 -0
- data/ext/numo/gsl/histogram/func_def.rb +763 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_2d_get.c +54 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_field.c +35 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_get.c +47 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_x2_f_get_range.c +56 -0
- data/ext/numo/gsl/histogram/tmpl/c_bool_f_other.c +19 -0
- data/ext/numo/gsl/histogram/tmpl/c_bool_f_pdf_init.c +24 -0
- data/ext/numo/gsl/histogram/tmpl/c_self_f_2d_set_ranges.c +26 -0
- data/ext/numo/gsl/histogram/tmpl/c_self_f_set_ranges.c +21 -0
- data/ext/numo/gsl/histogram/tmpl/c_sizet_f_field.c +15 -0
- data/ext/numo/gsl/interp/depend +17 -0
- data/ext/numo/gsl/interp/erbpp_interp.rb +59 -0
- data/ext/numo/gsl/interp/extconf.rb +9 -0
- data/ext/numo/gsl/interp/func_def.rb +816 -0
- data/ext/numo/gsl/interp/parse_interp.rb +67 -0
- data/ext/numo/gsl/interp/tmpl/interp2d_new.c +36 -0
- data/ext/numo/gsl/interp/tmpl/interp2d_type_new.c +17 -0
- data/ext/numo/gsl/interp/tmpl/interp_bsearch.c +57 -0
- data/ext/numo/gsl/interp/tmpl/interp_new.c +29 -0
- data/ext/numo/gsl/interp/tmpl/interp_type_new.c +16 -0
- data/ext/numo/gsl/interp/tmpl/spline2d_eval.c +61 -0
- data/ext/numo/gsl/interp/tmpl/spline_eval.c +55 -0
- data/ext/numo/gsl/interp/tmpl/spline_integ.c +56 -0
- data/ext/numo/gsl/interp/type_def.rb +9 -0
- data/ext/numo/gsl/multifit/depend +17 -0
- data/ext/numo/gsl/multifit/erbpp_multifit.rb +99 -0
- data/ext/numo/gsl/multifit/extconf.rb +9 -0
- data/ext/numo/gsl/multifit/func_2.1.rb +1035 -0
- data/ext/numo/gsl/multifit/func_2.2.1.rb +736 -0
- data/ext/numo/gsl/multifit/func_2.2.rb +736 -0
- data/ext/numo/gsl/multifit/func_2.3.rb +872 -0
- data/ext/numo/gsl/multifit/func_def.rb +1012 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear.c +66 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear_est.c +48 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear_residuals.c +47 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_wlinear.c +70 -0
- data/ext/numo/gsl/multifit/type_def.rb +1 -0
- data/ext/numo/gsl/numo_gsl.h +117 -0
- data/ext/numo/gsl/pdf/depend +17 -0
- data/ext/numo/gsl/pdf/erbpp_pdf.rb +26 -0
- data/ext/numo/gsl/pdf/extconf.rb +9 -0
- data/ext/numo/gsl/pdf/func_2.2.1.rb +306 -0
- data/ext/numo/gsl/pdf/func_2.2.rb +306 -0
- data/ext/numo/gsl/pdf/func_2.3.rb +306 -0
- data/ext/numo/gsl/pdf/func_def.rb +282 -0
- data/ext/numo/gsl/pdf/parse_pdf.rb +42 -0
- data/ext/numo/gsl/pdf/tmpl/dirichlet.c +39 -0
- data/ext/numo/gsl/pdf/tmpl/multinomial.c +39 -0
- data/ext/numo/gsl/poly/depend +17 -0
- data/ext/numo/gsl/poly/erbpp_poly.rb +70 -0
- data/ext/numo/gsl/poly/extconf.rb +9 -0
- data/ext/numo/gsl/poly/func_def.rb +234 -0
- data/ext/numo/gsl/poly/tmpl/poly_complex_solve.c +59 -0
- data/ext/numo/gsl/poly/tmpl/poly_eval.c +70 -0
- data/ext/numo/gsl/poly/tmpl/poly_eval_derivs.c +40 -0
- data/ext/numo/gsl/ran/depend +17 -0
- data/ext/numo/gsl/ran/erbpp_ran.rb +42 -0
- data/ext/numo/gsl/ran/extconf.rb +9 -0
- data/ext/numo/gsl/ran/func_2.2.1.rb +1658 -0
- data/ext/numo/gsl/ran/func_2.2.rb +1658 -0
- data/ext/numo/gsl/ran/func_2.3.rb +1658 -0
- data/ext/numo/gsl/ran/func_def.rb +1594 -0
- data/ext/numo/gsl/ran/parse_ran.rb +10 -0
- data/ext/numo/gsl/rng/depend +17 -0
- data/ext/numo/gsl/rng/erbpp_rng.rb +58 -0
- data/ext/numo/gsl/rng/extconf.rb +9 -0
- data/ext/numo/gsl/rng/func_def.rb +230 -0
- data/ext/numo/gsl/rng/parse_rng.rb +125 -0
- data/ext/numo/gsl/rng/tmpl/ran.c +40 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_f_DFloat.c +28 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_x2.c +45 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_x3.c +51 -0
- data/ext/numo/gsl/rng/tmpl/ran_multinomial.c +32 -0
- data/ext/numo/gsl/rng/tmpl/rng_DFloat.c +29 -0
- data/ext/numo/gsl/rng/tmpl/rng_UInt.c +44 -0
- data/ext/numo/gsl/rng/tmpl/rng_alloc.c +24 -0
- data/ext/numo/gsl/rng/tmpl/rng_type_new.c +14 -0
- data/ext/numo/gsl/rng/type_def.rb +63 -0
- data/ext/numo/gsl/rstat/depend +17 -0
- data/ext/numo/gsl/rstat/erbpp_rstat.rb +64 -0
- data/ext/numo/gsl/rstat/extconf.rb +9 -0
- data/ext/numo/gsl/rstat/func_2.2.1.rb +116 -0
- data/ext/numo/gsl/rstat/func_2.2.rb +116 -0
- data/ext/numo/gsl/rstat/func_2.3.rb +123 -0
- data/ext/numo/gsl/rstat/func_def.rb +102 -0
- data/ext/numo/gsl/sf/depend +17 -0
- data/ext/numo/gsl/sf/erbpp_sf.rb +51 -0
- data/ext/numo/gsl/sf/extconf.rb +9 -0
- data/ext/numo/gsl/sf/func_def.rb +4703 -0
- data/ext/numo/gsl/sf/parse_sf.rb +277 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat.c +50 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat_x2.c +52 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x3_DFloat_x2.c +55 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_DFloat_mode.c +47 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_lmax_array.c +41 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_nmin_nmax_array.c +49 -0
- data/ext/numo/gsl/spmatrix/const_2.2.1.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_2.2.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_2.3.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_def.rb +2 -0
- data/ext/numo/gsl/spmatrix/depend +17 -0
- data/ext/numo/gsl/spmatrix/erbpp_spmatrix.rb +100 -0
- data/ext/numo/gsl/spmatrix/extconf.rb +9 -0
- data/ext/numo/gsl/spmatrix/func_2.2.1.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_2.2.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_2.3.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_def.rb +218 -0
- data/ext/numo/gsl/spmatrix/parse_spmatrix.rb +70 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_iterate.c +47 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_new.c +22 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_type_new.c +16 -0
- data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemm.c +35 -0
- data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemv.c +43 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_add.c +22 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c +28 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_new.c +40 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_sp2d.c +25 -0
- data/ext/numo/gsl/spmatrix/type_def.rb +1 -0
- data/ext/numo/gsl/stats/depend +17 -0
- data/ext/numo/gsl/stats/erbpp_stats.rb +29 -0
- data/ext/numo/gsl/stats/extconf.rb +9 -0
- data/ext/numo/gsl/stats/func_2.2.1.rb +608 -0
- data/ext/numo/gsl/stats/func_2.2.rb +608 -0
- data/ext/numo/gsl/stats/func_2.3.rb +608 -0
- data/ext/numo/gsl/stats/func_def.rb +608 -0
- data/ext/numo/gsl/stats/parse_stats.rb +63 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a0p.c +37 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a0p_index.c +60 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a1p.c +41 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a2p.c +42 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a0p.c +39 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a1p.c +43 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a2p.c +44 -0
- data/ext/numo/gsl/stats/tmpl/stats_minmax.c +37 -0
- data/ext/numo/gsl/stats/tmpl/stats_minmax_index.c +67 -0
- data/ext/numo/gsl/stats/tmpl/stats_spearman.c +46 -0
- data/ext/numo/gsl/sys/const_def.rb +21 -0
- data/ext/numo/gsl/sys/depend +17 -0
- data/ext/numo/gsl/sys/enum_def.rb +75 -0
- data/ext/numo/gsl/sys/erbpp_sys.rb +60 -0
- data/ext/numo/gsl/sys/extconf.rb +9 -0
- data/ext/numo/gsl/sys/func_def.rb +249 -0
- data/ext/numo/gsl/version.h +1 -0
- data/ext/numo/gsl/wavelet/depend +17 -0
- data/ext/numo/gsl/wavelet/erbpp_wavelet.rb +48 -0
- data/ext/numo/gsl/wavelet/extconf.rb +9 -0
- data/ext/numo/gsl/wavelet/func_def.rb +337 -0
- data/ext/numo/gsl/wavelet/parse_wavelet.rb +47 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet2d_transform.c +56 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_array_check.c +56 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_macro.c +1 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_new.c +20 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_transform.c +55 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_transform2.c +22 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_type_new.c +15 -0
- data/ext/numo/gsl/wavelet/type_def.rb +6 -0
- data/lib/numo/gsl.rb +17 -0
- data/numo-gsl.gemspec +33 -0
- metadata +367 -0
@@ -0,0 +1,1012 @@
|
|
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_stdform2",
|
158
|
+
:func_type=>"int",
|
159
|
+
:args=>
|
160
|
+
[["const gsl_matrix *", "L"],
|
161
|
+
["const gsl_matrix *", "X"],
|
162
|
+
["const gsl_vector *", "y"],
|
163
|
+
["gsl_matrix *", "Xs"],
|
164
|
+
["gsl_vector *", "ys"],
|
165
|
+
["gsl_matrix *", "M"],
|
166
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
167
|
+
:desc=>
|
168
|
+
"These functions convert the least squares system (X,y,W,L) to standard\n" +
|
169
|
+
"form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
|
170
|
+
"respectively. The regularization matrix L is a full rank\n" +
|
171
|
+
"m-by-p matrix with no restrictions on m. However,\n" +
|
172
|
+
"the dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
|
173
|
+
"depend on whether m is larger or less than p. For m \\ge p,\n" +
|
174
|
+
"Xs is n-by-p, ys is n-by-1, and M is\n" +
|
175
|
+
"additional m-by-p workspace. For m < p, Xs is (n - p + m)-by-m,\n" +
|
176
|
+
"ys is (n - p + m)-by-1, and M is additional n-by-p workspace.\n" +
|
177
|
+
"In both cases, M is required to recover the original solution vector after the system has been\n" +
|
178
|
+
"solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
|
179
|
+
"vector w of length n, where W = diag(w)."},
|
180
|
+
{:func_name=>"gsl_multifit_linear_wstdform2",
|
181
|
+
:func_type=>"int",
|
182
|
+
:args=>
|
183
|
+
[["const gsl_matrix *", "L"],
|
184
|
+
["const gsl_matrix *", "X"],
|
185
|
+
["const gsl_vector *", "w"],
|
186
|
+
["const gsl_vector *", "y"],
|
187
|
+
["gsl_matrix *", "Xs"],
|
188
|
+
["gsl_vector *", "ys"],
|
189
|
+
["gsl_matrix *", "M"],
|
190
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
191
|
+
:desc=>
|
192
|
+
"These functions convert the least squares system (X,y,W,L) to standard\n" +
|
193
|
+
"form (\\tilde{X},\\tilde{y}) which are stored in Xs and ys\n" +
|
194
|
+
"respectively. The regularization matrix L is a full rank\n" +
|
195
|
+
"m-by-p matrix with no restrictions on m. However,\n" +
|
196
|
+
"the dimensions of the standard form parameters (\\tilde{X},\\tilde{y})\n" +
|
197
|
+
"depend on whether m is larger or less than p. For m \\ge p,\n" +
|
198
|
+
"Xs is n-by-p, ys is n-by-1, and M is\n" +
|
199
|
+
"additional m-by-p workspace. For m < p, Xs is (n - p + m)-by-m,\n" +
|
200
|
+
"ys is (n - p + m)-by-1, and M is additional n-by-p workspace.\n" +
|
201
|
+
"In both cases, M is required to recover the original solution vector after the system has been\n" +
|
202
|
+
"solved (see gsl_multifit_linear_genform2). Optional data weights may be supplied in the\n" +
|
203
|
+
"vector w of length n, where W = diag(w)."},
|
204
|
+
{:func_name=>"gsl_multifit_linear_solve",
|
205
|
+
:func_type=>"int",
|
206
|
+
:args=>
|
207
|
+
[["const double", "lambda"],
|
208
|
+
["const gsl_matrix *", "Xs"],
|
209
|
+
["const gsl_vector *", "ys"],
|
210
|
+
["gsl_vector *", "cs"],
|
211
|
+
["double *", "rnorm"],
|
212
|
+
["double *", "snorm"],
|
213
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
214
|
+
:desc=>
|
215
|
+
"This function computes the regularized best-fit parameters \\tilde{c}\n" +
|
216
|
+
"which minimize the cost function\n" +
|
217
|
+
"\\chi^2 = || \\tilde{y} - \\tilde{X} \\tilde{c} ||^2 + \\lambda^2 || \\tilde{c} ||^2 which is\n" +
|
218
|
+
"in standard form. The least squares system must therefore be converted\n" +
|
219
|
+
"to standard form prior to calling this function.\n" +
|
220
|
+
"The observation vector \\tilde{y} is provided in ys and the matrix of\n" +
|
221
|
+
"predictor variables \\tilde{X} in Xs. The solution vector \\tilde{c} is\n" +
|
222
|
+
"returned in cs, which has length min(m,p). The SVD of Xs must be computed prior\n" +
|
223
|
+
"to calling this function, using gsl_multifit_linear_svd.\n" +
|
224
|
+
"The regularization parameter \\lambda is provided in lambda.\n" +
|
225
|
+
"The residual norm || \\tilde{y} - \\tilde{X} \\tilde{c} || = ||y - X c||_W is returned in rnorm.\n" +
|
226
|
+
"The solution norm || \\tilde{c} || = ||L c|| is returned in\n" +
|
227
|
+
"snorm."},
|
228
|
+
{:func_name=>"gsl_multifit_linear_genform1",
|
229
|
+
:func_type=>"int",
|
230
|
+
:args=>
|
231
|
+
[["const gsl_vector *", "L"],
|
232
|
+
["const gsl_vector *", "cs"],
|
233
|
+
["gsl_vector *", "c"],
|
234
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
235
|
+
:desc=>
|
236
|
+
"After a regularized system has been solved with\n" +
|
237
|
+
"L = diag(\\l_0,\\l_1,...,\\l_{p-1}),\n" +
|
238
|
+
"this function backtransforms the standard form solution vector cs\n" +
|
239
|
+
"to recover the solution vector of the original problem c. The\n" +
|
240
|
+
"diagonal matrix elements l_i are provided in\n" +
|
241
|
+
"the vector L. It is allowed to have c = cs for an\n" +
|
242
|
+
"in-place transform."},
|
243
|
+
{:func_name=>"gsl_multifit_linear_genform2",
|
244
|
+
:func_type=>"int",
|
245
|
+
:args=>
|
246
|
+
[["const gsl_matrix *", "L"],
|
247
|
+
["const gsl_matrix *", "X"],
|
248
|
+
["const gsl_vector *", "y"],
|
249
|
+
["const gsl_vector *", "cs"],
|
250
|
+
["const gsl_matrix *", "M"],
|
251
|
+
["gsl_vector *", "c"],
|
252
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
253
|
+
:desc=>
|
254
|
+
"After a regularized system has been solved with a general rectangular matrix L,\n" +
|
255
|
+
"this function backtransforms the standard form solution cs\n" +
|
256
|
+
"to recover the solution vector of the original problem, which is stored in c,\n" +
|
257
|
+
"of length p. The original least squares matrix and observation vector are provided in\n" +
|
258
|
+
"X and y respectively. M is the matrix computed by\n" +
|
259
|
+
"gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
|
260
|
+
"w must also be supplied."},
|
261
|
+
{:func_name=>"gsl_multifit_linear_wgenform2",
|
262
|
+
:func_type=>"int",
|
263
|
+
:args=>
|
264
|
+
[["const gsl_matrix *", "L"],
|
265
|
+
["const gsl_matrix *", "X"],
|
266
|
+
["const gsl_vector *", "w"],
|
267
|
+
["const gsl_vector *", "y"],
|
268
|
+
["const gsl_vector *", "cs"],
|
269
|
+
["const gsl_matrix *", "M"],
|
270
|
+
["gsl_vector *", "c"],
|
271
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
272
|
+
:desc=>
|
273
|
+
"After a regularized system has been solved with a general rectangular matrix L,\n" +
|
274
|
+
"this function backtransforms the standard form solution cs\n" +
|
275
|
+
"to recover the solution vector of the original problem, which is stored in c,\n" +
|
276
|
+
"of length p. The original least squares matrix and observation vector are provided in\n" +
|
277
|
+
"X and y respectively. M is the matrix computed by\n" +
|
278
|
+
"gsl_multifit_linear_stdform2. For weighted fits, the weight vector\n" +
|
279
|
+
"w must also be supplied."},
|
280
|
+
{:func_name=>"gsl_multifit_linear_applyW",
|
281
|
+
:func_type=>"int",
|
282
|
+
:args=>
|
283
|
+
[["const gsl_matrix *", "X"],
|
284
|
+
["const gsl_vector *", "w"],
|
285
|
+
["const gsl_vector *", "y"],
|
286
|
+
["gsl_matrix *", "WX"],
|
287
|
+
["gsl_vector *", "Wy"],
|
288
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
289
|
+
:desc=>
|
290
|
+
"For weighted least squares systems with L = I, this function may be used to\n" +
|
291
|
+
"convert the system to standard form by applying the weight matrix W = diag(w)\n" +
|
292
|
+
"to the least squares matrix X and observation vector y. On output, WX\n" +
|
293
|
+
"is equal to W^{1/2} X and Wy is equal to W^{1/2} y. It is allowed\n" +
|
294
|
+
"for WX = X and Wy = y for an in-place transform."},
|
295
|
+
{:func_name=>"gsl_multifit_linear_lcurve",
|
296
|
+
:func_type=>"int",
|
297
|
+
:args=>
|
298
|
+
[["const gsl_vector *", "y"],
|
299
|
+
["gsl_vector *", "reg_param"],
|
300
|
+
["gsl_vector *", "rho"],
|
301
|
+
["gsl_vector *", "eta"],
|
302
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
303
|
+
:desc=>
|
304
|
+
"This function computes the L-curve for a least squares system\n" +
|
305
|
+
"using the right hand side vector y and the SVD decomposition\n" +
|
306
|
+
"of the least squares matrix X, which must be provided\n" +
|
307
|
+
"to gsl_multifit_linear_svd prior to\n" +
|
308
|
+
"calling this function. The output vectors reg_param,\n" +
|
309
|
+
"rho, and eta must all be the same size, and will\n" +
|
310
|
+
"contain the regularization parameters \\lambda_i, residual norms\n" +
|
311
|
+
"||y - X c_i||, and solution norms || L c_i ||\n" +
|
312
|
+
"which compose the L-curve, where c_i is the regularized\n" +
|
313
|
+
"solution vector corresponding to \\lambda_i.\n" +
|
314
|
+
"The user may determine the number of points on the L-curve by\n" +
|
315
|
+
"adjusting the size of these input arrays. The regularization\n" +
|
316
|
+
"parameters \\lambda_i are estimated from the singular values\n" +
|
317
|
+
"of X, and chosen to represent the most relevant portion of\n" +
|
318
|
+
"the L-curve."},
|
319
|
+
{:func_name=>"gsl_multifit_linear_lcorner",
|
320
|
+
:func_type=>"int",
|
321
|
+
:args=>
|
322
|
+
[["const gsl_vector *", "rho"],
|
323
|
+
["const gsl_vector *", "eta"],
|
324
|
+
["size_t *", "idx"]],
|
325
|
+
:desc=>
|
326
|
+
"This function attempts to locate the corner of the L-curve\n" +
|
327
|
+
"(||y - X c||, ||L c||) defined by the rho and eta\n" +
|
328
|
+
"input arrays respectively. The corner is defined as the point of maximum\n" +
|
329
|
+
"curvature of the L-curve in log-log scale. The rho and eta\n" +
|
330
|
+
"arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
|
331
|
+
"algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
|
332
|
+
"and uses the circle's radius to determine the curvature at\n" +
|
333
|
+
"the middle point. Therefore, the input array sizes must be\n" +
|
334
|
+
"\\ge 3. With more points provided for the L-curve, a better\n" +
|
335
|
+
"estimate of the curvature can be obtained. The array index\n" +
|
336
|
+
"corresponding to maximum curvature (ie: the corner) is returned\n" +
|
337
|
+
"in idx. If the input arrays contain colinear points,\n" +
|
338
|
+
"this function could fail and return GSL_EINVAL."},
|
339
|
+
{:func_name=>"gsl_multifit_linear_lcorner2",
|
340
|
+
:func_type=>"int",
|
341
|
+
:args=>
|
342
|
+
[["const gsl_vector *", "reg_param"],
|
343
|
+
["const gsl_vector *", "eta"],
|
344
|
+
["size_t *", "idx"]],
|
345
|
+
:desc=>
|
346
|
+
"This function attempts to locate the corner of an alternate L-curve\n" +
|
347
|
+
"(\\lambda^2, ||L c||^2) studied by Rezghi and Hosseini, 2009.\n" +
|
348
|
+
"This alternate L-curve can provide better estimates of the\n" +
|
349
|
+
"regularization parameter for smooth solution vectors. The regularization\n" +
|
350
|
+
"parameters \\lambda and solution norms ||L c|| are provided\n" +
|
351
|
+
"in the reg_param and eta input arrays respectively. The\n" +
|
352
|
+
"corner is defined as the point of maximum curvature of this\n" +
|
353
|
+
"alternate L-curve in linear scale. The reg_param and eta\n" +
|
354
|
+
"arrays can be outputs of gsl_multifit_linear_lcurve. The\n" +
|
355
|
+
"algorithm used simply fits a circle to 3 consecutive points on the L-curve\n" +
|
356
|
+
"and uses the circle's radius to determine the curvature at\n" +
|
357
|
+
"the middle point. Therefore, the input array sizes must be\n" +
|
358
|
+
"\\ge 3. With more points provided for the L-curve, a better\n" +
|
359
|
+
"estimate of the curvature can be obtained. The array index\n" +
|
360
|
+
"corresponding to maximum curvature (ie: the corner) is returned\n" +
|
361
|
+
"in idx. If the input arrays contain colinear points,\n" +
|
362
|
+
"this function could fail and return GSL_EINVAL."},
|
363
|
+
{:func_name=>"gsl_multifit_linear_Lk",
|
364
|
+
:func_type=>"int",
|
365
|
+
:args=>[["const size_t", "p"], ["const size_t", "k"], ["gsl_matrix *", "L"]],
|
366
|
+
:desc=>
|
367
|
+
"This function computes the discrete approximation to the derivative operator L_k of\n" +
|
368
|
+
"order k on a regular grid of p points and stores it in L. The dimensions of L are\n" +
|
369
|
+
"(p-k)-by-p."},
|
370
|
+
{:func_name=>"gsl_multifit_linear_Lsobolev",
|
371
|
+
:func_type=>"int",
|
372
|
+
:args=>
|
373
|
+
[["const size_t", "p"],
|
374
|
+
["const size_t", "kmax"],
|
375
|
+
["const gsl_vector *", "alpha"],
|
376
|
+
["gsl_matrix *", "L"],
|
377
|
+
["gsl_multifit_linear_workspace *", "work"]],
|
378
|
+
:desc=>
|
379
|
+
"This function computes the regularization matrix L corresponding to the weighted Sobolov norm\n" +
|
380
|
+
"||L c||^2 = \\sum_k \\alpha_k^2 ||L_k c||^2 where L_k approximates the derivative\n" +
|
381
|
+
"operator of order k. This regularization norm can be useful in applications where\n" +
|
382
|
+
"it is necessary to smooth several derivatives of the solution. p is the number of\n" +
|
383
|
+
"model parameters, kmax is the highest derivative to include in the summation above, and\n" +
|
384
|
+
"alpha is the vector of weights of size kmax + 1, where alpha[k] = \\alpha_k\n" +
|
385
|
+
"is the weight assigned to the derivative of order k. The output matrix L is of size\n" +
|
386
|
+
"p-by-p."},
|
387
|
+
{:func_name=>"gsl_multifit_robust_alloc",
|
388
|
+
:func_type=>"gsl_multifit_robust_workspace *",
|
389
|
+
:args=>
|
390
|
+
[["const gsl_multifit_robust_type *", "T"],
|
391
|
+
["const size_t", "n"],
|
392
|
+
["const size_t", "p"]],
|
393
|
+
:desc=>
|
394
|
+
"This function allocates a workspace for fitting a model to n\n" +
|
395
|
+
"observations using p parameters. The size of the workspace\n" +
|
396
|
+
"is O(np + p^2). The type T specifies the\n" +
|
397
|
+
"function \\psi and can be selected from the following choices.\n" +
|
398
|
+
"\n" +
|
399
|
+
"\n" +
|
400
|
+
"\n" +
|
401
|
+
"\n" +
|
402
|
+
"\n"},
|
403
|
+
{:func_name=>"gsl_multifit_robust_free",
|
404
|
+
:func_type=>"void",
|
405
|
+
:args=>[["gsl_multifit_robust_workspace *", "w"]],
|
406
|
+
:desc=>"This function frees the memory associated with the workspace w."},
|
407
|
+
{:func_name=>"gsl_multifit_robust_name",
|
408
|
+
:func_type=>"const char *",
|
409
|
+
:args=>[["const gsl_multifit_robust_workspace *", "w"]],
|
410
|
+
:desc=>
|
411
|
+
"This function returns the name of the robust type T specified to gsl_multifit_robust_alloc."},
|
412
|
+
{:func_name=>"gsl_multifit_robust_tune",
|
413
|
+
:func_type=>"int",
|
414
|
+
:args=>[["const double", "tune"], ["gsl_multifit_robust_workspace *", "w"]],
|
415
|
+
:desc=>
|
416
|
+
"This function sets the tuning constant t used to adjust the residuals at each iteration to tune.\n" +
|
417
|
+
"Decreasing the tuning constant increases the downweight assigned to large residuals, while increasing\n" +
|
418
|
+
"the tuning constant decreases the downweight assigned to large residuals."},
|
419
|
+
{:func_name=>"gsl_multifit_robust_maxiter",
|
420
|
+
:func_type=>"int",
|
421
|
+
:args=>
|
422
|
+
[["const size_t", "maxiter"], ["gsl_multifit_robust_workspace *", "w"]],
|
423
|
+
:desc=>
|
424
|
+
"This function sets the maximum number of iterations in the iteratively\n" +
|
425
|
+
"reweighted least squares algorithm to maxiter. By default,\n" +
|
426
|
+
"this value is set to 100 by gsl_multifit_robust_alloc."},
|
427
|
+
{:func_name=>"gsl_multifit_robust_weights",
|
428
|
+
:func_type=>"int",
|
429
|
+
:args=>
|
430
|
+
[["const gsl_vector *", "r"],
|
431
|
+
["gsl_vector *", "wts"],
|
432
|
+
["gsl_multifit_robust_workspace *", "w"]],
|
433
|
+
:desc=>
|
434
|
+
"This function assigns weights to the vector wts using the residual vector r and\n" +
|
435
|
+
"previously specified weighting function. The output weights are given by wts_i = w(r_i / (t \\sigma)),\n" +
|
436
|
+
"where the weighting functions w are detailed in gsl_multifit_robust_alloc. \\sigma\n" +
|
437
|
+
"is an estimate of the residual standard deviation based on the Median-Absolute-Deviation and t\n" +
|
438
|
+
"is the tuning constant. This\n" +
|
439
|
+
"function is useful if the user wishes to implement their own robust regression rather than using\n" +
|
440
|
+
"the supplied gsl_multifit_robust routine below."},
|
441
|
+
{:func_name=>"gsl_multifit_robust",
|
442
|
+
:func_type=>"int",
|
443
|
+
:args=>
|
444
|
+
[["const gsl_matrix *", "X"],
|
445
|
+
["const gsl_vector *", "y"],
|
446
|
+
["gsl_vector *", "c"],
|
447
|
+
["gsl_matrix *", "cov"],
|
448
|
+
["gsl_multifit_robust_workspace *", "w"]],
|
449
|
+
:desc=>
|
450
|
+
"This function computes the best-fit parameters c of the model\n" +
|
451
|
+
"y = X c for the observations y and the matrix of\n" +
|
452
|
+
"predictor variables X, attemping to reduce the influence\n" +
|
453
|
+
"of outliers using the algorithm outlined above.\n" +
|
454
|
+
"The p-by-p variance-covariance matrix of the model parameters\n" +
|
455
|
+
"cov is estimated as \\sigma^2 (X^T X)^{-1}, where \\sigma is\n" +
|
456
|
+
"an approximation of the residual standard deviation using the theory of robust\n" +
|
457
|
+
"regression. Special care must be taken when estimating \\sigma and\n" +
|
458
|
+
"other statistics such as R^2, and so these\n" +
|
459
|
+
"are computed internally and are available by calling the function\n" +
|
460
|
+
"gsl_multifit_robust_statistics.\n" +
|
461
|
+
"\n" +
|
462
|
+
"If the coefficients do not converge within the maximum iteration\n" +
|
463
|
+
"limit, the function returns GSL_EMAXITER. In this case,\n" +
|
464
|
+
"the current estimates of the coefficients and covariance matrix\n" +
|
465
|
+
"are returned in c and cov and the internal fit statistics\n" +
|
466
|
+
"are computed with these estimates."},
|
467
|
+
{:func_name=>"gsl_multifit_robust_est",
|
468
|
+
:func_type=>"int",
|
469
|
+
:args=>
|
470
|
+
[["const gsl_vector *", "x"],
|
471
|
+
["const gsl_vector *", "c"],
|
472
|
+
["const gsl_matrix *", "cov"],
|
473
|
+
["double *", "y"],
|
474
|
+
["double *", "y_err"]],
|
475
|
+
:desc=>
|
476
|
+
"This function uses the best-fit robust regression coefficients\n" +
|
477
|
+
"c and their covariance matrix\n" +
|
478
|
+
"cov to compute the fitted function value\n" +
|
479
|
+
"y and its standard deviation y_err for the model y = x.c \n" +
|
480
|
+
"at the point x."},
|
481
|
+
{:func_name=>"gsl_multifit_robust_residuals",
|
482
|
+
:func_type=>"int",
|
483
|
+
:args=>
|
484
|
+
[["const gsl_matrix *", "X"],
|
485
|
+
["const gsl_vector *", "y"],
|
486
|
+
["const gsl_vector *", "c"],
|
487
|
+
["gsl_vector *", "r"],
|
488
|
+
["gsl_multifit_robust_workspace *", "w"]],
|
489
|
+
:desc=>
|
490
|
+
"This function computes the vector of studentized residuals\n" +
|
491
|
+
"r_i = {y_i - (X c)_i \\over \\sigma \\sqrt{1 - h_i}} for\n" +
|
492
|
+
"the observations y, coefficients c and matrix of predictor\n" +
|
493
|
+
"variables X. The routine gsl_multifit_robust must\n" +
|
494
|
+
"first be called to compute the statisical leverages h_i of\n" +
|
495
|
+
"the matrix X and residual standard deviation estimate \\sigma."},
|
496
|
+
{:func_name=>"gsl_multifit_robust_statistics",
|
497
|
+
:func_type=>"gsl_multifit_robust_stats",
|
498
|
+
:args=>[["const gsl_multifit_robust_workspace *", "w"]],
|
499
|
+
:desc=>
|
500
|
+
"This function returns a structure containing relevant statistics from a robust regression. The function\n" +
|
501
|
+
"gsl_multifit_robust must be called first to perform the regression and calculate these statistics.\n" +
|
502
|
+
"The returned gsl_multifit_robust_stats structure contains the following fields."},
|
503
|
+
{:func_name=>"gsl_multifit_fsolver_alloc",
|
504
|
+
:func_type=>"gsl_multifit_fsolver *",
|
505
|
+
:args=>
|
506
|
+
[["const gsl_multifit_fsolver_type *", "T"],
|
507
|
+
["size_t", "n"],
|
508
|
+
["size_t", "p"]],
|
509
|
+
:desc=>
|
510
|
+
"This function returns a pointer to a newly allocated instance of a\n" +
|
511
|
+
"solver of type T for n observations and p parameters.\n" +
|
512
|
+
"The number of observations n must be greater than or equal to\n" +
|
513
|
+
"parameters p. \n" +
|
514
|
+
"\n" +
|
515
|
+
"If there is insufficient memory to create the solver then the function\n" +
|
516
|
+
"returns a null pointer and the error handler is invoked with an error\n" +
|
517
|
+
"code of GSL_ENOMEM."},
|
518
|
+
{:func_name=>"gsl_multifit_fdfsolver_alloc",
|
519
|
+
:func_type=>"gsl_multifit_fdfsolver *",
|
520
|
+
:args=>
|
521
|
+
[["const gsl_multifit_fdfsolver_type *", "T"],
|
522
|
+
["size_t", "n"],
|
523
|
+
["size_t", "p"]],
|
524
|
+
:desc=>
|
525
|
+
"This function returns a pointer to a newly allocated instance of a\n" +
|
526
|
+
"derivative solver of type T for n observations and p\n" +
|
527
|
+
"parameters. For example, the following code creates an instance of a\n" +
|
528
|
+
"Levenberg-Marquardt solver for 100 data points and 3 parameters,\n" +
|
529
|
+
"\n" +
|
530
|
+
"const gsl_multifit_fdfsolver_type * T \n" +
|
531
|
+
" = gsl_multifit_fdfsolver_lmder;\n" +
|
532
|
+
"gsl_multifit_fdfsolver * s \n" +
|
533
|
+
" = gsl_multifit_fdfsolver_alloc (T, 100, 3);\n" +
|
534
|
+
"\n" +
|
535
|
+
"The number of observations n must be greater than or equal to\n" +
|
536
|
+
"parameters p.\n" +
|
537
|
+
"\n" +
|
538
|
+
"If there is insufficient memory to create the solver then the function\n" +
|
539
|
+
"returns a null pointer and the error handler is invoked with an error\n" +
|
540
|
+
"code of GSL_ENOMEM."},
|
541
|
+
{:func_name=>"gsl_multifit_fdfridge_alloc",
|
542
|
+
:func_type=>"gsl_multifit_fdfridge *",
|
543
|
+
:args=>
|
544
|
+
[["const gsl_multifit_fdfsolver_type *", "T"],
|
545
|
+
["size_t", "n"],
|
546
|
+
["size_t", "p"]],
|
547
|
+
:desc=>
|
548
|
+
"This function returns a pointer to a newly allocated instance of a\n" +
|
549
|
+
"derivative solver of type T for n observations and p\n" +
|
550
|
+
"parameters. The solver will automatically form the augmented\n" +
|
551
|
+
"system \\tilde{f}(x) and \\tilde{J} for ridge (Tikhonov)\n" +
|
552
|
+
"regression.\n" +
|
553
|
+
"If there is insufficient memory to create the solver then the function\n" +
|
554
|
+
"returns a null pointer and the error handler is invoked with an error\n" +
|
555
|
+
"code of GSL_ENOMEM."},
|
556
|
+
{:func_name=>"gsl_multifit_fsolver_set",
|
557
|
+
:func_type=>"int",
|
558
|
+
:args=>
|
559
|
+
[["gsl_multifit_fsolver *", "s"],
|
560
|
+
["gsl_multifit_function *", "f"],
|
561
|
+
["const gsl_vector *", "x"]],
|
562
|
+
:desc=>
|
563
|
+
"This function initializes, or reinitializes, an existing solver s\n" +
|
564
|
+
"to use the function f and the initial guess x."},
|
565
|
+
{:func_name=>"gsl_multifit_fdfsolver_set",
|
566
|
+
:func_type=>"int",
|
567
|
+
:args=>
|
568
|
+
[["gsl_multifit_fdfsolver *", "s"],
|
569
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
570
|
+
["const gsl_vector *", "x"]],
|
571
|
+
:desc=>
|
572
|
+
"These functions initialize, or reinitialize, an existing solver s\n" +
|
573
|
+
"to use the function and derivative fdf and the initial guess\n" +
|
574
|
+
"x.\n" +
|
575
|
+
"\n" +
|
576
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
577
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
578
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
579
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
580
|
+
"the iteration terminates."},
|
581
|
+
{:func_name=>"gsl_multifit_fdfsolver_wset",
|
582
|
+
:func_type=>"int",
|
583
|
+
:args=>
|
584
|
+
[["gsl_multifit_fdfsolver *", "s"],
|
585
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
586
|
+
["const gsl_vector *", "x"],
|
587
|
+
["const gsl_vector *", "wts"]],
|
588
|
+
:desc=>
|
589
|
+
"These functions initialize, or reinitialize, an existing solver s\n" +
|
590
|
+
"to use the function and derivative fdf and the initial guess\n" +
|
591
|
+
"x.\n" +
|
592
|
+
"\n" +
|
593
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
594
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
595
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
596
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
597
|
+
"the iteration terminates."},
|
598
|
+
{:func_name=>"gsl_multifit_fdfridge_set",
|
599
|
+
:func_type=>"int",
|
600
|
+
:args=>
|
601
|
+
[["gsl_multifit_fdfridge *", "s"],
|
602
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
603
|
+
["const gsl_vector *", "x"],
|
604
|
+
["const double", "lambda"]],
|
605
|
+
:desc=>
|
606
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
607
|
+
"s to use the function and derivative fdf and the initial guess\n" +
|
608
|
+
"x. Here, the regularization matrix is set to L = \\lambda I,\n" +
|
609
|
+
"with \\lambda specified in lambda.\n" +
|
610
|
+
"\n" +
|
611
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
612
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
613
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
614
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
615
|
+
"the iteration terminates."},
|
616
|
+
{:func_name=>"gsl_multifit_fdfridge_wset",
|
617
|
+
:func_type=>"int",
|
618
|
+
:args=>
|
619
|
+
[["gsl_multifit_fdfridge *", "s"],
|
620
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
621
|
+
["const gsl_vector *", "x"],
|
622
|
+
["const double", "lambda"],
|
623
|
+
["const gsl_vector *", "wts"]],
|
624
|
+
:desc=>
|
625
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
626
|
+
"s to use the function and derivative fdf and the initial guess\n" +
|
627
|
+
"x. Here, the regularization matrix is set to L = \\lambda I,\n" +
|
628
|
+
"with \\lambda specified in lambda.\n" +
|
629
|
+
"\n" +
|
630
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
631
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
632
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
633
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
634
|
+
"the iteration terminates."},
|
635
|
+
{:func_name=>"gsl_multifit_fdfridge_set2",
|
636
|
+
:func_type=>"int",
|
637
|
+
:args=>
|
638
|
+
[["gsl_multifit_fdfridge *", "s"],
|
639
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
640
|
+
["const gsl_vector *", "x"],
|
641
|
+
["const gsl_vector *", "lambda"]],
|
642
|
+
:desc=>
|
643
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
644
|
+
"s to use the function and derivative fdf and the initial\n" +
|
645
|
+
"guess x. Here, the regularization matrix is set to\n" +
|
646
|
+
"L = diag(\\lambda_1,\\lambda_2,...,\\lambda_p), where\n" +
|
647
|
+
"the \\lambda_i are given in lambda.\n" +
|
648
|
+
"\n" +
|
649
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
650
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
651
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
652
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
653
|
+
"the iteration terminates."},
|
654
|
+
{:func_name=>"gsl_multifit_fdfridge_wset2",
|
655
|
+
:func_type=>"int",
|
656
|
+
:args=>
|
657
|
+
[["gsl_multifit_fdfridge *", "s"],
|
658
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
659
|
+
["const gsl_vector *", "x"],
|
660
|
+
["const gsl_vector *", "lambda"],
|
661
|
+
["const gsl_vector *", "wts"]],
|
662
|
+
:desc=>
|
663
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
664
|
+
"s to use the function and derivative fdf and the initial\n" +
|
665
|
+
"guess x. Here, the regularization matrix is set to\n" +
|
666
|
+
"L = diag(\\lambda_1,\\lambda_2,...,\\lambda_p), where\n" +
|
667
|
+
"the \\lambda_i are given in lambda.\n" +
|
668
|
+
"\n" +
|
669
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
670
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
671
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
672
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
673
|
+
"the iteration terminates."},
|
674
|
+
{:func_name=>"gsl_multifit_fdfridge_set3",
|
675
|
+
:func_type=>"int",
|
676
|
+
:args=>
|
677
|
+
[["gsl_multifit_fdfridge *", "s"],
|
678
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
679
|
+
["const gsl_vector *", "x"],
|
680
|
+
["const gsl_matrix *", "L"]],
|
681
|
+
:desc=>
|
682
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
683
|
+
"s to use the function and derivative fdf and the initial\n" +
|
684
|
+
"guess x. Here, the regularization matrix is set to L,\n" +
|
685
|
+
"which must have p columns but may have any number of rows.\n" +
|
686
|
+
"\n" +
|
687
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
688
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
689
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
690
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
691
|
+
"the iteration terminates."},
|
692
|
+
{:func_name=>"gsl_multifit_fdfridge_wset3",
|
693
|
+
:func_type=>"int",
|
694
|
+
:args=>
|
695
|
+
[["gsl_multifit_fdfridge *", "s"],
|
696
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
697
|
+
["const gsl_vector *", "x"],
|
698
|
+
["const gsl_matrix *", "L"],
|
699
|
+
["const gsl_vector *", "wts"]],
|
700
|
+
:desc=>
|
701
|
+
"This function initializes, or reinitializes, an existing ridge solver\n" +
|
702
|
+
"s to use the function and derivative fdf and the initial\n" +
|
703
|
+
"guess x. Here, the regularization matrix is set to L,\n" +
|
704
|
+
"which must have p columns but may have any number of rows.\n" +
|
705
|
+
"\n" +
|
706
|
+
"Optionally, a weight vector wts can be given to perform\n" +
|
707
|
+
"a weighted nonlinear regression. Here, the weighting matrix is\n" +
|
708
|
+
"W = diag(w_1,w_2,...,w_n). The wts vector is referenced\n" +
|
709
|
+
"throughout the iteration so it should not be freed by the caller until\n" +
|
710
|
+
"the iteration terminates."},
|
711
|
+
{:func_name=>"gsl_multifit_fsolver_free",
|
712
|
+
:func_type=>"void",
|
713
|
+
:args=>[["gsl_multifit_fsolver *", "s"]],
|
714
|
+
:desc=>"These functions free all the memory associated with the solver s."},
|
715
|
+
{:func_name=>"gsl_multifit_fdfsolver_free",
|
716
|
+
:func_type=>"void",
|
717
|
+
:args=>[["gsl_multifit_fdfsolver *", "s"]],
|
718
|
+
:desc=>"These functions free all the memory associated with the solver s."},
|
719
|
+
{:func_name=>"gsl_multifit_fdfridge_free",
|
720
|
+
:func_type=>"void",
|
721
|
+
:args=>[["gsl_multifit_fdfridge *", "s"]],
|
722
|
+
:desc=>"These functions free all the memory associated with the solver s."},
|
723
|
+
{:func_name=>"gsl_multifit_fsolver_name",
|
724
|
+
:func_type=>"const char *",
|
725
|
+
:args=>[["const gsl_multifit_fsolver *", "s"]],
|
726
|
+
:desc=>
|
727
|
+
"These functions return a pointer to the name of the solver. For example,\n" +
|
728
|
+
"\n" +
|
729
|
+
"printf (\"s is a '%s' solver\\n\", \n" +
|
730
|
+
" gsl_multifit_fdfsolver_name (s));\n" +
|
731
|
+
"\n" +
|
732
|
+
"would print something like s is a 'lmder' solver."},
|
733
|
+
{:func_name=>"gsl_multifit_fdfsolver_name",
|
734
|
+
:func_type=>"const char *",
|
735
|
+
:args=>[["const gsl_multifit_fdfsolver *", "s"]],
|
736
|
+
:desc=>
|
737
|
+
"These functions return a pointer to the name of the solver. For example,\n" +
|
738
|
+
"\n" +
|
739
|
+
"printf (\"s is a '%s' solver\\n\", \n" +
|
740
|
+
" gsl_multifit_fdfsolver_name (s));\n" +
|
741
|
+
"\n" +
|
742
|
+
"would print something like s is a 'lmder' solver."},
|
743
|
+
{:func_name=>"gsl_multifit_fdfridge_name",
|
744
|
+
:func_type=>"const char *",
|
745
|
+
:args=>[["const gsl_multifit_fdfridge *", "s"]],
|
746
|
+
:desc=>
|
747
|
+
"These functions return a pointer to the name of the solver. For example,\n" +
|
748
|
+
"\n" +
|
749
|
+
"printf (\"s is a '%s' solver\\n\", \n" +
|
750
|
+
" gsl_multifit_fdfsolver_name (s));\n" +
|
751
|
+
"\n" +
|
752
|
+
"would print something like s is a 'lmder' solver."},
|
753
|
+
{:func_name=>"gsl_multifit_fdfsolver_dif_df",
|
754
|
+
:func_type=>"int",
|
755
|
+
:args=>
|
756
|
+
[["const gsl_vector *", "x"],
|
757
|
+
["const gsl_vector *", "wts"],
|
758
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
759
|
+
["const gsl_vector *", "f"],
|
760
|
+
["gsl_matrix *", "J"]],
|
761
|
+
:desc=>
|
762
|
+
"This function takes as input the current position x, weight\n" +
|
763
|
+
"vector wts and function values computed at the current position\n" +
|
764
|
+
"f, along with fdf which specifies the fit function and\n" +
|
765
|
+
"parameters and approximates the\n" +
|
766
|
+
"n-by-p Jacobian J using forward finite differences:\n" +
|
767
|
+
"$J_{ij} = \\sqrt{w_i} \\partial f_i(x) / \\partial x_j \\approx \\sqrt{w_i} (f_i(x + h_j e_j) - f_i(x)) / h_j$\n" +
|
768
|
+
"J_ij = sqrt(w_i) d f_i(x) / d x_j = sqrt(w_i) (f_i(x + h_j e_j) - f_i(x)) / h_j.\n" +
|
769
|
+
"where h_j = \\epsilon |x_j|, and \\epsilon is the\n" +
|
770
|
+
"square root of the machine precision GSL_DBL_EPSILON."},
|
771
|
+
{:func_name=>"gsl_multifit_fdfsolver_dif_fdf",
|
772
|
+
:func_type=>"int",
|
773
|
+
:args=>
|
774
|
+
[["const gsl_vector *", "x"],
|
775
|
+
["gsl_multifit_function_fdf *", "fdf"],
|
776
|
+
["gsl_vector *", "f"],
|
777
|
+
["gsl_matrix *", "J"]],
|
778
|
+
:desc=>
|
779
|
+
"This function is deprecated and will be removed in a future release."},
|
780
|
+
{:func_name=>"gsl_multifit_fsolver_iterate",
|
781
|
+
:func_type=>"int",
|
782
|
+
:args=>[["gsl_multifit_fsolver *", "s"]],
|
783
|
+
:desc=>
|
784
|
+
"These functions perform a single iteration of the solver s. If\n" +
|
785
|
+
"the iteration encounters an unexpected problem then an error code will\n" +
|
786
|
+
"be returned. The solver maintains a current estimate of the best-fit\n" +
|
787
|
+
"parameters at all times. "},
|
788
|
+
{:func_name=>"gsl_multifit_fdfsolver_iterate",
|
789
|
+
:func_type=>"int",
|
790
|
+
:args=>[["gsl_multifit_fdfsolver *", "s"]],
|
791
|
+
:desc=>
|
792
|
+
"These functions perform a single iteration of the solver s. If\n" +
|
793
|
+
"the iteration encounters an unexpected problem then an error code will\n" +
|
794
|
+
"be returned. The solver maintains a current estimate of the best-fit\n" +
|
795
|
+
"parameters at all times. "},
|
796
|
+
{:func_name=>"gsl_multifit_fdfridge_iterate",
|
797
|
+
:func_type=>"int",
|
798
|
+
:args=>[["gsl_multifit_fdfridge *", "s"]],
|
799
|
+
:desc=>
|
800
|
+
"These functions perform a single iteration of the solver s. If\n" +
|
801
|
+
"the iteration encounters an unexpected problem then an error code will\n" +
|
802
|
+
"be returned. The solver maintains a current estimate of the best-fit\n" +
|
803
|
+
"parameters at all times. "},
|
804
|
+
{:func_name=>"gsl_multifit_fsolver_position",
|
805
|
+
:func_type=>"gsl_vector *",
|
806
|
+
:args=>[["const gsl_multifit_fsolver *", "s"]],
|
807
|
+
:desc=>
|
808
|
+
"These functions return the current position x (i.e. best-fit\n" +
|
809
|
+
"parameters) of the solver s."},
|
810
|
+
{:func_name=>"gsl_multifit_fdfsolver_position",
|
811
|
+
:func_type=>"gsl_vector *",
|
812
|
+
:args=>[["const gsl_multifit_fdfsolver *", "s"]],
|
813
|
+
:desc=>
|
814
|
+
"These functions return the current position x (i.e. best-fit\n" +
|
815
|
+
"parameters) of the solver s."},
|
816
|
+
{:func_name=>"gsl_multifit_fdfridge_position",
|
817
|
+
:func_type=>"gsl_vector *",
|
818
|
+
:args=>[["const gsl_multifit_fdfridge *", "s"]],
|
819
|
+
:desc=>
|
820
|
+
"These functions return the current position x (i.e. best-fit\n" +
|
821
|
+
"parameters) of the solver s."},
|
822
|
+
{:func_name=>"gsl_multifit_fdfsolver_residual",
|
823
|
+
:func_type=>"gsl_vector *",
|
824
|
+
:args=>[["const gsl_multifit_fdfsolver *", "s"]],
|
825
|
+
:desc=>
|
826
|
+
"These functions return the current residual vector f of the\n" +
|
827
|
+
"solver s. For weighted cases, the residual vector includes the\n" +
|
828
|
+
"weighting factor \\sqrt{W}. For ridge regression, the residual\n" +
|
829
|
+
"vector is the augmented vector \\tilde{f}."},
|
830
|
+
{:func_name=>"gsl_multifit_fdfridge_residual",
|
831
|
+
:func_type=>"gsl_vector *",
|
832
|
+
:args=>[["const gsl_multifit_fdfridge *", "s"]],
|
833
|
+
:desc=>
|
834
|
+
"These functions return the current residual vector f of the\n" +
|
835
|
+
"solver s. For weighted cases, the residual vector includes the\n" +
|
836
|
+
"weighting factor \\sqrt{W}. For ridge regression, the residual\n" +
|
837
|
+
"vector is the augmented vector \\tilde{f}."},
|
838
|
+
{:func_name=>"gsl_multifit_fdfsolver_niter",
|
839
|
+
:func_type=>"size_t",
|
840
|
+
:args=>[["const gsl_multifit_fdfsolver *", "s"]],
|
841
|
+
:desc=>
|
842
|
+
"These functions return the number of iterations performed so far.\n" +
|
843
|
+
"The iteration counter is updated on each call to the\n" +
|
844
|
+
"_iterate functions above, and reset to 0 in the\n" +
|
845
|
+
"_set functions."},
|
846
|
+
{:func_name=>"gsl_multifit_fdfridge_niter",
|
847
|
+
:func_type=>"size_t",
|
848
|
+
:args=>[["const gsl_multifit_fdfridge *", "s"]],
|
849
|
+
:desc=>
|
850
|
+
"These functions return the number of iterations performed so far.\n" +
|
851
|
+
"The iteration counter is updated on each call to the\n" +
|
852
|
+
"_iterate functions above, and reset to 0 in the\n" +
|
853
|
+
"_set functions."},
|
854
|
+
{:func_name=>"gsl_multifit_fdfsolver_test",
|
855
|
+
:func_type=>"int",
|
856
|
+
:args=>
|
857
|
+
[["const gsl_multifit_fdfsolver *", "s"],
|
858
|
+
["const double", "xtol"],
|
859
|
+
["const double", "gtol"],
|
860
|
+
["const double", "ftol"],
|
861
|
+
["int *", "info"]],
|
862
|
+
:desc=>
|
863
|
+
"This function tests for convergence of the minimization method\n" +
|
864
|
+
"using the following criteria:\n" +
|
865
|
+
"\n" +
|
866
|
+
"\n" +
|
867
|
+
"If none of the tests succeed, info is set to 0 and the\n" +
|
868
|
+
"function returns GSL_CONTINUE, indicating further iterations\n" +
|
869
|
+
"are required.\n"},
|
870
|
+
{:func_name=>"gsl_multifit_test_delta",
|
871
|
+
:func_type=>"int",
|
872
|
+
:args=>
|
873
|
+
[["const gsl_vector *", "dx"],
|
874
|
+
["const gsl_vector *", "x"],
|
875
|
+
["double", "epsabs"],
|
876
|
+
["double", "epsrel"]],
|
877
|
+
:desc=>
|
878
|
+
"\n" +
|
879
|
+
"This function tests for the convergence of the sequence by comparing the\n" +
|
880
|
+
"last step dx with the absolute error epsabs and relative\n" +
|
881
|
+
"error epsrel to the current position x. The test returns\n" +
|
882
|
+
"GSL_SUCCESS if the following condition is achieved,\n" +
|
883
|
+
"\n" +
|
884
|
+
"|dx_i| < epsabs + epsrel |x_i|\n" +
|
885
|
+
"\n" +
|
886
|
+
"for each component of x and returns GSL_CONTINUE otherwise."},
|
887
|
+
{:func_name=>"gsl_multifit_test_gradient",
|
888
|
+
:func_type=>"int",
|
889
|
+
:args=>[["const gsl_vector *", "g"], ["double", "epsabs"]],
|
890
|
+
:desc=>
|
891
|
+
"This function tests the residual gradient g against the absolute\n" +
|
892
|
+
"error bound epsabs. Mathematically, the gradient should be\n" +
|
893
|
+
"exactly zero at the minimum. The test returns GSL_SUCCESS if the\n" +
|
894
|
+
"following condition is achieved,\n" +
|
895
|
+
"\n" +
|
896
|
+
"\\sum_i |g_i| < epsabs\n" +
|
897
|
+
"\n" +
|
898
|
+
"and returns GSL_CONTINUE otherwise. This criterion is suitable\n" +
|
899
|
+
"for situations where the precise location of the minimum, x,\n" +
|
900
|
+
"is unimportant provided a value can be found where the gradient is small\n" +
|
901
|
+
"enough."},
|
902
|
+
{:func_name=>"gsl_multifit_gradient",
|
903
|
+
:func_type=>"int",
|
904
|
+
:args=>
|
905
|
+
[["const gsl_matrix *", "J"],
|
906
|
+
["const gsl_vector *", "f"],
|
907
|
+
["gsl_vector *", "g"]],
|
908
|
+
:desc=>
|
909
|
+
"This function computes the gradient g of \\Phi(x) = (1/2)\n" +
|
910
|
+
"||f(x)||^2 from the Jacobian matrix J and the function values\n" +
|
911
|
+
"f, using the formula g = J^T f."},
|
912
|
+
{:func_name=>"gsl_multifit_fsolver_driver",
|
913
|
+
:func_type=>"int",
|
914
|
+
:args=>
|
915
|
+
[["gsl_multifit_fsolver *", "s"],
|
916
|
+
["const size_t", "maxiter"],
|
917
|
+
["const double", "epsabs"],
|
918
|
+
["const double", "epsrel"]],
|
919
|
+
:desc=>
|
920
|
+
"This function iterates the solver s for a maximum of maxiter\n" +
|
921
|
+
"iterations. After each iteration, the system is tested for convergence\n" +
|
922
|
+
"using gsl_multifit_test_delta with the error tolerances epsabs\n" +
|
923
|
+
"and epsrel."},
|
924
|
+
{:func_name=>"gsl_multifit_fdfsolver_driver",
|
925
|
+
:func_type=>"int",
|
926
|
+
:args=>
|
927
|
+
[["gsl_multifit_fdfsolver *", "s"],
|
928
|
+
["const size_t", "maxiter"],
|
929
|
+
["const double", "xtol"],
|
930
|
+
["const double", "gtol"],
|
931
|
+
["const double", "ftol"],
|
932
|
+
["int *", "info"]],
|
933
|
+
:desc=>
|
934
|
+
"These functions iterate the solver s for a maximum of maxiter\n" +
|
935
|
+
"iterations. After each iteration, the system is tested for convergence\n" +
|
936
|
+
"with the error tolerances xtol, gtol and ftol.\n" +
|
937
|
+
"Upon successful convergence,\n" +
|
938
|
+
"the function returns GSL_SUCCESS and sets info to\n" +
|
939
|
+
"the reason for convergence (see gsl_multifit_fdfsolver_test).\n" +
|
940
|
+
"Otherwise, the function returns GSL_EMAXITER indicating\n" +
|
941
|
+
"the system did not converge after maxiter iterations."},
|
942
|
+
{:func_name=>"gsl_multifit_fdfridge_driver",
|
943
|
+
:func_type=>"int",
|
944
|
+
:args=>
|
945
|
+
[["gsl_multifit_fdfridge *", "s"],
|
946
|
+
["const size_t", "maxiter"],
|
947
|
+
["const double", "xtol"],
|
948
|
+
["const double", "gtol"],
|
949
|
+
["const double", "ftol"],
|
950
|
+
["int *", "info"]],
|
951
|
+
:desc=>
|
952
|
+
"These functions iterate the solver s for a maximum of maxiter\n" +
|
953
|
+
"iterations. After each iteration, the system is tested for convergence\n" +
|
954
|
+
"with the error tolerances xtol, gtol and ftol.\n" +
|
955
|
+
"Upon successful convergence,\n" +
|
956
|
+
"the function returns GSL_SUCCESS and sets info to\n" +
|
957
|
+
"the reason for convergence (see gsl_multifit_fdfsolver_test).\n" +
|
958
|
+
"Otherwise, the function returns GSL_EMAXITER indicating\n" +
|
959
|
+
"the system did not converge after maxiter iterations."},
|
960
|
+
{:func_name=>"gsl_multifit_fdfsolver_jac",
|
961
|
+
:func_type=>"int",
|
962
|
+
:args=>[["gsl_multifit_fdfsolver *", "s"], ["gsl_matrix *", "J"]],
|
963
|
+
:desc=>
|
964
|
+
"This function stores the n-by-p Jacobian matrix for the\n" +
|
965
|
+
"current iteration of the solver s into the output J."},
|
966
|
+
{:func_name=>"gsl_multifit_covar",
|
967
|
+
:func_type=>"int",
|
968
|
+
:args=>
|
969
|
+
[["const gsl_matrix *", "J"],
|
970
|
+
["const double", "epsrel"],
|
971
|
+
["gsl_matrix *", "covar"]],
|
972
|
+
:desc=>
|
973
|
+
"This function computes the covariance matrix of best-fit parameters\n" +
|
974
|
+
"using the Jacobian matrix J and stores it in covar.\n" +
|
975
|
+
"The parameter epsrel is used to remove linear-dependent columns\n" +
|
976
|
+
"when J is rank deficient.\n" +
|
977
|
+
"\n" +
|
978
|
+
"The covariance matrix is given by,\n" +
|
979
|
+
"\n" +
|
980
|
+
"covar = (J^T J)^@{-1@}\n" +
|
981
|
+
"\n" +
|
982
|
+
"or in the weighted case,\n" +
|
983
|
+
"\n" +
|
984
|
+
"covar = (J^T W J)^@{-1@}\n" +
|
985
|
+
"\n" +
|
986
|
+
"and is computed by QR decomposition of J with column-pivoting. Any\n" +
|
987
|
+
"columns of R which satisfy \n" +
|
988
|
+
"\n" +
|
989
|
+
"|R_@{kk@}| <= epsrel |R_@{11@}|\n" +
|
990
|
+
"\n" +
|
991
|
+
"are considered linearly-dependent and are excluded from the covariance\n" +
|
992
|
+
"matrix (the corresponding rows and columns of the covariance matrix are\n" +
|
993
|
+
"set to zero).\n" +
|
994
|
+
"\n" +
|
995
|
+
"If the minimisation uses the weighted least-squares function\n" +
|
996
|
+
"f_i = (Y(x, t_i) - y_i) / \\sigma_i then the covariance\n" +
|
997
|
+
"matrix above gives the statistical error on the best-fit parameters\n" +
|
998
|
+
"resulting from the Gaussian errors \\sigma_i on \n" +
|
999
|
+
"the underlying data y_i. This can be verified from the relation \n" +
|
1000
|
+
"\\delta f = J \\delta c and the fact that the fluctuations in f\n" +
|
1001
|
+
"from the data y_i are normalised by \\sigma_i and \n" +
|
1002
|
+
"so satisfy $\\langle \\delta f \\delta f^T \\rangle = I$\n" +
|
1003
|
+
"<\\delta f \\delta f^T> = I.\n" +
|
1004
|
+
"\n" +
|
1005
|
+
"For an unweighted least-squares function f_i = (Y(x, t_i) -\n" +
|
1006
|
+
"y_i) the covariance matrix above should be multiplied by the variance\n" +
|
1007
|
+
"of the residuals about the best-fit \\sigma^2 = \\sum (y_i - Y(x,t_i))^2 / (n-p)\n" +
|
1008
|
+
"to give the variance-covariance\n" +
|
1009
|
+
"matrix \\sigma^2 C. This estimates the statistical error on the\n" +
|
1010
|
+
"best-fit parameters from the scatter of the underlying data.\n" +
|
1011
|
+
"\n" +
|
1012
|
+
"For more information about covariance matrices see Fitting Overview."}]
|