The previous line of code explains the cases where only one company falls into defualt. In other words, it does not mean that they are both at the same time, but rather that in how many cases either of the two falls into default. This is because the code has the >< symbols, which determine when the company was less than or greater than X. The x in each signature serves as a reference to know when it has and when it has not fallen into default. These graphed cases would show a Cartesian plane divided into 4 where only the sides where one of the companies falls into default would be filled with the corresponding information.
The present value of the expected payoff, taking into account that the principal notional variable changed to $2, is 0.1012. We arrived at this answer by multiplying the probability of default by 1 minus the recovery rate, which was 40%, so in the multiplication would be 60%. After that number that came out we multiply it by the main notional principal (2). After that for the discount rate. This procedure was done every year. The totals for each year were added to arrive at the result of 0.1012. Below is an excel table showing the development of the response.
Installing package into ‘/work/.R/library’
(as ‘lib’ is unspecified)