Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Matrix Minimization

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99801] Re: Matrix Minimization
  • From: "Steve Luttrell" <steve at _removemefirst_luttrell.org.uk>
  • Date: Fri, 15 May 2009 04:16:35 -0400 (EDT)
  • References: <gue2j0$7kd$1@smc.vnet.net> <gugaqf$egm$1@smc.vnet.net> <gugcb9$fjk$1@smc.vnet.net>

To solve your particular problem you need to first use that log det M = 
trace log M.

You will have to teach Mathematica the rules that it needs in order to 
represent and manipulate your expression.

For instance, you could define (your posting was a bit garbled so I might 
not have accurately transcribed the expression for your matrix.)

mat[a_] :=
  prod[ex] + prod[a, es, trans[a]] + prod[a, ep, trans[a]] +
   prod[ex, trans[h]] + prod[a, es, trans[h]] + prod[h, ex] +
   prod[h, es, trans[a]] + prod[h, ex, trans[h]] +
   prod[h, es, trans[h]] + prod[eq];

which introduces prod and trans which represent

prod[x1,x2,...] is the matrix product x1.x2...
trans[x] is the matrix transpose of x

Make two further definitions in order to do simple manipulations on prod and 
trans.

trans[x_ + y_] := trans[x] + trans[y];

prod[u___, x_ + y_, v___] := prod[u, x, v] + prod[u, y, v];

Now we are ready to differentiate mat[a] w.r.t. a.

mat[a + da] - mat[a]

yields

prod[a, ep, trans[da]] + prod[a, es, trans[da]] +
 prod[da, ep, trans[a]] + prod[da, ep, trans[da]] +
 prod[da, es, trans[a]] + prod[da, es, trans[da]] +
 prod[da, es, trans[h]] + prod[h, es, trans[da]]

and so on...

Variations on this general theme, where you make Mathematica definitions to 
push the calculation along in the direction you would have followed "by 
hand", will eventually solve your problem.

It is a good idea to read up all about Mathematica patterns before you try 
this approach.

-- 
Stephen Luttrell
West Malvern, UK

"math.mud.mad" <math.mud.mad at gmail.com> wrote in message 
news:gugcb9$fjk$1 at smc.vnet.net...
> On May 14, 2:39 pm, dh <d... at metrohm.com> wrote:
>> Hi,
>>
>> you may minimize a real scalar but not a matrix. However, what you can
>>
>> do is to minimize some measure like a Norm of the matrix.
>>
>> Towards this aim, you will have to calculate e.g. Norm[] and then
>>
>> minimize it.
>>
>> Daniel
>>
>> math.mud.... at gmail.com wrote:
>> > Hi ,
>>
>> > i would like to minimize the following matrix  M with respect to A.
>>
>> > M=  E_X + A E_S A' + A E_P A'        E_X H' +A E_S H'
>> >        H E_X + H E_S A'                 H E_X H=
> ' + H E_S H' + E_Q
>>
>> > where E_X, E_S, E_P and E_Q are covariance matrices..
>>
>> > can we do matrix optimization in mathematica?
>>
>> > thanks a lot..
>
> Hi Daniel,
>
> sorry for my mistake. i want to optimize log det (M) with respect to
> A. can i use mathematica for that?
>
> regards,
> 



  • Prev by Date: Re: Re: Introducing the Wolfram Mathematica Tutorial
  • Next by Date: Re: Introducing the Wolfram Mathematica Tutorial
  • Previous by thread: Re: Matrix Minimization
  • Next by thread: GuiKit, seeking some guidance and comments