Know of an optimization library (e.g. implementing least squares, etc) for Javascript?
Asked Answered
L

2

6

Anyone know of an equivalent to (at least part of) scipy.optimize implemented in javascript? I'm trying to fit various distributions (e.g. skew normal) to quantiles, but I've needed an optimization library before.

Listen answered 12/6, 2012 at 20:35 Comment(0)
S
5

I recently ported the derivative-free non-linear constrained optimization code COBYLA2 to Java, and Reinhard Oldenburg at the University of Frankfurt in his turn converted this code into Javascript. The Javascript code, together with a self explanatory test HTML file, can be downloaded here.

Sen answered 12/6, 2012 at 20:45 Comment(1)
Wow: awesome! For anyone coming from SciPy, this appears to be directly equivalent to scipy.optimize.fmin_powell (which, incidentally, is implemented using COBYLA2).Listen
B
0

Here is an Observable notebook that implements nonlinear regression with bounds in JavaScript. The modified ''fminsearch.js'' function used in this notebook is based on the original implementation by Jonas Almeida, which can be found on GitHub.

You can explore the notebook at the following link: https://observablehq.com/@christophe-yamahata/nonlinear-regression-with-bounds-in-javascript

For comparison, the above URL also provides a Python script that uses least squares optimization from the SciPy library.

Baking answered 27/5, 2024 at 11:42 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewCarbolize

© 2022 - 2025 — McMap. All rights reserved.