You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"openFSharp.StatsopenFSharp.Stats.OptimizationopenSystemopenPlotly.NETletmyFunction(xs:vector)=letx= xs.[0]
x**2.-0.32*x -0.13// initial guess for the optimizationletx0= vector [|-0.3|]// default solver optionsletnmc= NelderMead.NmConfig.defaultInit()// optimization procedureletoptim=//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*)letvalidVectors=3// optimization results as x, y, and z coordinateletxs,ys =
optim.Vectors.[0..validVectors -1]|> Array.map (fun x -> x.[0],myFunction x)|> Array.unzip
letoptimizationPathchart=[[-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
The text was updated successfully, but these errors were encountered:
The problem at the current state is the negative part of the objective function. If a step during the optimization hits a negative value, the procedure is stopped immediately. A fix for this is in preparation
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 theNmConfig
isn't trivial without further documentation.Solution
Description of the fields in the documentation.
Steps to reproduce
The text was updated successfully, but these errors were encountered: