When running a financial loan payoff simulation, I realized that my calculated monthly payment differed from the calculator offered by popular loan service Sallie Mae.
I found two formulas for loan amortization when constraining number of payments. The one that matches Sallie Mae's output:
$$MonthlyPayment = \frac{Pr}{n(1-(1+\frac{r}{n})^{-nt})}$$
But when running this in a simulation (where interest is compounded daily, as Sallie Mae does) it will pay the loan off too early in cases of high principals and interest rates (ie $10k with 10%APR). In contrast, this formula works perfectly in my simulation:
$$MonthlyPayment = \frac{Pr(1+r)^{nt}}{(1+r)^{nt}-1}$$
Where P: Principal, r: interest rate, n: number of payments per time t, t: unit of time.
Can anyone explain the difference between these two formulas, and if I'm using mine wrong?