
1. Re: [XPOST]How to program Newton / Raphes in Filemaker?
user19752 Nov 26, 2015 12:54 AM (in response to hjgunn@mmedia.is)Recursive custom function will do it.
Doesn't financial functions give you enough calculations for loan?

2. Re: [XPOST]How to program Newton / Raphes in Filemaker?
hjgunn@mmedia.is Nov 26, 2015 6:54 AM (in response to user19752)"Recursive custom function will do it."
I'm no good at recursive custom functions so I wrote a script. :)
"Doesn't financial functions give you enough calculations for loan?"
I'm not calculating a loan, I'm calculating the EAPR for a loan.
So far I have not found any financial functions in Filemaker that does anything like this. And actually there are only four of them.
It may be that I'm calculating a similar thing as the NPV function only that in my case the Interest rate is the unknown variable.
Actually I seem to have built this functionality using the records of a previously created payment schedule rather than the slots of a repeating field.
I'm attempting to solve the following formula using using Newton / Raphes :
Sum [L = 1 to M] of D(1 + X)^(S), for the value of X.

3. Re: [XPOST]How to program Newton / Raphes in Filemaker?
user19752 Nov 27, 2015 8:03 PM (in response to hjgunn@mmedia.is)I don't see L in your formula, so read the previous post. But I forgot mathing, not sure the "Newton" can be applied to the formula (it has x^(a/b) in denominator).

4. Re: [XPOST]How to program Newton / Raphes in Filemaker?
Markus Schneider Nov 27, 2015 10:54 PM (in response to hjgunn@mmedia.is)briandunning.com is always a good starting point when it comes to custom functions:
FileMaker Custom Function:IRR ( cashFlowsList ; guessRate )
(FileMaker Pro Advanced needed)

5. Re: [XPOST]How to program Newton / Raphes in Filemaker?
hjgunn@mmedia.is Nov 27, 2015 11:40 PM (in response to user19752)Sorry I hadn't noticed that you can add an image here.
This is the actual formula I'm working with.
L= 1 is under the summary in the right hand formula.
Solving it for X would involve using Root solving methods, where of there are several, two of them being Bisection and Newton Raphes. Additional being Quasi Newton methods and others.
To use Newton I would need the derivative, which I suspect would be something in the direction of S* (1+x)^S1
S again would be something like (Days / DaysInYear) + MonthsUntilMonthOfPayment / 12)
However, once it comes to solving the formula, S will be a fully calculated number and no longer the formula for S.
But I still have to figure out the actual derivative. I haven't gotten around to that yet.

6. Re: [XPOST]How to program Newton / Raphes in Filemaker?
user19752 Nov 27, 2015 11:41 PM (in response to hjgunn@mmedia.is)It seems cf Markus Schneider shows will resolve your problem, your link
http://www.creditunion.ie/files/file_20050316024652OFT%20%20Credit%20Charges%20and%20APR.pdf
says
APR = 100*((1+IRR)^freq1)
But indeed, I don't know what EARP is Do you want APR?

7. Re: [XPOST]How to program Newton / Raphes in Filemaker?
hjgunn@mmedia.is Nov 27, 2015 11:53 PM (in response to user19752)EAPR is similar to APR with occurred cost added before calculating the value.
It seems that many references use the term APR for what is actually the Nominal interest rate and EAPR for the Nominal interest rate including occurred cost. So that a loan of 100.000 with 7% interest rate could show an EAPR of for example 7,32% depending on the cost and the length of the loan. This number is then used to compare the actual cost of different loans.

8. Re: [XPOST]How to program Newton / Raphes in Filemaker?
hjgunn@mmedia.is Nov 28, 2015 3:14 AM (in response to user19752)I owe you an apology...
I hadn't noticed until now that I wrote EARP instead of EAPR ( Extended Annual Percentage Rate ).
Hans