oreex.run("Input/ore_A3.xml") oreex.save_output_to_subdir( "case_A_eur_swap", ["log_3.txt", "dim_evolution_3.txt", "dim_regression_3.txt"] ) oreex.print_headline("Plot results") oreex.setup_plot("dim_evolution_A_swap_eur") oreex.plot(os.path.join("case_A_eur_swap", "dim_evolution_1.txt"), 0, 3, 'y', "Zero Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_evolution_1.txt"), 0, 4, 'c', "First Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_evolution_2.txt"), 0, 4, 'm', "Second Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_evolution_3.txt"), 0, 4, 'b', "Second Order NPV Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_evolution_2.txt"), 0, 6, 'r', "Simple DIM") oreex.decorate_plot(title="Example 13 (A) - DIM Evolution Swap EUR", xlabel="Timestep", ylabel="DIM") oreex.save_plot_to_file() oreex.setup_plot("dim_regression_A_swap_eur") oreex.plot(os.path.join("case_A_eur_swap", "dim_regression_1.txt"), 1, 6, 'k', "Delta NPV", marker='+', linestyle='') oreex.plot(os.path.join("case_A_eur_swap", "dim_regression_1.txt"), 1, 5, 'y', "Zero Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_regression_1.txt"), 1, 2, 'c', "First Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_regression_2.txt"), 1, 2, 'm', "Second Order Regression") oreex.plot(os.path.join("case_A_eur_swap", "dim_regression_2.txt"), 1, 7, 'r', "Simple DIM") oreex.decorate_plot(title="Example 13 (A) - DIM Regression Swap EUR, Timestep 100", xlabel="Regressor", ylabel="DIM") oreex.save_plot_to_file() # Case B oreex.print_headline("Run ORE (case B (swaption eur), 1st order regression, t=300)") oreex.run("Input/ore_B1.xml") oreex.get_times("Output/log_1.txt") oreex.save_output_to_subdir(
"Run ORE to produce NPV cube and exposures for portfolio 1") oreex.run("Input/ore_portfolio_1.xml") oreex.get_times("Output/portfolio_1/log.txt") oreex.print_headline("Plot results for portfolio 1") oreex.setup_plot("portfolio_1") oreex.plot(os.path.join("portfolio_1", "exposure_trade_swap_01.csv"), 2, 3, 'b', "EPE Swap") oreex.plot(os.path.join("portfolio_1", "exposure_trade_collar_01.csv"), 2, 4, 'r', "ENE Collar") oreex.plot(os.path.join("portfolio_1", "exposure_nettingset_CPTY_A.csv"), 2, 4, 'g', "ENE Netting") #oreex.plot(os.path.join("portfolio_1", "exposure_nettingset_CPTY_A.csv"), 2, 3, 'g', "EPE Netting") oreex.decorate_plot(title="Example 6, Portfolio 1") oreex.save_plot_to_file(os.path.join("Output", "portfolio_1")) # Portfolio 2 run oreex.print_headline( "Run ORE to produce NPV cube and exposures for portfolio 2") oreex.run("Input/ore_portfolio_2.xml") oreex.get_times("Output/portfolio_2/log.txt") oreex.print_headline("Plot results for portfolio 2") oreex.setup_plot("portfolio_2") oreex.plot(os.path.join("portfolio_2", "exposure_trade_floor_01.csv"), 2, 3, 'b', "EPE Floor") oreex.plot(os.path.join("portfolio_2", "exposure_trade_cap_01.csv"), 2, 4, 'r', "ENE Cap") oreex.plot(os.path.join("portfolio_2", "exposure_nettingset_CPTY_B.csv"), 2, 3,