We discussed partial derivatives and gradients of functions f:Rn→R mapping to the real numbers.Lets generalize this concept of the gradient to vector-valued functions(vector fields) f:Rn→Rm, where n≥1 and m≥1.
For a function f:Rn→Rm and a vector x=[x1,…,xn]T∈Rn, the corresponding vector of function values is given as
f(x)=[f1(x)⋮fm(x)]∈Rm
where each fi:Rn→R that map onto R.
The partial derivative of a vector-valued function f:Rn→Rm with respect to xi∈R, i=1,…,n, is given as the vector
We know that the gradient of f with respect to a vector is the row vector of partial derivatives, every partial derivative ∂f∂x is a column vector. Therefore we obtain the gradient of f:Rn→Rm with respect to x∈Rn by collecting this partial derivatives
Definition: Jacobian
The collection of all first-order partial derivatives of a vector-valued function f:Rn→Rm is called the Jacobian. The Jacobian is an m×n matrix.
J=▽xf=df(x)dx=[∂f(x))∂x1⋯∂f(x))∂xn]
As a special case of a function f:Rn→R1, which maps a vector x∈Rn onto a scalar, possesses a Jacobian that is a row vector of dimension 1×n.
Remark: This is called numerator layout of the derivatives. i.e., the derivative df(x)dx of f∈Rm with respect to x∈Rn is an m×n matrix, where the elements of f define the rows and the elements of x defines the columns of the corresponding Jacobian. There exists also the denominator layout, which is the transpose of the numerator layout.
Lets consider an example with x=[x1x2].We define two vector valued functions f1(x) and f2(x).
If we organize both of their gradients into a single matrix, we move from vector calculus into matrix calculus. This matrix, and organization of the gradients of multiple functions with multiple variables, is known as the Jacobian matrix.
Example:
f(x,y)=3x2y
g(x,y)=2x+y8
J=[cos(x1)cos(x2)−sin(x1)sin(x2)]∈R1×2
Example Problems
1.Consider the following functions
A.f1(x)=sin(x1)cos(x2),x∈R2
B.f2(x,y)=xTy,x,y∈Rn
C.f3(x)=xxT,x∈Rn
a) What are the dimensions of ∂fi∂x
b) Compute the Jacobians.
A.
f1(x)=sin(x1)cos(x2),x∈R2
∂f1∂x1=cos(x1)cos(x2)
∂f1∂x2=−sin(x1)sin(x2)J=▽xf1=[∂f(x)∂x1∂f(x)∂x2]
B.
f2(x,y)=xTy,x,y∈Rn
∂f2∂x=[∂f2∂x1∂f2∂x2⋯∂f2∂xn]=[y1y2⋯yn]=yT
∂f2∂y=[∂f2∂y1∂f2∂y2⋯∂f2∂yn]=[x1x2⋯xn]=xT
J=[∂f(x)∂x1∂f(x)∂x2]
C.
f3(x)=xxT,x∈Rn
2.Differentiate f with respect to t ( university question)
f(t)=sin(log(tTt))t∈RD
f(t)=cos(log(tTt))1tTt2tT
3.Compute the derivatives dfdx of the following functions by using the chain rule. Provide the dimensions of every single partial derivative. Describe your steps in detail. ( university question)
f(z)=log(1+z),z=xTxx∈RD
4.Compute dfdx
f(z)=sin(z);z=Ax+b;A∈RE×D;x∈RD;b∈RE
where sin(.) is applied to every element of z. ( university question)
Comments
Post a Comment