Gradient function using matrix notation

In summary, the conversation discusses how to determine grad f for the function f(x) = 1/2 xTQx + qTx, using the definition of the derivative. The final result is found to be grad f = Qx + q, with the assumption that Q is a symmetric matrix. The discussion also mentions the use of matrix notation and provides a link to a guide on matrix calculus, but some participants express confusion and suggest using an alternative resource.
  • #1
hotvette
Homework Helper
1,009
9
I think I'm having a brain freeze. I'm trying to determine grad f where f(x) = 1/2 xTQx + qTx. I can get to the point where df = (xTQ + qT)dx, but I don't know how to get to the final result grad f = Qx + q.

Can someone explain it?
 
Last edited:
Physics news on Phys.org
  • #2
hi hotvette! :smile:

Hint: use xTQx = ∑ij Qijxixj, qTx = ∑i qixi :wink:
 
  • #3
What is df = (xTQ + qT)dx supposed to mean?

Using the definition of the derivative Df, I calculated that the matrix of Df (that is, grad(f)) is, is ½(Qx+xQ)+q. If Q is a symmetric matrix, then xQ=Qx and we find your result grad(f)=Qx+q.
 
  • #4
tiny-tim and quasar987,

Thanks for your replies. The calculus classes I had (l-o-n-g time a go) never used matrix notation, so I'm trying to learn it on my own. I've been using this:

http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/calculus.html#deriv_linear

as a guide and was following the terminology in the link. I'm treating dx as a vector quantity (e.g. dx = [dx1, dx2, ..., dxn]T). I'm just having a hard time deriving the expression for grad f based on the info in the link. Also, sorry, but I don't see where the sum notation leads.
 
  • #5
  • #6
tiny-tim said:
eugh! I've never come across that terminology before, and I find it really confusing

I don't follow it very well either. I'd be delighted to use an understandable alternative. Are there any online references you'd recommend?
 

FAQ: Gradient function using matrix notation

What is the gradient function in matrix notation?

The gradient function in matrix notation is a mathematical tool used to calculate the rate of change of a multivariate function with respect to its variables. It is represented by a vector of partial derivatives with each element corresponding to a different variable.

How is the gradient function calculated using matrix notation?

The gradient function is calculated using matrix notation by taking the partial derivatives of the function with respect to each variable and arranging them into a vector. This vector is then multiplied by the transpose of the Jacobian matrix, which contains the partial derivatives of the function with respect to each variable.

What is the purpose of using matrix notation for the gradient function?

Using matrix notation for the gradient function allows for a more compact and efficient representation of the function's rate of change. It also makes it easier to perform operations such as gradient descent, which is used in machine learning and optimization problems.

Can the gradient function be used for any type of function?

Yes, the gradient function can be used for any type of function, as long as it is differentiable. It is commonly used in multivariate calculus, machine learning, and optimization to calculate the direction of steepest ascent or descent for a given function.

What are the applications of the gradient function in real-world problems?

The gradient function has various applications in real-world problems, such as in machine learning for training neural networks, in physics for calculating forces and motion, and in economics for optimization problems. It is also used in image processing, computer graphics, and many other fields that involve multivariate functions.

Similar threads

Replies
8
Views
2K
Replies
4
Views
2K
Replies
3
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
4
Views
1K
Back
Top