Re: Method->NMinimize in FindFit Crashes the Kernel
- To: mathgroup at smc.vnet.net
- Subject: [mg89588] Re: Method->NMinimize in FindFit Crashes the Kernel
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 14 Jun 2008 05:28:07 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <g2qhi6$8p3$1@smc.vnet.net>
Kezhao Zhang wrote:
> I am running Mathematica 6.0.2.1 on 32-bit Windows Vista with 3GB of
> RAM. The following code crashes the Kernel:
>
> x = Range[1, 10, 0.01];
>
> y = Exp[-0.1 x];
>
> FindFit[Thread[{x, y}], 1 - 1/2 Erfc[(m - Log[t])/(Sqrt[2] s)], {s,
> m}, t, Method -> NMinimize]
>
>
> FindFit with Method->NMinize works fine when the number of data points
> is small, e.g., x=Range[1,10,0.1].
>
> I wonder whether this is a bug or there is a way to prevent the
> kernel crash.
FWIW,
Works fine on my system (Mac OSX 10.5.3 64=bit 4GB Mathematica 6.0.2)
and it does not consume more than about 1.7GB. If you are sure that more
than 2GB are accessible for a user process, you may have an issue with
memory fragmentation.
In[1]:= mmu = MaxMemoryUsed[];
x = Range[1, 10, 0.01];
y = Exp[-0.1 x];
FindFit[Thread[{x, y}],
1 - 1/2 Erfc[(m - Log[t])/(Sqrt[2] s)], {s, m}, t,
Method -> NMinimize] // Timing
MaxMemoryUsed[] - mmu
Out[4]= {16.3132, {m -> 1.92446, s -> 1.29603}}
Out[5]= 18446744004306070168
Regards,
-- Jean-Marc