计算可调利率抵押贷款的财务公式?
如何根据贷款的开放时间计算具有两种不同利率的贷款期限的固定付款金额?
How can I calculate a fixed payment amount for a loan term that has two different interest rates based on how long the loan has been open?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这有点难看,所以请耐心等待。
定义:
那么:
当然,我可能犯了一个错误,但看起来是对的。
This gets a little ugly, so please bear with me.
Define:
Then:
Of course, I may have made a mistake, but that seems right.
这是一个相当复杂的计算,通常是公司知识产权的一部分。所以我怀疑有人会发布代码。我一直在这条路上走下去,它需要大量的测试,具体取决于你决定走多远。
在代码中执行计算时,使用 Decimal 等数据类型而不是 double 等浮点类型至关重要。小数是为这些类型的货币计算而明确创建的。浮点类型会导致许多舍入误差,使计算值偏离不可接受的量。
其次,您在网上找到的抵押贷款计算器的质量参差不齐。在测试您的方法时,查看在线计算器得出的结果会很有用,但绝不认为它们比您的更准确。一般来说,他们很乐意了解您的情况是否正确,但贷款期限每年可能会有高达 0.1% 的偏差。
最后说明
考虑从 Math Corp 这样的公司购买库,而不是自己开发库。我很确定它会是准确的,并且比开发/质量保证时间便宜得多。
This is a pretty complicated calculation that is usually part of a company's intellectual property. So I doubt anyone is going to post code. I've been down this road and it requires huge amounts of testing depending on how far you decide to go with it.
When performing the calculations in code it is critical that you use a data type such as Decimal instead of the floating point types like double. Decimal was explicitly created for these types of money calculations. Floating point types will cause many rounding errors, making the calculated values be off by unacceptable amounts.
Next, mortgage calculators that you find online are of highly varying quality. When testing your method it will be useful to see what the online calculators come up with, but by no means consider them more accurate than yours. Generally they are good to see if you are in the right ballpark, but they could be off by as much as .1% per year of the loan term.
Final note
Consider purchasing a library from a company like Math Corp instead of rolling your own. I'm pretty sure it'll be accurate AND much cheaper than the dev / qa time to get yours right.
贷款合同非常复杂。如果您不想深入研究复杂性,则必须做出一些简化的假设。以下是您需要考虑的一些变量:
正如您所看到的,如果您还没有足够详细地说明您要解决的问题,甚至无法开始提出解决方案。
如果您不是 ARM 或一般金融产品领域的专家,我强烈建议您寻找专家。
Loan contracts are very complex. If you don't want to dive into the complexity you have to make some simplifying assumptions. Here are some of the variables you need to consider:
As you can see, if you haven't specified enough about the problem that you are trying to solve to even begin to come up with a solution.
If you're not a domain expert on ARMs or financial products in general I strongly encourage you to find someone who is.
pmt 函数基于以下数学:
还款额 = 当前贷款金额 / ( 1 - ( 1 / ( 1+ 当前利率)^剩余期数 ) )
计算出当前贷款金额(即以不同利率还款五年后)困难的部分。
The pmt function is based on this math:
Payment = Loan Amount at current time / ( 1 - ( 1 / ( 1+ current rate)^numperiods remaining ) )
Figuring out the loan amount at the current time (i.e. after five years of making a payment at a different rate) is the tough part.