Google Answers Logo
View Question
 
Q: Need algorithms for a mortgage calculator ( No Answer,   0 Comments )
Question  
Subject: Need algorithms for a mortgage calculator
Category: Computers > Algorithms
Asked by: absentbodied-ga
List Price: $6.00
Posted: 17 Feb 2004 21:37 PST
Expires: 18 Mar 2004 21:37 PST
Question ID: 307850
I'm trying to program a mortgage calculator in Macromedia Flash
actionscript and I need algorithms for the math involved.  I'm trying
to solve for the following four fields:  Term of the loan (in months),
interest rate percentage, loan amount, and monthly payment.  I need
four algorithms because the user should be able to fill in any 3 of
these fields and my program should generate the fourth.  The
algorithms should follow the same rules as the VBA 'pmt' function. 
For a look at the 'pmt' function in action, you can download this
spreadsheet (http://www.californialendinggroup.com/Amschedule.zip)
which takes in interest rate, term, and loan amount and solves for
monthly payment.
Just the algebra for these equations will probably work, but if you
implement it in programming (using recursive functions, etc.) I'll
probably be able to port it.

Clarification of Question by absentbodied-ga on 17 Feb 2004 23:35 PST
This gives the basic equation we can use:
http://answers.google.com/answers/threadview?id=158440
Now I just need to see that equation solved for VA, i, and N in addition to C.

Request for Question Clarification by mathtalk-ga on 06 Mar 2004 06:27 PST
Of the other three quantities besides C, the only one which can be
easily solved for is VA:

VA = C * (1 - (1+i)^-n)/i

While one can explicitly solve for n, the formula cannot guarantee an
integer value of n.  In practice this corresponds to a payment
schedule in which the size of the final payment is smaller than the
equal sized payments that make of the rest of the schedule.  So some
additional rules are needed, unless you'd be satisfied with simply
getting values of n that aren't whole numbers.

Finally a solution for i in terms of VA, C, and n cannot be
"explicitly" formulated except in special cases, e.g. small values of
n.  To see why, let:

r = VA/C

and multiply both sides of:

r = (1 - (1+i)^-n)/i

by i * (1+i)^n.  Then for a whole number n:

r * i * (1+i)^n = (1+i)^n - 1

would be a polynomial equation for i of degree n+1, and in general it
must be solved by "iterative" methods instead of an explicit formula. 
One might also treat mathematically the solution for n not a whole
number, but I'm doubtful what significance this would have for your
intended application.

Since your interest is in programming to generate i and the other
values, this is scarcely a "show stopper", but it may explain why your
Question has not been answered yet, esp. in view of an offered price
that is normally associated with Questions that can be answered in a
single link or paragraph.  Yours is a three part Question whose parts
are of varying difficulty or "messiness".

regards, mathtalk-ga
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy