You are here: Re: Compound Interest/Future Value « PHP Language « IT news, forums, messages
Re: Compound Interest/Future Value

Posted by Dimitris Mexis on 12/26/05 18:55

Me, Myself, and I wrote:
> Why would you use a loop to calculate a basic financial calculation?
>
> $FV = $principal * pow((1 + $rate),($months_invested/12));
>
> or even
>
> $FV = $principal * pow((1 + $rate),($days_invested/365));
>
> now these formulas have been simplified for an annual effective rate of
> return (most usual) and not a simple interest formula. (ex not compunded
> monthly or semi annually as in some mortgages). now if this is for a real
> world application, you should note that not all financial institutions
> calaculate interest the same way, some will use simple interest for
> investment periods less than one year while using annual effect for one year
> or more. or basically whatever is in the contract.
>
> In addition some not so common factors may come into play. let's say that
> the investment period was jan 1 2007, maturing july 1, 2008. What is the
> investment period? 18 months? 1 year and 181days or 1 year and 182days for
> leap year? out of 365 or 366?
>
> does this really make a differance? If you are playing with large sums of
> money it does
>
> the difference of simple int vs annual effective on $1,000,000 dollars
> invested for 6 months at 10%
> simple interest 1,050,000.00. annual effective 1,048,808.85
>
> 181 days simple 1,049,589.04 annaul effective 1,048,398.13.
>
> the difference if in the end is real and noteworthy if it comes out of your
> pocket
>
> now let's say we are talking about a credit card that compunds monthly, well
> that changes everything. these are financial function and sould not be
> treated with loops but their actual mathmatical formulas.
>
> just googled for quick formulas http://www.frickcpa.com/tvom/TVOM_FV_SS.asp
> would be a good strating point on applied business math,
> http://www.kbapps.com/finance.html as well.
>
> here would be the two most common formulaes
> Annual Effective: $FV = $principal * pow((1 + $rate),($years +
> ($days/365))); here in canada this would be used by most insurance companies
> (defferred annuity products)
>
> Simple: $FV = ($principal * pow((1 + $rate),$years) ) * (1 +
> (($rate/365)*$days)); and this by most banks and trusts (GIC and Term
> Deposits)
>
> these are presented this way, since it is the method most commoly used and
> take into account leap years if they fall within the year. now call me cliff
> but some financial institutions will actually pay you that xtra day if u
> bitch enough. think about it, u lent your money to them for a day and should
> be paid for it. would you noate one day of your time to paint the walls of
> your bank branch? then why shoukd your money?
>
> anyhow there are other financial prodcuts such as debt instuments including
> bonds and their derivitives which are calculated differently
>
> sorry bout running off like that but if it helps or gives u some insight
> then great
>
> james
>
>
>
> "David Haynes" <david.haynes2@sympatico.ca> wrote in message
> news:hDvrf.43852$Yb5.34343@fe52.usenetserver.com...
> | Jake Jessup wrote:
> | > I'm having a little trouble building a calculator and I could use a
> little
> | > help.
> | >
> | > I'm trying to calculate the future value of an investment. This should
> be
> | > the equivelent of the FV function in MS Excel
> | >
> | > <?php
> | > $returnRate = $_POST["InterestRate"];
> | > $pVal = $_POST["LoanAmount"];
> | > $compYears =$_POST["Years"] ;
> | > $compPeriods = $compYears * 12;
> | >
> | > For ($i=0; $i<$compPeriods; $i++) {
> | > $pVal = ($pVal + ($pVal *($returnRate/$compPeriods)));
> | >
> | > Echo "Month: $i: $pVal<br>";
> | > }
> | > Echo "-------------<br>";
> | > Echo "Due $pVal<br>";
> | > Echo "Months $compPeriods<br>";
> | > Echo "Years $compYears<br>";
> | >
> | > ?>
> | >
> | > This works great as long as I'm only calculating 12 months. From the
> 13th
> | > month on I get the wrong results. For example, the result for the 24th
> month
> | > should be 414608.1674... but I get 380993.756596
> | >
> | >
> | >
> | > What am I doing wrong? All help is appreciated.
> | >
> | >
> | Your InterestRate is the annual rate and should always be divided by 12.
> |
> | -david-
> |
>
>


I never expected this dialog here, while I am having problem with the
formula that is used under banking system for evaluating a loan.
Do you have any suggestion? This is not the FV just that simple.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация