HP-41 Internal Rate of Return (IRR)
|
11-03-2024, 08:02 AM
(This post was last modified: 11-05-2024 01:51 PM by Ángel Martin.)
Post: #1
|
|||
|
|||
HP-41 Internal Rate of Return (IRR)
Calculation of IRR, Internal Rate of Return
i.e. interest rate for which the Net Present Value (NPV) is zero. Here's a short FOCAL routine I've used as benchmark while working on a MCODE version of IRR soon to be released. The routine prompts for the initial Capital investment C0, the number of periods N, and the first cash-flow C1. Based on C1 the remaining cash-flows are calculated using two options, LBL "IRR+" for the aithmetic: Cn = C1+k*(n-1) LBL "IRR*" for the geometric: Cn = C1* (1+k)^(n-1) with k being the ratio also an input prompted by the program. The program solves for IRR using SOLVE (or FROOT if you use the SandMath). In his version the Initial guesses are hard-coded to be 0.1 and 0.5 Example: With C0=(250.000,00), C1 = 100.000,00, N=5 arithmetic, k=50.000,000 => IRR = 56.72% geometric, k=0.05 (5%) => IRR = 32.50% Code: 1 LBL "IRR+" Cheers, ÁM "To live or die by your own sword one must first learn to wield it aptly." |
|||
11-05-2024, 09:27 AM
(This post was last modified: 11-05-2024 09:30 AM by Stephan61.)
Post: #2
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
Hi Ángel, three observations:
1. Step 47: "LBL 03" seems obsolete? 2. Step 60: "-" you changed this from "+" to "-" that means C0 has to be entered positiv instead of negative, right? 3. I can't replicate your geometric example: I get 0,2865 (28,65%) Ciao Stephan PS: Looking forward to your MCODE-version! |
|||
11-05-2024, 11:41 AM
Post: #3
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
(11-05-2024 09:27 AM)Stephan61 Wrote: Hi Ángel, three observations:indeed it is, sorry I forgot to remove it. (11-05-2024 09:27 AM)Stephan61 Wrote: 2. Step 60: "-" you changed this from "+" to "-" that means C0 has to be entered positiv instead of negative, right?Darn typos, I meant to change it to "plus" in the comment and instead I did the opposite. The correct step should be "+", which implies that (c0) needs to be entered as a negative value at the prompt. (11-05-2024 09:27 AM)Stephan61 Wrote: 3. I can't replicate your geometric example: I get 0,2865 (28,65%) mmm... it's possible that something got weird in my last editing, let me look at it and will get back to you on this. "To live or die by your own sword one must first learn to wield it aptly." |
|||
11-05-2024, 01:54 PM
(This post was last modified: 11-05-2024 01:55 PM by Ángel Martin.)
Post: #4
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
Sure enough there was a glitch and a wrong formula used for Cn in the geometric case.
I have corrected the original post, pls. try again and let me know if it works for you. Note: you can use LBL 10 for the NOP in step 49 "To live or die by your own sword one must first learn to wield it aptly." |
|||
11-05-2024, 02:09 PM
Post: #5
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
Thanks a lot for this fast action!
|
|||
11-19-2024, 07:32 PM
Post: #6
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
Albert,
I was taught by American Jesuits from Boston College. Their motto in sharing information was "Hit the point!". I followed that motto in my carrier as a programming book writer. I humbly sugget you create your own website (as I have done) where you post PDF/ZIP files for each set of calculations you produce. Then you post a single summary/brief thread in this web site to explain the general concepts you are sharing and offer a link to the PDF/ZIP file in your web site. This way folks who are interested can download AND keep your documents for future reference. Namir |
|||
Yesterday, 08:26 AM
Post: #7
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
(11-19-2024 07:32 PM)Namir Wrote: I was taught by American Jesuits from Boston College. Their motto in sharing information was "Hit the point!". I followed that motto in my carrier as a programming book writer. I humbly sugget you create your own website (as I have done) where you post PDF/ZIP files for each set of calculations you produce. Then you post a single summary/brief thread in this web site to explain the general concepts you are sharing and offer a link to the PDF/ZIP file in your web site. This way folks who are interested can download AND keep your documents for future reference. I Fully subscribe to Namir's comments, thank you! "To live or die by your own sword one must first learn to wield it aptly." |
|||
Yesterday, 01:57 PM
Post: #8
|
|||
|
|||
RE: HP-41 Internal Rate of Return (IRR)
Hi, Namir
I have moved IRR calculations using TVM to my TVM thread, where it belongs. https://www.hpmuseum.org/forum/thread-18359-page-4.html I had not considered this site might be down. Thanks for the heads up. If I have time, I shall write it up, 'freeze' as pdf, and post to https://github.com/achan001 https://archiveprogram.github.com/ Wrote:On 02/02/2020 GitHub captured a snapshot of every active public repository. Those millions of repos were then archived to hardened film designed to last for 1,000 years, and stored in the GitHub Arctic Code Vault in a decommissioned coal mine deep beneath an Arctic mountain in Svalbard, Norway. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)