Are my derivative computations correct?

fofopausiomiava

fofopausiomiava

Answered question

2022-10-07

I am trying to program this but I need to verify if the equations I have are correct
f ( x ) = | | x | | 3 + m 2 × | | x | | 2
gradient of f(x) =  3 | | x | | 2 + m × x
hessian=  6 | | x | | + m
if this understanding is correct.
And I start with x in R 5 i.e. a 5 × 1 vector, when I solve for hessian using equation 3, I don't get a matrix. I only get a row vector ( 1 × 5)
||x|| implies Euclidean norm, m is a scalar (but I have been making m a 1 × 5 vector to match dimensions of x in my code)

Answer & Explanation

seppegettde

seppegettde

Beginner2022-10-08Added 7 answers

I think that you should start to compute derivative in a single element manner.
f ( x ) = [ x 1 2 + + x N 2 ] 3 / 2 + m 2 [ x 1 2 + + x N 2 ]
Thus using chain rule for the first term
f x n = 3 2 ( 2 x n ) [ x 1 2 + + x N 2 ] 1 / 2 + m x n = 3 x x n + m x n
Arranging the gradient in a column vector,
g = f x = ( 3 x + m ) x
Repeat for the Hessian by computing H m n = g m x n

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?