Question: 1. [14 points] Write the following two functions in Matlab (a) function B -hessmod1 (H) This function takes in the Hessian matrix H and returns
![1. [14 points] Write the following two functions in Matlab (a)](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66dc277fbcf07_06366dc277f34286.jpg)
1. [14 points] Write the following two functions in Matlab (a) function B -hessmod1 (H) This function takes in the Hessian matrix H and returns a positive definite matrix B by the following procedure . Compute the spectral decomposition of H using the eig command in Matlab . Replace any negative eigenvalues with the positive quantity 0.25 . Return B- SD ST, where S is the matrix whose columns are eigenvectors of H, and D* is the diagonal matrix where negative eigenvalues have been replaced by (b) function B = hessmod2 (H) This function takes in the Hessian matrix H and returns a positive definite matrix B by the following procediire: . While B is not positive definite (use the chol command to check), Set max(8.2t) (c) Let H= . What do your functions hessmodl and hessmod2 return with H as input? Please include printouts of your code for parts (a) and (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
