Taking into consideration the loan amounts, interest rates, minimum payments and the total budget to be contributed to the loans, a Compose script generates, in seconds, several thousand combinations of payments and selects the one which meets the budget goal and minimizes the interest paid across all loans considered. The optimized monthly payment, interest saved, number of months saved for each loan are given and a plot comparing the loans payoff is generated.
The test case for the script are three actual student loans. The input parameters such as loan amounts and interest may be seen in Figure 1. After running the script, the optimal payment amounts are output in 8 seconds with a total savings of $32,062 and a time savings of 9, 164 and 74 months, respectively – Figure 2. The greatest increase in payment (84%) went to the second loan, followed by the third and first loan with payment increases of 49% and 7%, respectively. With the second loan having the lowest interest rate, this test case is a good example of how the traditional, pay down the highest interest rate first, may not always the best. The plot in Figure 3 provides a qualitative comparison of how quickly the loans are paid down with the additional budget.
While the design of generating thousands of random combinations may work for this use case of three student loans, it is foreseeable that additional loans would require more combinations and thus longer run times. Additional performance enhancements, such as results filtering of duplicate combinations, could be implemented. The application could also be enhanced in two ways. First the script could be generalized to take into consideration other loans types, because in its current form it takes into consideration only fixed interest and payment type loans (e.g. 30 yr fixed home mortgage). Secondly, there could be an option to include loan payment cascading, where once one loan is paid off its payment gets distributed to the next loan. For this example, the third loan payment of $822 would be redistributed to the other loans to more rapidly pay them off.
With a little imagination and basic knowledge of Compose it can be surprising what average problems can be solved and optimized. I hope you’ve enjoyed this post as much as I have and happy scripting.
Give this script and others a try with a free trial of Altair Compose.