https://github.com/auralius/jacobian-hessian-cpp
Jacobian and Hessian of a vector function.
https://github.com/auralius/jacobian-hessian-cpp
cpp hessian jacobian numerical-methods
Last synced: about 1 year ago
JSON representation
Jacobian and Hessian of a vector function.
- Host: GitHub
- URL: https://github.com/auralius/jacobian-hessian-cpp
- Owner: auralius
- Created: 2017-02-01T23:36:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-13T09:05:53.000Z (over 9 years ago)
- Last Synced: 2025-02-01T10:27:19.382Z (over 1 year ago)
- Topics: cpp, hessian, jacobian, numerical-methods
- Language: C++
- Homepage:
- Size: 826 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.ipynb
Awesome Lists containing this project
README
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This codes calculate numerically the Jacobian and the Hessian of a vector of function. \n",
"For matrix operation, Armadillo is used: http://arma.sourceforge.net/ \n",
"To install, do the follwoing:\n",
"\n",
"```\n",
"mkdir build \n",
"cd build \n",
"cmake .. \n",
"make \n",
"```\n",
"\n",
"There is an example provided. \n",
"\n",
"To understand the concept, let's take an example of a function of vector, with 3 input parameters and 2 output parameters: \n",
"\n",
"$y=\\begin{bmatrix} f_1(x_1,x_2,x_3) \\\\ f_2(x_1,x_2,x_3) \\end{bmatrix}$\n",
"\n",
"$Jac(y) = \\begin{bmatrix}\n",
"\\frac{\\partial f_1}{\\partial x_1} & \\frac{\\partial f_1}{\\partial x_2} & \\frac{\\partial f_1}{\\partial x_3} \\\\ \n",
"\\frac{\\partial f_2}{\\partial x_1} & \\frac{\\partial f_2}{\\partial x_2} & \\frac{\\partial f_2}{\\partial x_3} \n",
"\\end{bmatrix}$ \n",
"\n",
"$Hess(y(1)) = \\begin{bmatrix}\n",
"\\frac{\\partial^2 f_1}{\\partial x_1^2} & \\frac{\\partial^2 f_1}{\\partial x_1 \\partial x_2} & \\frac{\\partial^2 f_1}{\\partial x_1 \\partial x_3} \\\\\n",
"\\frac{\\partial^2 f_1}{\\partial x_2 \\partial x_1} & \\frac{\\partial^2 f_1}{\\partial x_2^2} & \\frac{\\partial^2 f_1}{\\partial x_2 \\partial x_3} \\\\\n",
"\\frac{\\partial^2 f_1}{\\partial x_3 \\partial x_1} & \\frac{\\partial^2 f_1}{\\partial x_3 \\partial x_2} & \\frac{\\partial^2 f_1}{\\partial x_3^2}\n",
"\\end{bmatrix}$\n",
"\n",
"$Hess(y(2)) = \\begin{bmatrix}\n",
"\\frac{\\partial^2 f_2}{\\partial x_1^2} & \\frac{\\partial^2 f_2}{\\partial x_1 \\partial x_2} & \\frac{\\partial^2 f_2}{\\partial x_1 \\partial x_3} \\\\\n",
"\\frac{\\partial^2 f_2}{\\partial x_2 \\partial x_1} & \\frac{\\partial^2 f_2}{\\partial x_2^2} & \\frac{\\partial^2 f_2}{\\partial x_2 \\partial x_3} \\\\\n",
"\\frac{\\partial^2 f_2}{\\partial x_3 \\partial x_1} & \\frac{\\partial^2 f_2}{\\partial x_3 \\partial x_2} & \\frac{\\partial^2 f_2}{\\partial x_3^2}\n",
"\\end{bmatrix}$"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}