You can factor in a risk premium to discount your future cash flows, although I would argue that it's probably overkill if you're investing in the broad market. But if you did, you would probably discount it by about 2%. That would still give you a very conservative expected return of 5% per year
Here is an actual model, to keep us all honest. This assumes a $100,000 mortgage, with either and extra $400/month going to mortgage principle, or going into a ROTH IRA investing only in an S&P 500 Index fund, dividends reinvested. I assume a worst case of the S&P returning only a 2% dividend yield, and an average case of the S&P having a total return of 9% (average over that last 90 years or so). I also assume a marginal 28% tax rate, with cumulative savings on the interest deduction. I also assume the tax savings aren't invested (but should be).
Year Cumulative Cumulative Balance Cumulative Yearly Interest Tax Savings Cummulative S&P 2% S&P 9%
Interest Principal Payments Payments Tax Savings
1 3,968.04 1,755.96 98,244.04 5,724.00 1,755.96 3,968.04 1,111.05 14689.92 15734.88
2 7,864.54 3,583.46 96,416.54 11,448.00 1,827.50 3,896.50 1,091.02 19783.71 21951.0192
3 11,686.58 5,485.42 94,514.58 17,172.00 1,901.96 3,822.04 1,070.17 24979.39277 28726.61093
4 15,431.14 7,464.86 92,535.14 22,896.00 1,979.44 3,744.56 1,048.48 30278.98062 36112.00591
5 19,095.05 9,524.95 90,475.05 28,620.00 2,060.09 3,663.91 1,025.89 35684.56024 44162.08644
6 22,675.03 11,668.97 88,331.03 34,344.00 2,144.02 3,579.98 1,002.39 41198.25144 52936.67422
7 26,167.65 13,900.35 86,099.65 40,068.00 2,231.37 3,492.63 977.94 46822.21647 62500.9749
8 29,569.37 16,222.63 83,777.37 45,792.00 2,322.28 3,401.72 952.48 52558.6608 72926.06264
9 32,876.47 18,639.53 81,360.47 51,516.00 2,416.90 3,307.10 925.99 58409.83401 84289.40828
10 36,085.11 21,154.89 78,845.11 57,240.00 2,515.36 3,208.64 898.42 10103.83 64378.0307 96675.45503
11 39,191.27 23,772.73 76,227.27 62,964.00 2,617.84 3,106.16 869.72 70465.59131 110176.246
12 42,190.77 26,497.23 73,502.77 68,688.00 2,724.50 2,999.50 839.86 76674.90314 124892.1081
13 45,079.27 29,332.73 70,667.27 74,412.00 2,835.50 2,888.50 808.78 83008.4012 140932.3979
14 47,852.25 32,283.75 67,716.25 80,136.00 2,951.02 2,772.98 776.43 89468.56922 158416.3137
15 50,505.00 35,355.00 64,645.00 85,860.00 3,071.25 2,652.75 742.77 96057.94061 177473.7819
16 53,032.62 38,551.38 61,448.62 91,584.00 3,196.38 2,527.62 707.73 102779.0994 198246.4223
17 55,430.02 41,877.98 58,122.02 97,308.00 3,326.60 2,397.40 671.27 109634.6814 220888.6003
18 57,691.88 45,340.12 54,659.88 103,032.00 3,462.13 2,261.87 633.32 116627.375 245568.5743
19 59,812.70 48,943.30 51,056.70 108,756.00 3,603.19 2,120.81 593.83 123759.9225 272469.746
20 61,786.71 52,693.29 47,306.71 114,480.00 3,749.99 1,974.01 552.72 17300.27 131035.121 301792.0231
The extra principle payment allows the non-S&P investing homeowner to pay off his mortgage in 10 years. Which sounds great, but in the worst case, the ROTH S&P investor owes $78,000 on the mortgage, but has $64,000 in his IRA, and $10,000 in savings on his taxes. He could just remove the principle from the IRA and pay off the mortgage. But that would be stupid. In the average case, he has $96,000 in the IRA, and $10k in tax savings... Hmmm, he could pay off the mortgage and still have $30k in a tax free retirement account. But either way, the IRA is yielding $2k/year in dividends, which is enough to pay the mortgage principle and interest at this point...
Going forward to 20 years, the ROTH IRA investor has a worst case balance of $131k and $17k in tax savings, and owes $50k on his mortgage. Assuming after paying of the mortgage the pay-of-house case saw the light and started investing, he would have a $100k house plus $64k in the IRA... Bummer, he didn't get any tax savings those last 10 years. He has $164k, vs the worst case early investor with $204k, and a $47k mortgage balance (but still $53k in home equity). The average case has our ROTH IRA investor sitting on $301,000, plus $17,000 in tax savings, and $47k in mortgage debt.
The average case has our ROTH investor $170,00 better off. But that money is better, as all of it is in a tax-free account. He can withdraw $96,000 of that, tax free, whenever he wants. And he can ultimately take all of it out, tax free, plus any additional gains in retirement.
***The worst case here is not realistic, as the S&P500 has never yielded only 2% over 20 years. There are plenty of near-zero-risk fixed income instruments you can buy that will do better than 2%, but the average S&P returns are going to be far far far better over 20 year stretches, every time.