[Solved] Do the projection (with Jacobian) and marginalisation (inversion of matrix and remove a row/column and reinversion) commute?


To do np.dot last dimension of first matrix must be the same as first dimension of second one. They are not, so you are getting ValueError, that shapes are not aligned.
Everything seems to be fine as you printed, but then you forgot about lines:

j_temp = np.copy(J_2_SYM)

# Add row/col into J_2_SYM
j_temp = np.insert(j_temp, 2, J_NEU_row_SYM[0,:], axis=0)
j_temp = np.insert(j_temp, 2, J_NEU_col_SYM[:,0], axis=1)

# Copy built J_2_SYM
J_2_SYM = np.copy(j_temp)

So that’s where you change size of J_2_SYM, and after all it is (33, 16), so you cannot do dot product with (32, 32) array.

4

solved Do the projection (with Jacobian) and marginalisation (inversion of matrix and remove a row/column and reinversion) commute?