__doc__= """ Finds the optimal hedging of CDO book as a mixed integer program using PSG . Case study description found at: http://uryasev.ams.stonybrook.edu/index.php/research/testproblems/financial_engineering/case-study-optimal-hedging-of-cdo-book-psg-and-milp-formulation/ Data and PSG problem statement: http://uryasev.ams.stonybrook.edu/wp-content/uploads/2019/03/Data_problem_cdohedge_3_MIP.zip To run this problem, download the data and problem statement from the above case study website. Extract to a directory and replace the `data_directory` string with the location of the extracted problem statemnet and data files. """ import psgpython as psg data_directory = '../cdohedge3_MIP/' # Location of extracted problem data/statement cdo_MIP = psg.psg_importfromtext(data_directory + 'problem_cdohedge_1a_MIP.txt') cdo_MIP['problem_statement'] = '\n'.join(cdo_MIP['problem_statement'] ) # convert problem statement from list to a single string soln_cdo_MIP = psg.psg_verify(cdo_MIP) # verify problem is loaded correctly soln_cdo_MIP = psg.psg_solver(cdo_MIP) # solve problem