can you/Matlab show me how to find vector differentiation?



 Science > Physics > can you/Matlab show me how to find vector differentiation?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: Science > Physics
User: "kiki"
Date: 24 Nov 2004 01:34:03 PM
Object: can you/Matlab show me how to find vector differentiation?
Hi all,
I want to find the symbolic differentiation of the following term:
(w'*B*w)/(w'*A*w)
where w is a column vector, A and B are symmetrical matrices, w' denotes
transpose...
I want to find the second order differentiation of the above term
symbolically, w.r.t. the vector w... can Matlab do that?
By the way, if anybody knows smart techniques about how to find the second
differentiation of the above term by hand... please teach me ...
Thank you so much!
.

User: "Randy Poe"

Title: Re: can you/Matlab show me how to find vector differentiation? 24 Nov 2004 05:49:37 PM
If you're unsure about using vector expressions, work it out in
component form.
w'Aw = sum(i,j) A_ij * w_i*w_j
Now use the rule for derivative of a quotient to find the derivative
of your expression. Repeat for second derivatives.
If you want to try it in vector form, note that the gradient of
w'Aw is 2A_s*w, the gradient of v'w is v where v is some vector,
and the Hessian of w'Aw is 2A_s, where A_s is the symmetric
part of A.
- Randy
.

User: "Bjoern Feuerbacher"

Title: Re: can you/Matlab show me how to find vector differentiation? 25 Nov 2004 03:54:51 AM
kiki wrote:

Hi all,

I want to find the symbolic differentiation of the following term:

(w'*B*w)/(w'*A*w)

where w is a column vector, A and B are symmetrical matrices, w' denotes
transpose...

I want to find the second order differentiation of the above term
symbolically, w.r.t. the vector w... can Matlab do that?

By the way, if anybody knows smart techniques about how to find the second
differentiation of the above term by hand... please teach me ...

Let's see if I understand you correctly - you probably want to
find the Hessian matrix (the matrix containing the second derivatives
wrt the vector components)?
I don't know about Matlab, but I think the calculation is not that
hard to do by hand. For the first derivative, you obviously have
to use the quotient rule. The derivative of the numerator wrt
w_j gives two times the j-component of the product B*w,
the derivative of the denominator wrt w_j gives two times the
j-component of the product A*w. So the first derivative wrt
w_j is (B*w * w'*A*w - w'*B*w * A*w)/(w'*A*w)^2. Obtaining the
second derivative looks ugly, but is entirely feasible then.
HTH.
Bye,
Bjoern
.
User: "kiki"

Title: Help! Re: can you/Matlab show me how to find vector differentiation? 26 Nov 2004 02:10:40 AM
"Bjoern Feuerbacher" <feuerbac@thphys.uni-heidelberg.de> wrote in message
news:co4a5b$49j$1@news.urz.uni-heidelberg.de...

kiki wrote:

Hi all,

I want to find the symbolic differentiation of the following term:

(w'*B*w)/(w'*A*w)

where w is a column vector, A and B are symmetrical matrices, w' denotes
transpose...

I want to find the second order differentiation of the above term
symbolically, w.r.t. the vector w... can Matlab do that?

By the way, if anybody knows smart techniques about how to find the
second differentiation of the above term by hand... please teach me ...


Let's see if I understand you correctly - you probably want to
find the Hessian matrix (the matrix containing the second derivatives wrt
the vector components)?

I don't know about Matlab, but I think the calculation is not that
hard to do by hand. For the first derivative, you obviously have
to use the quotient rule. The derivative of the numerator wrt
w_j gives two times the j-component of the product B*w,
the derivative of the denominator wrt w_j gives two times the
j-component of the product A*w. So the first derivative wrt
w_j is (B*w * w'*A*w - w'*B*w * A*w)/(w'*A*w)^2. Obtaining the
second derivative looks ugly, but is entirely feasible then.

HTH.


Bye,
Bjoern

Hi Bjoern,
thanks a lot.
Woud you mind showing me how to do taking one more derivative of that
expression:
(B*w * w'*A*w - w'*B*w * A*w)/(w'*A*w)^2 ?
A, B are symmetrical.
Specifically, the first derivative is in fact a row vector:
((w'*A*w)*(w'*B) - (w'*B*w) *(w'*A)))/(w'*A*w)^2 ?
Now how do you do derivitive of
(w'*A*w)*(w'*B) ???
I do the following:
Taking deriviative of w'*A*w = 2 w'*A
Taking derivative of w'*B = B
I should do
D{(w'*A*w)*(w'*B)}=D{(w'*A*w)}*(w'*B) + (w'*A*w)*D{(w'*B)}
but D{(w'*A*w)}*(w'*B) = 2 (w'*A)*(w'*B)
it even does not pass the syntax check of matrix multiplication...
What can I do?
.
User: "Peter Spellucci"

Title: Re: Help! Re: can you/Matlab show me how to find vector differentiation? 26 Nov 2004 05:10:24 AM
In article <co6oe1$p1n$1@news.Stanford.EDU>,
"kiki" <lunaliu3@yahoo.com> writes:


"Bjoern Feuerbacher" <feuerbac@thphys.uni-heidelberg.de> wrote in message
news:co4a5b$49j$1@news.urz.uni-heidelberg.de...

kiki wrote:

Hi all,

I want to find the symbolic differentiation of the following term:

(w'*B*w)/(w'*A*w)

where w is a column vector, A and B are symmetrical matrices, w' denotes
transpose...

I want to find the second order differentiation of the above term
symbolically, w.r.t. the vector w... can Matlab do that?

By the way, if anybody knows smart techniques about how to find the
second differentiation of the above term by hand... please teach me ...


Let's see if I understand you correctly - you probably want to
find the Hessian matrix (the matrix containing the second derivatives wrt
the vector components)?

I don't know about Matlab, but I think the calculation is not that
hard to do by hand. For the first derivative, you obviously have
to use the quotient rule. The derivative of the numerator wrt
w_j gives two times the j-component of the product B*w,
the derivative of the denominator wrt w_j gives two times the
j-component of the product A*w. So the first derivative wrt
w_j is (B*w * w'*A*w - w'*B*w * A*w)/(w'*A*w)^2. Obtaining the
second derivative looks ugly, but is entirely feasible then.

HTH.


Bye,
Bjoern


Hi Bjoern,

thanks a lot.

Woud you mind showing me how to do taking one more derivative of that
expression:

(B*w * w'*A*w - w'*B*w * A*w)/(w'*A*w)^2 ?

A, B are symmetrical.

Specifically, the first derivative is in fact a row vector:

((w'*A*w)*(w'*B) - (w'*B*w) *(w'*A)))/(w'*A*w)^2 ?

the derivative of a scalar with respect to a vector is a row.
but in order to get the Hessain, rmember that the Hessian is the
Jacobian of the gradient and the gradient is the transposed Jacobian


Now how do you do derivitive of

(w'*A*w)*(w'*B) ???


I do the following:

Taking deriviative of w'*A*w = 2 w'*A

Taking derivative of w'*B = B

I should do

D{(w'*A*w)*(w'*B)}=D{(w'*A*w)}*(w'*B) + (w'*A*w)*D{(w'*B)}

but D{(w'*A*w)}*(w'*B) = 2 (w'*A)*(w'*B)

it even does not pass the syntax check of matrix multiplication...

What can I do?



best do it componentwise:
the i-the column of the Hessian is the derivative of the first derivative
(row) with respect to w_i, transposed. this avoids any confusion were to place
the transposition.
hth
peter
.




  Page 1 of 1

1

 


Related Articles
Archimedes 1st, Archimedes 2nd; NOVA TV show on palimpset
Do you like to show your new idea or designs in British Invention Show?
salvaging the small morsel of truth in String Theory; Critique of TV-show on String Theory versus AtomTotality
Optical vortices show their true colours
DECIDE WHETHER WE SHOULD SHOW UP!__VoteSurvey_//////////
VOTE_NO, = ETs, Please Don't Show UP /////////////
Grahics drawer wanted to show light source dependency
I have objectionable site that I wanna show you... May I?
re:I have objectionable site that I wanna show you... May I?
O'Reilly's show this evening kicked-*****!
Can photographs show effect?
*24* Rated BEST Anti-Liberal TV Show
Time Travel Crackpot Brian Greene on the Art Bell Show
UTILITIES SHOW INTEREST IN NEW NUKE PLANTS
recent NOVA show on Newton; in defense of Newton
 

NEWER

pg.1612     pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER