Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: global fit

  • To: mathgroup at
  • Subject: [mg57572] Re: Re: global fit
  • From: "Pascal" <Pascal.Plaza at>
  • Date: Wed, 1 Jun 2005 06:02:35 -0400 (EDT)
  • References: <><d7bj84$ojm$>
  • Sender: owner-wri-mathgroup at

In fact, let's define a "fitting" matrix depending on two parameters:
imax = 6;
fT[t1_, t2_] = {Table[Exp[-i/t1], {i, 0, imax}], Table[Exp[-i/t2], {i,
0, imax}]};

and create a data matrix (U = B0.fT[t10, t20] + noise) like this :
t10 = 0.5;
t20 = 4;
jmax = 12;
B0 = Table[Random[], {j, 1, jmax}, {k, 1, 2}];
T0 = fT[t10, t20];
noise = 0.03 Table[Random[], {j, 1, jmax}, {i, 0, imax}];
U = B0.T0 + noise;

Knowing U, I want to find t1, t2 and B in order to minimize U -
B.fT[t1,t2], hence to minimize:
h[t1_, t2_] := (
    T = fT[t1, t2];
    invT = PseudoInverse[T];
    B = U.invT;
    residue = U - B.T;
Indeed, FindMinimum[h[x, y],{x,0.6},{y,6}] works fine. It more or less
gives t1=t10 and t2=t20, as expected.

The problem comes when the dimensions are a lot larger, like:
imax = 60;
jmax = 500;
t10 = 5;
t20 = 40;
Then rapidly all the memory available is used even if I only try
FindMinimum along one coordinate at a time.

Maybe at each step does the Kernel create too many new big matrices and
gets overloaded?
Would there be a way to write this in a better way?

Many thanks.

  • Prev by Date: Re: opposite of partition
  • Next by Date: angry FindMinimum
  • Previous by thread: Re: Two related question. Question 1
  • Next by thread: angry FindMinimum