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