[Feature Request] Documentation of Nelder-Mead method
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- fsharp
- Domain
- documentation
Research direction
Start with the NelderMead.NmConfig and OptimizationStop.defaultStopCriteria entry points shown in the reproduction, and inspect the existing documentation structure for where their fields are described. Document the relevant configuration and stop-criterion fields so the example's near-minimum result and possible adjustments are understandable.
Written by the indexing model from the issue text.
Description
Problem
When Nelder-Mead method is applied to a simple quadratic polynomial, the minimization is unable to identify the minimum. It is quite close, but the modification of StopCriterion or the NmConfig isn't trivial without further documentation.
Solution
Description of the fields in the documentation.
Steps to reproduce
#r "nuget: Plotly.NET"
#r "nuget: FSharp.Stats, 0.4.12-preview.2"
open FSharp.Stats
open FSharp.Stats.Optimization
open System
open Plotly.NET
let myFunction (xs: vector) =
let x = xs.[0]
x**2. - 0.32*x - 0.13
// initial guess for the optimization
let x0 = vector [| -0.3 |]
// default solver options
let nmc = NelderMead.NmConfig.defaultInit()
// optimization procedure
let optim =
//let stopCrit =
// { OptimizationStop.defaultStopCriteria with MinFunctionEpsilon = 1e-24 }
//NelderMead.minimizeWithStopCriteria nmc x0 myFunction stopCrit
NelderMead.minimize nmc x0 myFunction
(*
optim.Vectors just contains 3 valid vectors
*)
let validVectors = 3
// optimization results as x, y, and z coordinate
let xs,ys =
optim.Vectors.[0..validVectors - 1] |> Array.map (fun x -> x.[0],myFunction x)
|> Array.unzip
let optimizationPathchart =
[
[-1. .. 0.005 .. 1.] |> List.map (fun x -> x,myFunction (vector [x])) |> Chart.Line
Chart.Line(x=xs,y=ys,ShowMarkers=true,Name="Optimization path")
Chart.Point([optim.SolutionVector.[0],optim.Solution],Name="Solution")
]
|> Chart.combine
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle ("x",ShowGrid=false)
|> Chart.withYAxisStyle ("myFunction(x)",ShowGrid=false)
|> Chart.withSize (800.,800.)
Chart.show optimizationPathchart

- Dominant language
- F#
- Stars
- 228
- Forks
- 58
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fslaborg/FSharp.Stats
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fslaborg/FSharp.Stats#385 · 2 comments ·
-
automation Documentation repo-assist
Difficulty 4/5 3-5 days Newbie friendliness 20/100
fslaborg/FSharp.Stats#390 ·
-
automation Documentation repo-assist
Difficulty 1/5 Under an hour Newbie friendliness 1/100
fslaborg/FSharp.Stats#382 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
fslaborg/FSharp.Stats#355 · 18 comments ·
-
enhancement needs investigation
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fslaborg/FSharp.Stats#344 · 4 comments ·
All issues in fslaborg/FSharp.Stats
Similar issues
-
Table: Space fires onActivate in single-selection mode — the reference doc and the JSDoc disagreeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sidorares/react-x11-components#764 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 71/100
t4t5/omdrop-owl#14 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 91/100
githubnext/gh-aw-workshop#4458 ·
Maintainers usually reply within 1 day
-
netbox status: needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
netbox-community/netbox#23376 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
wso2/docs-api-platform#529 ·
Maintainers usually reply within 1 day