Indeed, I do have this overflow there. Interesting. Maybe I should try
substituting all arbitrary values for some sort of smallest-possible
floating point value? But then I could get an underflow, right? All of
the parameters I use are of positive exponents, so I shouldn't get
overflows this way... let me think about it for a second.
But really, the problem is that lsquares is marking those values as
arbitrary. It's using newton-raphson after all - it should have some
internal state where those "arbitrary" values do compute to something.
Is there a way to get those out? Maybe I could use a different solver?
The whole point of this program is that I have a statistical series,
and a list of functions that I fit against the data using lsquares:
FC: [] $
FC: endcons(["a_a", [a, b ], y = a^2 * (x)^0.5 + b], FC) $
FC: endcons(["a_b", [a, b ], y = a^2 * (x ) + b], FC) $
FC: endcons(["a_c", [a, b, u], y = a^2 * (x - u)^2 + b], FC) $
FC: endcons(["a_d", [a, b, u], y = a^2 * (x - u)^3 + b], FC) $
FC: endcons(["a_e", [a, b ], y = a^2 * (x )^4 + b], FC) $
FC: endcons(["b_a", [a, b], y = a^2 * log(0.0001 + x^2) + b], FC) $
FC: endcons(["b_b", [a, b], y = a^2 * x^0.5 * log(0.0001 + x^2) + b], FC) $
FC: endcons(["b_c", [a, b], y = a^2 * x * log(0.0001 + x^2) + b], FC) $
FC: endcons(["b_d", [a, b], y = a^2 * x^2 * log(0.0001 + x^2) + b], FC) $
FC: endcons(["c_a", [a, b, c], y = a^2 * exp(b * x) + c], FC) $
/*FC: endcons(["c_b", [a, b, c], y = a^2 * x^0.5 * exp(b * x) + c], FC) $*/
FC: endcons(["c_c", [a, b, c], y = a^2 * x * exp(b * x) + c], FC) $
FC: endcons(["c_d", [a, b, c], y = a^2 * x^2 * exp(b * x) + c], FC) $
There are some issues with lsquares already - for example it doesn't
allow you to narrow down the search space, that's why I have to use
e.g. "a^2" and not just "a" above. Maybe there's something "better"
than lsquares?
Another idea - which I will try now - follows:
The overflows I got in this example are from the integral. Maybe if I
get numerize the values (the guessed parameters, in this case a and b)
before the integral is calculated, then the integral could "work".
Stavros, here's an example input that "breaks":
((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19)
+(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19))
/%r19^2,[%r18 = 1.1, %r19 = 1.1];
$ maxima
Maxima 5.25.1 http://maxima.sourceforge.net
using Lisp SBCL 1.0.29.11.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19)
+(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19))
/%r19^2,[%r18 = 1.1, %r19 = 1.1];
Maxima encountered a Lisp error:
arithmetic error FLOATING-POINT-OVERFLOW signalled
Automatically continuing.
Thanks for the very useful responses so far guys.
On Thu, Nov 10, 2011 at 16:27, Richard Fateman
<fateman at eecs.berkeley.edu> wrote:
>
>
> In the example output you provided, you have the sub-expression
> %e^(1000*%r19).
> If %r19 = 1, ? this cannot be computed in double float. ?It is about 1.97 x
> 10^434.
> The largest double float is about 1.8 x 10 ^ 308.
>
> Good luck.
>
> PS
> In the future, it would be good if you could provide exactly the commands
> you use, so someone else could try to duplicate your problem.
>