Here is the code snippet that plots the error on the model prediction. Is the use of YY_var[:, 0] correct?
plt.fill_between(XX[:,0],
YY_mu[:, 0] - 2 * np.sqrt(YY_var[:, 0]),
YY_mu[:, 0] + 2 * np.sqrt(YY_var[:, 0]),
alpha=0.1,
facecolor=col)
If not, YY_var[:, 0],needs to be replaced with the elements of the diagonal of the matrix. Is that correct?
Maybe numpy.diagonal(YY_var)?