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
0
votes
1 answer

Gradient of $f(x) = 1^T \left[ \left( x - 1 \left[1^T x\right] \right) \odot \left(x - 1 \left[1^T x\right] \right) \right]$ w.r.t. $x$

How to compute the gradient of $$\eqalign{ f(x) &= 1^T \left[ \left( x - 1 \left[1^T x\right] \right) \odot \left(x - 1 \left[1^T x\right] \right) \right]\cr }$$ where $x \in M_{n,1}(\mathbb{R})$, $1 \in M_{n,1}$ is a column vector with all…
learning
  • 661
0
votes
2 answers

What does it mean by transpose of a vector

I came across this paragraph (confusing transpose signs) in a matrix calculus paper. I'm confused by the double transpose notation of the vectors, in particular t(w). I thought w hat should be t[w, b] instead of t[t(w), b], and x hat should be [x,…
Nemo
  • 315
0
votes
1 answer

Matrix differenation results

Can some one tell me how to get following matrix derivative or atleast point to source where i can find?I have looked at matrix cookbook but it doesn't have anything relevant $\frac{d}{dW}\log (\det(\sigma^2+WW^T)) $ $\frac{d}{dW}Tr ((\sigma^2…
manifold
  • 1,485
0
votes
1 answer

Gradient and hessian of $\log(x^TAx)$

I am working on a optimization problem which involves the gradient and hessian of $\log(x^TAx)$, where $x$ is an unknown vector and $A$ is a positive definite matrix. How can I derive them? Thanks!
Bayes
  • 77
0
votes
3 answers

How to rewrite $M_1\otimes M_2$ isolating $M_2$?

I have 2 matrices $M_1, M_2$. Is there a way to rewrite $M_1\otimes M_2$ as $M \cdot M_2$? i.e. $M$ is a matrix that it's being multiplied by $M_2$. My objective here is to isolate $M_2$ as a product of matrices. Can we do something similar with…
0
votes
2 answers

Does exists a matrix $X$ for how many $n$ such that $X^n=A$?

Let $$ A= \begin{pmatrix} 0 & 1 & 2 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{pmatrix} $$ For how many $n$ is there a matrix $X$ such that $X^n=A$?
0
votes
2 answers

Find the values for which the matrix is diagonalizable

I have this matrix A= $$\begin{bmatrix} 2&0&3\\0&L&0\\1&0&4\end{bmatrix}$$ and for find characteristic matrix I do $\lambda I - A$ so I've got $$\begin{bmatrix} \lambda - 2&0&-3\\0&\lambda-L&0\\-1&0&\lambda-4\end {bmatrix}$$ and here I'm in stuck, I…
Ciao
  • 81
0
votes
1 answer

What is $\frac{\partial}{\partial d_A} f$ where $d_A$ is matrix $A$'s diagonal?

Let us assume that we know $\frac{\partial}{\partial A} f$, where $f$ is a scalar function, and $A$ any matrix. Now suppose we are interested in the special case when $A$ is diagonal, and we want to know what's $$\frac{\partial}{\partial d_A} f$$…
0
votes
1 answer

What does the following matrix expression equal to after differentiating it wrt. $\dot{\mathrm{x}}$ and then wrt time

Suppose I have the following expression: $$\dot{\mathbf{x}}^\intercal\left(\mathbf{A}-\mathbf{B}\mathbf{D}^{-1}\mathbf{B}^\intercal\right)\dot{\mathbf{x}}$$ where $\mathbf{x}(t)\in \mathbb{R}^{m}$ is a vector and $\mathbf{A}\in \mathbb{R}^{m\times…
Sphery
  • 77
0
votes
3 answers

Matrix function

If we have $n$ by $n$ A matrix I want to ask about the general method to compute the matrix function. For example how I can compute: $cos(A)$ or $sin(A)$ or $e^{A}$ or $log(A)$ or any other functions?
hmeteir
  • 39
0
votes
3 answers

proving $G(G'G)^{-3/2}G'=(GG')^{-1/2}$

Can someone suggest how this equality is derived? I feel like I'm forgetting some basic property of of matrices (this formula comes up in Figure 1 of https://arxiv.org/pdf/1806.02958.pdf)
0
votes
0 answers

Differentiation of a matrix with respect to its elements

Assume that we have matrices $A, B, C, X$ such that both $X$ and $B$ are symmetric and the dimension of all those matrices agree for multiplications. I need to find the derivative of $\frac{log\,|B^{-1}|}{\partial x_{ij}}$, such that $x_{ij}$…
0
votes
1 answer

Matrix multiplication and differentiation

I am very confused reading all those symbols I do not understand, I am just trying to find partial derivative when two matrices are multiplied. For an example, suppose that $A$ is a $3\times 4$ matrix and that $B$ is a $4\times 2$. After I do…
0
votes
0 answers

Spectral decomposition of some special matrices

Let $A = \begin{pmatrix}a+b & a &0\\a & 2a & a\\0 & a & a+b \end{pmatrix}$ and $B = \begin{pmatrix}a+b & a &0 & 0\\a & 2a & a & 0\\0 & a & 2a & a\\0 & 0 & a & a+b \end{pmatrix}$, where $A$ and $B$ are invertible. Is it possible to find $A^{-1/2}$…
0
votes
1 answer

How do I differentiate a Kronecker product with respect to a scalar (a matrix element)?

I am developing in my PhD an new proposed approach using SEM (stochastic expectation maximization algorithm) that fits a multivariate linear mixed model by maximizing the likelihood function to find MLE. The form of the LF is highly complicated due…