![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/826190/image.png)
How can I get the hessian matrix of a set of several functions?
조회 수: 17 (최근 30일)
이전 댓글 표시
I have matrix containing several functions, let say:
g = [F1^2 - FD1 - FG2;
F2^2 - F3^2 - F1^2;
F3^2 - FD2 - FG1];
and the objective variable are F = [ F1, F2, F3];
then if i compute the partial derivative of g w.r.t F1, it is going to be a 3x1 column vector:
dg/dF1 = [2F1;
-2F1;
0];
If I derive it again w.r.t F1, it is going to be:
d^2g/dF1^2 = [2;
-2;
0];
Then, my question is how to put it back to the full matrice of Hessian if it only provides a single place for d^2g/dF1^2 ? Do I need to find the determinant of d^2g/dF1^2 or I just simply sum each of the element of d^2g/dF1^2 ? Thank you.
댓글 수: 2
Alan Weiss
2021년 12월 7일
I do not understand your setup. A Hessian is usually the matrix of second derivatives of a SCALAR function g. If g were scalar it would be
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/826190/image.png)
I do not understand what a Hessian might mean for a vector-valued function.
Alan Weiss
MATLAB mathematical toolbox documentation
답변 (1개)
Abolfazl Chaman Motlagh
2021년 12월 8일
The Hessian is officially defined for scalar value functions. depend on what application you want to use hessian, you may define it differently in Multivariable calculus.
for standard usage of Hessian in vector value function, you can create an array of hessian.
{The General Second Derivative of Multivariable vector-valued function is a function which takes an input and return a linear Transform which yield to another linear transformation at any points.}
for example see [Calculus on Manifold , Michael Spivak]
댓글 수: 2
Abolfazl Chaman Motlagh
2021년 12월 9일
the determinant is defined on squared matrix. if you mean you use hessian for every element and create a vector, it is not exactly as defined as usual diffinition of hessian.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828760/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828765/image.png)
so you can write a third-order Tensor H :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828770/image.png)
or
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828775/image.png)
so it's not exactly a determinant of
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828780/image.png)
but all difinition and ... depends on applications you need. you should think why you need Hessian, or more generally second derivative of F. so you can understand a little deeper what exactly you should use.
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!