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([levenberg_marquardt/5, least_squares/5]).
-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@levenberg_marquardt:levenberg_marquardt(
X,
Y,
Func,
Initial_params,
gleastsq@internal@params:decode_params(Opts)
).
-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@least_squares:least_squares(
X,
Y,
Func,
Initial_params,
gleastsq@internal@params:decode_params(Opts)
).