Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Feature Request] Documentation of Nelder-Mead method

Closed
#260 2 comments 0 reactions 0 assignees View on GitHub

@github-actions is already working on this.

Since Apr 18, 2026.

  • #377 by @github-actions — open

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

Documentation

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

image

Dominant language
F#
Stars
228
Forks
58
Avg merge
2d 7h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fslaborg/FSharp.Stats

All issues in fslaborg/FSharp.Stats

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.