Robert,
It's an interesting problem. It appears that computing the parameters via
lbfgs succeeds; if lbfgs can make progress, it always decreases the
figure of merit, otherwise it stops with an error message. That is a very
useful behavior, because it prevents endless looping without progress.
Probably what we should do is to replace mnewton with lbfgs in lsquares.
Anyway, if I'm not mistaken, the following approach seems to succeed.
I'm working with Maxima 5.10.0cvs + GCL 2.6.7 + Linux.
load (descriptive);
load (numericalio);
load (lbfgs);
m : read_matrix("/tmp/WLF-all-const-pressure-multivar-60-200.txt");
dataplot (m);
(dataplot shows pairwise scatterplots of the columns of m.)
FOM : '(sum ((F (m[i, 1], m[i, 2], m[i, 3]) - m[i, 4])^2, i, 1,
length(m)) / length(m));
F (T, g, n) := 0.01 * g * (a1 * T + b1) + 0.01 * n * (a2 * T + b2) +
0.01 * (1 - 0.01 * (g + n)) * (a3 * T + b3);
(F is one of the functions you specified)
estimates : lbfgs (FOM, '[a1,a2,a3,b1,b2,b3], [1, 1, 1, 1, 1, 1], 1e-5, [1, 0]);
(that returns a list like [a1 = ..., a2 = ..., a3 = ..., ...].
In the progress messages, "FUNC" is the FOM, i.e., (1/n) times (sum of squares).
Final FOM = 1.82d-5.)
X : addcol (col (m, 1), col (m, 2), col (m, 3));
Y : map (lambda ([r], [apply (F, r)]), X), ''estimates; /* quote-quote
here, not double-quote */
XY : addcol (X, Y);
dataplot (XY);
HTH
Robert Dodier