Can I compute the first and second partial derivatives along a given direction using the gradient and Hessian?

48 Views Asked by At

I have an analytical function $f:\mathbb{R}^n\to\mathbb{R}$ that I want to minimise using Newton's method. Given a point $\mathbf{x}_i\!\in\!\mathbb{R}^n$, I compute the gradient, $\nabla\! f(\mathbf{x}_i)$, the Hessian matrix, $H(\mathbf{x}_i) = \nabla^2\! f(\mathbf{x}_i)$, and the Newton step, $\mathbf{d}_i = -H(\mathbf{x}_i)^{-1}\nabla\! f(\mathbf{x}_i)$, at the point. I am able to compute both $\nabla\! f$ and $H$ analytically. For the line search along the Newton step direction, the following holds: $$\mathbf{x}_{i+1} = \mathbf{x}_i + \mu\mathbf{d}_i,$$ where the $\mu$ that minimises $f$ along $\mathbf{d}_i$ is to be computed. I was initially considering deriving the analytical expressions for $\tfrac{\partial f}{\partial\mu}$ and $\tfrac{\partial^2 f}{\partial\mu^2}$, and applying a univariate Newton's method along $\mathbf{d}_i$. However, I'm now curious if there is a way to compute these partial derivatives using $\nabla\! f$ and $H$ alone? I know that the directional derivative along $\mathbf{d}_i$ is given by $H(\mathbf{x}_i)\mathbf{d}_i$. But is there a relationship between the directional derivative, $\tfrac{\partial f}{\partial\mu}(\mathbf{x}_i)$, and $\tfrac{\partial^2 f}{\partial\mu^2}(\mathbf{x}_i)$?

1

There are 1 best solutions below

1
On BEST ANSWER

I'm not sure I entirely understand your question (in what sense is $f$ a function of $\mu$? $\mu$ is a scalar?), but in regards to the title of your question, I will say the following.

Suppose you have a vector $v$. If you restrict your function $f: \mathbb{R}^n \to \mathbb{R}$ along the line segment in the direction $v$ starting from $x_i$, then you get a map $\mathbb{R} \to \mathbb{R}$ (i.e. $t \mapsto f(x_i + t v)$). The first derivative of this function is $\nabla f(x_i) \cdot v$. The second derivative of this function is $v^T H(x_i) v$.