How to modify finite differences method for function which expects symmetric matrix as argument

43 Views Asked by At

I have some function $f(X): R^{3\times 3} -> R$ which designed to be used with symmetric matrix $X$ as argument. It's possible to evaluate it on any $X$ but it have no meaning for my problem. In order to take a simple derivative of this function i need to use fact that $X$ is symmetric. Also, if i'm not mistaken i should modify my "gradient matrix" $A$ (from $df = A : dX$) to be $A = (A + A^T) - A \circ I$. (Please, let me know if i get it wrong).

This derivative is not simple, so I want to check that everythink is ok by taking numerical derivative of my function by finite differences method. But finite differences has no clue that my argument should be symmetric, so i cannot use vanila algorithm.

How should i modify finite differences for my function?