使用 Reg Z 附录 J 计算年利率
好的。我是这个网站的新手,所以“大家好”!上周我一直在努力解决一个难题,如果您能给我任何帮助,我将不胜感激。
我知道有很多公式可以计算年利率,但我测试了很多公式,它们不能正确处理封闭式(消费贷款)的奇数日。政府试图通过发布其真实借贷法案的附录 J 来为我们这些凡人提供一些帮助。 可以在这里找到:https://www.fdic.gov/regulations /laws/rules/6500-3550.html
如果您足够勇敢(!!),您可以看到他们提供的公式,该公式将解决 APR,包括 贷款。奇数日是贷款开始时未真正包含在定期付款中但仍收取利息的日子。例如,您于 01/20/2012 借了一笔 1,000.00 美元的贷款,您的第一笔付款日期为 03/01/2012。从 01/20/2012 到 01/30/2012 有 10 个奇数日。所有月份的计算都是 30 天。
我希望有一个在微积分方面具有重要背景的人能够解释附录 J 中的公式,并解释他们用来求解这些公式的精算方法。我理解迭代过程。我首先尝试使用 Newton-Raphson 方法来解决这个问题,但我的 APR 公式没有考虑奇数天。它在没有奇数日的不太简单的情况下效果很好,但在奇数日时却很困难。
我知道阅读这份文档是非常困难的!我已经取得了一些进展,但有些事情我就是不明白他们是怎么做的。他们似乎神奇地介绍了一些东西。
无论如何,提前感谢您的帮助! :)
OK. I'm brand new to this site so "Hello All"! Well I've been wrestling with a difficult problem for the last week and I would appreciate any help you can give me.
I know there are many formulas out there to calculate APR but I've tested many formulas and they do not handle Odd-Days properly for closed-end (consumer loans). The government has attempted to give us mere mortals some help with this by publishing an Appendix J to their truth-in-lending act.
It can be found here: https://www.fdic.gov/regulations/laws/rules/6500-3550.html
If you're brave (!!), you can see the formulas they provide which will solve for the APR, including the Odd-Days of the loan. Odd-Days are the days at the beginning of the loan that isn't really covered by a regular period payment but interest is still being charged. For example, you take a loan for $1,000.00 on 01/20/2012 and your first payment is 03/01/2012. You have 10 odd-days from 01/20/2012 to 01/30/2012. All months are 30 days for their calcs.
What I'm hoping for is someone with a significant background in Calculus who can interpret the the formulas you'll find about half way down Appendix J. And interpret the Actuarial method they're using to solve these formulas. I understand the iterative process. I first tried to solve this using the Newton-Raphson method but my formula for the APR did not account for the Odd-days. It worked great in the unlikely trivial case where there are no odd days, but struggled with odd-days.
I know that reading this document is very difficult! I've made some headway but there are certain things I just can't figure out how they're doing. They seem to introduce a few things as if by magic.
Anyways thanks ahead of time for helping! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,您并不是在开玩笑说该文档有点难以阅读。不过,该解决方案实际上并没有那么糟糕,具体取决于实施情况。我多次尝试使用他们的各种简化论坛,但都失败了,最终使用顶部的通用公式(8)得到了它。从技术上讲,这是一种简化。实际的通用公式将采用长度为
period
的数组作为其他参数,并在循环中使用它们的索引。您可以使用此方法获取迭代步骤的 A' 和 A''。奇数天由(1.0 +fractions*rate)
处理,在文档中显示为1 + fi
。利率是每个时期的利率,而不是全年的利率。迭代的行为正如文档中的示例(9)所述。
请注意,作为一般规则,像我在这里所做的那样使用 double 进行货币计算是不好的,但我正在编写一个 SO 示例,而不是生产代码。另外,它是 java 而不是 .net,但它应该可以帮助您了解算法。
Alright, you weren't kidding about the document being a bit hard to read. The solution is actually not that bad though, depending on implementation. I failed repeatedly trying to use their various simplified forumulae and eventually got it using the general formula up top(8). Technically this is a simplification. The actual general formula would take arrays of length
period
for the other arguments and use their indexes in the loop. You use this method to get A' and A'' for the iteration step. Odd days are handled by(1.0 + fractions*rate)
, which appears as1 + f i
in the document. Rate is the rate per period, not overall apr.Iteration behaves just as the document says in its example(9).
Note that as a general rule it is BAD to use double for monetary calculations as I have done here, but I'm writing a SO example, not production code. Also, it's java instead of .net, but it should help you with the algorithm.
虽然这是一个旧线程,但我想帮助其他人避免在这方面浪费时间 - 将代码翻译为 PHP(甚至 javascript),给出的结果非常不准确,让我想知道它是否真的在 Java 中工作 -
APR: 12.5000 %
总财务费用:1,695.32 美元
融资金额:$10,000.00
付款总额:11,695.32 美元
贷款总额:$10,000.00
每月付款:389.84 美元
总利息:1,695.32 美元
Tho this is an old thread, I'd like to help others avoid wasting time on this - translating the code to PHP (or even javascript), gives wildly inaccurate results, causing me to wonder if it really worked in Java -
APR: 12.5000%
Total Financial Charges: $1,695.32
Amount Financed: $10,000.00
Total Payments: $11,695.32
Total Loan: $10,000.00
Monthly Payment: $389.84
Total Interest: $1,695.32
我在这里得到了 Python (3.4) 翻译。由于我的应用程序将日期作为输入,而不是全部和部分付款期限,因此我引入了一种计算这些日期的方法。我引用了 OCC APRWIN 编写者之一的文档,并且我如果您需要重新翻译,建议其他人阅读它。
我的测试直接来自 Reg Z 示例。我还没有对 APRWIN 进行进一步的测试。我不必处理(因此没有编码)的一个边缘情况是,当您只有两期付款且第一期是不规则期间时。如果这是您的应用程序的潜在用例,请检查上面的文档。我还没有完全测试大部分付款计划,因为我的应用程序只需要每月和每季度。其余的只是使用 Reg Z 的示例。
I got me a Python (3.4) translation here. And since my application takes dates as inputs, not full and partial payment periods, I threw in a way to calculate those. I referenced a document by one of the guys that wrote the OCC's APRWIN, and I'd advise others to read it if you need to re-translate this.
My tests come straight from the Reg Z examples. I haven't done further testing with APRWIN yet. An edge case I don't have to deal with (so haven't coded for) is when you only have 2 installments and the first is an irregular period. Check the document above if that's a potential use case for your app. I also haven't fully tested most of the payment schedules because my app only needs monthly and quarterly. The rest are just there to use Reg Z's examples.