solveLP

91 views
Skip to first unread message

CaseyB66

unread,
Dec 18, 2014, 10:09:09 PM12/18/14
to nume...@googlegroups.com
Not sure I understand what solveLP does from the very brief documentation. I am trying to find optimal parameters for a modeling problem, where the model is matching a time series of y-values by applying a f(m, tau, int, slope) on a set of x-values, where m, tau, int, and slope are adjustable parameters that need to be optimized to minimize the sum square error between the y-value observations and the model output (based on x-values). I am looking for a simplex or gradient search method. Not sure I see that in numeric.js...

Toby Schachman

unread,
Dec 19, 2014, 3:19:57 PM12/19/14
to nume...@googlegroups.com
Numeric's uncmin should work for you. Write a function called objective that takes as a single parameter an array of [m, tau, int, slope] and returns a sum of squares error value. Then call uncmin(objective, [...]) where the second parameter is an initial guess for the search. That will return an object with information about the search, you'll probably just need the solution key.

That said, I would love if there were more information/documentation about how uncmin and some of the other fancy algorithms in numeric work! Does whoever wrote these functions have notes they could publish, even about just what the abbreviated variable names in the source mean? Or is it a port of an existing implementation that has such notes?

uncmin is the only numeric function I really rely on that I don't really understand how it works!


On Thursday, December 18, 2014, CaseyB66 <nekkceb...@gmail.com> wrote:
Not sure I understand what solveLP does from the very brief documentation. I am trying to find optimal parameters for a modeling problem, where the model is matching a time series of y-values by applying a f(m, tau, int, slope) on a set of x-values, where m, tau, int, and slope are adjustable parameters that need to be optimized to minimize the sum square error between the y-value observations and the model output (based on x-values). I am looking for a simplex or gradient search method. Not sure I see that in numeric.js...

--
You received this message because you are subscribed to the Google Groups "numericjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numericjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Owen Densmore

unread,
Dec 19, 2014, 6:08:36 PM12/19/14
to nume...@googlegroups.com
Interesting that many of us don't understand some of the functionality of NumericJS.  I'm running into the same problem in http://agentscript.org .. its hard to document.

I settled, for now, on Docco, where comments in the source turn into fairly nice documentation.

The tension is between API documentation, how users interact with the package, and developer documentation.  I think the latter is better for libraries like Numeric, it exposes how it works and the rational for the architecture.

Maybe we oughta help out and document the code via Docco?
BTW: when you look at the page, you're seeing Knuth's "Literate Programming" where the document is actually compiled!  The more usual documentation is simpler, code comments turned into markdown or html.

   -- Owen

Sébastien Loisel

unread,
Dec 19, 2014, 11:37:28 PM12/19/14
to nume...@googlegroups.com
Hi,

I don't have notes about the functions.

uncmin searches for a minimum using a damped Newton iteration. This requires a Hessian and a gradient. If the user does not provide a Hessian and a gradient, a numerical approximation is used.

solveLP is a standard logarithmic barrier method for linear programming.

In principle, numeric.eig is a standard Francis QR iteration but it's got some bugs I need to fix.

In principle, numeric.svd is some standard version of Gene Golub's adaptation of the Francis QR algorithm but I didn't write it.

Thanks,
--
Sébastien Loisel
Assistant Professor
Department of Mathematics, Heriot-Watt University
Riccarton, EH14 4AS, United Kingdom
web: http://www.ma.hw.ac.uk/~loisel/
email: S.Loisel at hw.ac.uk
phone: +44 131 451 3234
fax: +44 131 451 3249

Reply all
Reply to author
Forward
0 new messages