__doc__= """ Finds the optimal hedging of CDO book 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_2_short.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 = './' # Location of extracted problem data/statement cdo2 = psg.psg_importfromtext(data_directory + 'problem_cdohedge_2new.txt') cdo2['problem_statement'] = '\n'.join(cdo2['problem_statement'] ) # convert problem statement from list to a single string soln_cdo2 = psg.psg_verify(cdo2) # verify problem is loaded correctly soln_cdo2 = psg.psg_solver(cdo2) # solve problem