Current section

Files

Jump to
gleastsq src gleastsq.erl
Raw

src/gleastsq.erl

-module(gleastsq).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([least_squares/5, levenberg_marquardt/5, gauss_newton/5, trust_region_reflective/7]).
-spec least_squares(
list(float()),
list(float()),
fun((float(), list(float())) -> float()),
list(float()),
list(gleastsq@options:least_square_options())
) -> {ok, list(float())} | {error, gleastsq@errors:fit_errors()}.
least_squares(X, Y, Func, Initial_params, Opts) ->
gleastsq@internal@methods@levenberg_marquardt:levenberg_marquardt(
X,
Y,
Func,
Initial_params,
gleastsq@internal@params:decode_params(Opts)
).
-spec levenberg_marquardt(
list(float()),
list(float()),
fun((float(), list(float())) -> float()),
list(float()),
list(gleastsq@options:least_square_options())
) -> {ok, list(float())} | {error, gleastsq@errors:fit_errors()}.
levenberg_marquardt(X, Y, Func, Initial_params, Opts) ->
gleastsq@internal@methods@levenberg_marquardt:levenberg_marquardt(
X,
Y,
Func,
Initial_params,
gleastsq@internal@params:decode_params(Opts)
).
-spec gauss_newton(
list(float()),
list(float()),
fun((float(), list(float())) -> float()),
list(float()),
list(gleastsq@options:least_square_options())
) -> {ok, list(float())} | {error, gleastsq@errors:fit_errors()}.
gauss_newton(X, Y, Func, Initial_params, Opts) ->
gleastsq@internal@methods@gauss_newton:gauss_newton(
X,
Y,
Func,
Initial_params,
gleastsq@internal@params:decode_params(Opts)
).
-spec trust_region_reflective(
list(float()),
list(float()),
fun((float(), list(float())) -> float()),
list(float()),
gleam@option:option(list(float())),
gleam@option:option(list(float())),
list(gleastsq@options:least_square_options())
) -> {ok, list(float())} | {error, gleastsq@errors:fit_errors()}.
trust_region_reflective(
X,
Y,
Func,
Initial_params,
Lower_bounds,
Upper_bounds,
Opts
) ->
gleastsq@internal@methods@trust_region_reflective:trust_region_reflective(
X,
Y,
Func,
Initial_params,
Lower_bounds,
Upper_bounds,
gleastsq@internal@params:decode_params(Opts)
).