Skip to content

Commit

Permalink
Nelder_mead: added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Mar 16, 2022
1 parent 7d32744 commit e505f14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/nelder_mead.ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
(**
Implements method as described in https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method
some tests from original publication:
A simplex method for function minimization
J. A. Nelder and R. Mead
*)
open Core_kernel

let centroid xs =
Expand Down Expand Up @@ -124,4 +117,3 @@ let%test "Powell quartic" =
let sample () = Array.init 4 ~f:rfloat in
let obj, _, _ = minimize ~f ~sample () in
Float.(abs obj < 1e-3)

11 changes: 11 additions & 0 deletions lib/nelder_mead.mli
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
(** An implementation of Nelder-Mead algorithm for function
optimization
Implements method as described in
{{:https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method}Wikipedia}
and uses some tests from the original publication:
A simplex method for function minimization
J. A. Nelder and R. Mead
*)

(** Minimizes cost function [f].
[sample] function must return a vector of initial parameters.
Returns the minimum value of [f], the vector of optimized parameters,
Expand Down

0 comments on commit e505f14

Please sign in to comment.