fofopausiomiava

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}+\frac{m}{2}\times ||x|{|}^{2}$

$\text{gradient of f(x) =}3||x|{|}^{2}+m\times x$

$\text{hessian=}6||x||+m$

if this understanding is correct.

And I start with x in ${\mathbb{R}}^{5}$ i.e. a $5\times 1$ vector, when I solve for hessian using equation 3, I don't get a matrix. I only get a row vector ($1\times 5$)

||x|| implies Euclidean norm, m is a scalar (but I have been making m a $1\times 5$ vector to match dimensions of x in my code)

$f(x)=||x|{|}^{3}+\frac{m}{2}\times ||x|{|}^{2}$

$\text{gradient of f(x) =}3||x|{|}^{2}+m\times x$

$\text{hessian=}6||x||+m$

if this understanding is correct.

And I start with x in ${\mathbb{R}}^{5}$ i.e. a $5\times 1$ vector, when I solve for hessian using equation 3, I don't get a matrix. I only get a row vector ($1\times 5$)

||x|| implies Euclidean norm, m is a scalar (but I have been making m a $1\times 5$ vector to match dimensions of x in my code)

seppegettde

Beginner2022-10-08Added 7 answers

I think that you should start to compute derivative in a single element manner.

$f(\mathbf{x})={[{x}_{1}^{2}+\dots +{x}_{N}^{2}]}^{3/2}+\frac{m}{2}[{x}_{1}^{2}+\dots +{x}_{N}^{2}]$

Thus using chain rule for the first term

$\frac{\mathrm{\partial}f}{\mathrm{\partial}{x}_{n}}=\frac{3}{2}\cdot (2{x}_{n}){[{x}_{1}^{2}+\dots +{x}_{N}^{2}]}^{1/2}+m{x}_{n}=3\Vert \mathbf{x}\Vert {x}_{n}+m{x}_{n}$

Arranging the gradient in a column vector,

$\mathbf{g}=\frac{\mathrm{\partial}f}{\mathrm{\partial}\mathbf{x}}=(3\Vert \mathbf{x}\Vert +m)\mathbf{x}$

Repeat for the Hessian by computing ${H}_{mn}=\frac{\mathrm{\partial}{g}_{m}}{\mathrm{\partial}{x}_{n}}$

$f(\mathbf{x})={[{x}_{1}^{2}+\dots +{x}_{N}^{2}]}^{3/2}+\frac{m}{2}[{x}_{1}^{2}+\dots +{x}_{N}^{2}]$

Thus using chain rule for the first term

$\frac{\mathrm{\partial}f}{\mathrm{\partial}{x}_{n}}=\frac{3}{2}\cdot (2{x}_{n}){[{x}_{1}^{2}+\dots +{x}_{N}^{2}]}^{1/2}+m{x}_{n}=3\Vert \mathbf{x}\Vert {x}_{n}+m{x}_{n}$

Arranging the gradient in a column vector,

$\mathbf{g}=\frac{\mathrm{\partial}f}{\mathrm{\partial}\mathbf{x}}=(3\Vert \mathbf{x}\Vert +m)\mathbf{x}$

Repeat for the Hessian by computing ${H}_{mn}=\frac{\mathrm{\partial}{g}_{m}}{\mathrm{\partial}{x}_{n}}$

Describe all solutions of Ax=0 in parametric vector form, where A is row equivalent to the given matrix

$$\left[\begin{array}{cccc}1& 3& 0& -4\\ 2& 6& 0& -8\end{array}\right]$$ Find, correct to the nearest degree, the three angles of the triangle with the given vertices

A(1, 0, -1), B(3, -2, 0), C(1, 3, 3)Whether f is a function from Z to R if

?

a) $f\left(n\right)=\pm n$.

b) $f\left(n\right)=\sqrt{{n}^{2}+1}$.

c) $f\left(n\right)=\frac{1}{{n}^{2}-4}$.How to write the expression ${6}^{\frac{3}{2}}$ in radical form?

How to evaluate $\mathrm{sin}\left(\frac{-5\pi}{4}\right)$?

What is the derivative of ${\mathrm{cot}}^{2}x$ ?

How to verify the identity: $\frac{\mathrm{cos}\left(x\right)-\mathrm{cos}\left(y\right)}{\mathrm{sin}\left(x\right)+\mathrm{sin}\left(y\right)}+\frac{\mathrm{sin}\left(x\right)-\mathrm{sin}\left(y\right)}{\mathrm{cos}\left(x\right)+\mathrm{cos}\left(y\right)}=0$?

Find $\mathrm{tan}\left(22.{5}^{\circ}\right)$ using the half-angle formula.

How to find the exact values of $\mathrm{cos}22.5\xb0$ using the half-angle formula?

How to express the complex number in trigonometric form: 5-5i?

The solution set of $\mathrm{tan}\theta =3\mathrm{cot}\theta $ is

How to find the angle between the vector and $x-$axis?

Find the probability of getting 5 Mondays in the month of february in a leap year.

How to find the inflection points for the given function $f\left(x\right)={x}^{3}-3{x}^{2}+6x$?

How do I find the value of sec(3pi/4)?