Questions tagged [matrix-calculus]

Matrix calculus is about doing calculus, especially derivative and infinite series over spaces of vectors and matrices.

Matrix calculus studies derivatives and differentials of scalar, vector and matrix with respect to vector and matrix. It has been widely applied into different areas such as machine learning, numerical analysis, economics etc.

There are basically two methods.

  • Direct: Regard vectors and matrices as scalar so as to compute in the usual way in calculus. And The Matrix Cookbook provides a lot of basic facts.

  • Component-wise: Write everything in indices notation and compute in the usual way componentwisely. Einstein summation convention is frequently used.

3828 questions
2
votes
1 answer

Why is $\frac{\partial \operatorname{Tr}(\mathbf X^n)}{\partial \mathbf X}=n\left(\mathbf X^{n-1}\right)^T ?$

Why is $\frac{\partial \operatorname{Tr}(\mathbf X^n)}{\partial \mathbf X}=n\left(\mathbf X^{n-1}\right)^T ?$ and why is $\frac{\partial (\ln[\det(\mathbf X)])}{\partial \mathbf X}=\mathbf X^{-T} ?$ I have found lots of website and information…
shineele
  • 201
2
votes
1 answer

Derivative of a matrix multiplied by its conjugate transpose

Let $A$ be a square matrix whose elements are complex. Is is true that the spatial derivative $\frac{d}{dx}(AA^H) = AA^H_x + A_xA^H$, following the simple chain rule? The superscript $H$ represents the conjugate transpose and subscript $x$…
Mprisim
  • 21
2
votes
1 answer

Meaning of vector derivative of velocity with respect to position

I would like to compute an expression for $\frac{\partial v}{\partial x}$, where $x$ is a position vector and $v = \dot{x}$ is a velocity vector. Using the Chain Rule, we should have: $$\frac{\partial v}{\partial x} = \frac{\partial t}{\partial…
2
votes
2 answers

Differentiation of a matrix in respect to a vector

Could someone show and explain the differentiation of the following $$\frac{\partial(x^t Ax)}{\partial x} $$ Where x is a column vector and A is a symmetric square matrix. I'm in highschool so I have no experience with vector calculus and I only…
2
votes
1 answer

differentiation with respect to vector

Let $x \in \mathbb{R}^{n}$ a vector, and $A(x) \in \mathbb{R}^{n \times n}$ a symmetric matrix depending on $x$ I need to find a way to differentiate $p(x) = x^t A(x) x \in $ with respect to $x$. This should be a 1 by $n$ vector. I tried the…
Koen
  • 682
2
votes
0 answers

Matrix derivative of quadratic inverse form

How do I calculate the derivative $\frac{\partial}{\partial\boldsymbol{S}_{1}}\text{tr}\left(\boldsymbol{S}_{i}^{H}\left(\boldsymbol{S}_{1}\boldsymbol{A}_{i1}\boldsymbol{S}_{1}^{H}+\sum_{j\neq…
2
votes
0 answers

Notation for partial derivative of matrix function times vector function

Question: What is a compact notation for expressing the quantity? $$ \frac{\partial}{\partial x_i} D^2 \mathbf{F}( \mathbf{g}(x) ) \mathbf{h}(x) \tag{Q} $$ To be concrete and keep things simple (clearly this can be generalized to other…
user32416
  • 221
2
votes
1 answer

Characteristic polynomial type of identity.

Let $N$ be a positive integer, $x$ be a real number and let $Q$ be a real $N$-dimensional matrix. The following identity holds: \begin{eqnarray} &&\det\left({\mathbb 1} - x Q\right) = e^{-x \text{Tr}[Q]}\cdot \\&& \left(1 -\frac{x^2}{2} Tr[Q^2] -…
Przemo
  • 11,331
2
votes
2 answers

How to compute $\frac{\partial(Z(x)^{-1}f(x))}{\partial x}$

I have a vector $\mathbf{x}$ (10 $\times$ 1), a vector $\mathbf{f}(\mathbf{x})$ (10 $\times$ 1) and an invertible square matrix $\mathbf{Z}(\mathbf{x})$ (10 $\times$ 10) which is block diagonal: $$\mathbf{Z}(\mathbf{x}) = \begin{bmatrix}\mathbf{A} &…
Astrinus
  • 131
2
votes
0 answers

Calculating the Hessian

I am working with a cost function: \begin{eqnarray} (W^t\mathbf{p} - \boldsymbol\pi )^t \Lambda (W^t\mathbf{p} - \boldsymbol\pi) \end{eqnarray} where $\mathbf{p} = \dfrac{1}{1+\exp \left[-\mathbf{X}\boldsymbol{\beta}\right]}$. I calculated the…
S.A.
  • 21
2
votes
1 answer

Differentiating Matrix Multiplication on GL$(n,\Bbb R)$

If we let $\psi:\text{GL}(n,\Bbb R)\times\text{GL}(n,\Bbb R)\rightarrow \text{GL}(n,\Bbb R)$, by $\psi:(A,B)\mapsto AB$, then $\psi$ can be seen as a differentiable map, letting $(A)_{ij}={a}_{ij}$ and $(B)_{ij}={b}_{ij}$, the components of…
snulty
  • 4,355
2
votes
0 answers

Permanent inequality

Let $A$ be a $n\times n$ matrix, then the permanent of $A$ is defined as $$per A=\sum_{\sigma} a_{1\sigma(1)}\cdots a_{n\sigma(n)}.$$ Now, it is to show that $$|per(AB)|^2\leq per (AA^*)per(B^*B).$$ I find it is difficult to obtain by using the…
xldd
  • 3,485
1
vote
1 answer

What is the square of a matrix?

For my Econometrics course I have the following problem. I have a $x_i^\prime$ which is a $1$ x $K$ vector of explanatory variables and $i=1,\dots,N$ and the regression model is $y_i = x_i^\prime \beta$. Now I need to compute the variance of…
1
vote
1 answer

How to perform integration over product of matrices?

My goal is to express the result of the following integral in closed-form (using for example traces of the matrices): $$ \int_{-\infty}^{\infty} b^T G(x)^T H G(x) b dx $$ where $$ b \in \mathbb{R}^{m \times 1} $$ $$ H \in \mathbb{R}^{m \times m}…
Taiben
  • 320
1
vote
0 answers

Two 3D matrix of different sizes but similar composition, compare the likelihood that a given item is present in a column

Overview Given that 3D Matrix 1 and Matrix 2 have the same number of items "P" randomly dispersed, how can it be shown that the liability of "P" in any given column is less when using a Matrix B that has 9 additional rows? By…
1 2
3
13 14