Numerical approximation of function of high dimensional vector

344 Views Asked by At

I have a function which has as an input a vector of $\mathbb{R}^{18}$. The output of this function is a vector of $\mathbb{R}^{2}$. How can I numerically approximate the differentiation of the function? I know how to do it if the function just delivers a single value, but not for two.

1

There are 1 best solutions below

0
On BEST ANSWER

In this case you have got a function $f$ s.t.

$$ f \, : \, \mathbb{R}^{18} \longrightarrow \, \mathbb{R}^2 $$

When you derivate $f$, you obtain the Jacobian that for $f$ it is a matrix $2 \times 18$ where the general entry is: $$ \mathbf{J}_{i,j} = \frac{\partial f_i}{\partial x_j} $$

For a numerical approximation of the Jacobian, i.e the approximation of first order derivates, we can use the finite difference method.

At this link at slide 3.7 there is a matlab code which use the function jacobian.

At this link, from [1], at pag 157 see the jacobian function in python.


[1] Kiusalaas, Jaan. Numerical methods in engineering with Python 3. Cambridge university press, 2013.