The component functions are \(F_1(x,y)=xy\) and \(F_2(x,y)=x^2+y\text{.}\) The Jacobian matrix is \(\begin{bmatrix}y&x\\2x&1\end{bmatrix}\text{,}\) so it is \(2\times 2\text{.}\) Its first column measures how the two output components change with respect to the first input variable \(x\text{.}\)
Activity3.7.2.Actual output versus local prediction.
def F(v):
x, y = v
return np.array([x**2 + y, x - y**2])
a = np.array([1.0, 2.0])
h = np.array([0.1, -0.2])
J_at_a = np.array([[2.0, 1.0],
[1.0, -4.0]])
actual = F(a + h)
linear = F(a) + J_at_a @ h
actual, linear, actual - linear
The true value is actual, which is [3.01, -2.14]. The local linear prediction is linear, which is [3.0, -2.1]. The difference actual - linear is [0.01, -0.04], the local approximation error for this input change.
The input dimension is \(3\) and the output dimension is \(2\text{.}\) The slice J_at_a[:, 0] selects the first column of the Jacobian matrix, [2.0, 0.0]. For the input change [0.1, 0.0, 0.0], the predicted output change is [0.2, 0.0].
The map whose Jacobian matrix is Jg is applied first. Since Jg is \(3\times 2\text{,}\) it takes two input directions to three intermediate directions; Jf_at_g then takes those three directions to four output directions. The product has shape \(4\times 2\text{,}\) and the displayed output is a \(4\times 2\) array whose entries are all \(3\text{.}\)
The line J_at_x = W2 @ D @ W1 computes the Jacobian matrix of the block at x by the chain rule for Jacobian matrices. The shape of J_at_x is \(2\times 2\text{:}\) the input has two coordinates and the output has two coordinates.
Interpretation check. Given a Jacobian matrix \(J_F(\mathbf{a})\text{,}\) identify the input dimension, output dimension, and what each column measures. Tags.[U3-LO3, U3-LO5 | C+R+T | Core]
Exam-style check. Given a \(3\times 2\) Jacobian matrix \(J_F(\mathbf{a})\text{,}\) identify the input dimension, output dimension, and compute the local change \(J_F(\mathbf{a})\mathbf{h}\) for a given small vector \(\mathbf{h}\text{.}\)Tags.[U3-LO3, U3-LO5 | P+C+R | Core]
. The core path practices symbolic Jacobian matrices, evaluating a Jacobian matrix at a point, local linear prediction, square-grid visualizations, checking Jacobian matrix shapes in the chain rule, and short nonlinear model-block computations.
For a quick reference on array shapes, matrix products, numerical checks, and SymPy symbolic commands, see the programming appendix sections B.2, B.4, B.9, and B.11.