Given the following matrices:
Phi = [... 1,89393939393939e-06 0 0 0; 3,78787878787879e-06 1,89393939393939e-06 0 0; 5,68181818181818e-06 3,78787878787879e-06 1,89393939393939e-06 0; 7,57575757575758e-06 5,68181818181818e-06 3,78787878787879e-06 1,89393939393939e-06; 9,46969696969697e-06 7,57575757575758e-06 5,68181818181818e-06 3,78787878787879e-06; 1,13636363636364e-05 9,46969696969697e-06 7,57575757575758e-06 5,68181818181818e-06; 1,32575757575758e-05 1,13636363636364e-05 9,46969696969697e-06 7,57575757575758e-06; 1,51515151515152e-05 1,32575757575758e-05 1,13636363636364e-05 9,46969696969697e-06; 1,70454545454545e-05 1,51515151515152e-05 1,32575757575758e-05 1,13636363636364e-05; 1,89393939393939e-05 1,70454545454545e-05 1,51515151515152e-05 1,32575757575758e-05];lamdba_matrix = 1e-5 * eye(4);alpha_matrix = 1e-8 * eye(10);H = 2*(Phi'*alpha_matrix*Phi + lambda_matrix);
H is intended to be used with quadprog. Doing so, I get the following warning:
Warning: Your Hessian is not symmetric. Resetting H=(H+H')/2.
Well, I got suspicious because it should be symmetric according to the formula. So I investigated:
K>> H == H'ans = 4×4 logical array 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 1 K>> H(4, 1) - H(1, 4)ans = 3.0815e-33
What is going on here ? Where does this ridiculously small error come from ? Should I do H = (H + H')/2 to suppress the warnings ? Would it change the result of quadprog ?
Best Answer