Matrix Calculus


MatrixCalculus provides matrix calculus for everyone. It is an online tool that computes vector and matrix derivatives (matrix calculus).

derivative of
w.r.t.

\({}\)

where

  • {{v.name}} is a
Export functions as
Common subexpressions
{{ctrl.service.error.msg}}
0.5*x'*A*x
A*exp(x)
sin(x)'*y
(y.*v)'*x
a^b
norm2(A*x-y)^2
sum(log(exp(-y.*(X*w)) + vector(1)))
tr(A*X'*B*X*C)
log(det(inv(X)))
+
addition
-
subtraction
*
multiplication
/
division
^
power
.*
element-wise multiplication
./
element-wise division
.^
element-wise power
sin()
element-wise sin
cos()
element-wise cos
log()
element-wise natural log
exp()
element-wise exp
abs()
element-wise absolute value
sign()
element-wise sign
norm1()
element-wise 1-norm
norm2()
Frobenius norm
tr()
trace
det()
determinant
inv()
inverse
norm1()
1-norm
norm2()
Euclidean norm
vector()
constant vector
matrix()
constant matrix
Only scalars, vectors, and matrices are displayed as output. If the derivative is a higher order tensor it will be computed but it cannot be displayed in matrix notation. Sometimes higher order tensors are represented using Kronecker products. However, this can be ambiguous in some cases. Here, only in unambiguous cases the result is displayed using Kronecker products. The python code still works on the true higher order tensors.

Last updated November 2018.