;doc:roi: mention annualization differences, clean up TWR section

This commit is contained in:
Dmitry Astapov 2023-08-01 22:28:34 +01:00 committed by Simon Michael
parent 50f26c280e
commit c20ebae26d

View File

@ -15,9 +15,11 @@ could be an empty query (`--pnl ""` or `--pnl STR` where `STR` does
not match any of your accounts). not match any of your accounts).
This command will compute and display the internalized rate of return This command will compute and display the internalized rate of return
(IRR) and time-weighted rate of return (TWR) for your investments for (IRR, also known as money-weighted rate of return) and time-weighted
the time period requested. Both rates of return are annualized before rate of return (TWR) for your investments for the time period
display, regardless of the length of reporting interval. requested. IRR is always annualized due to the way it is computed, but
TWR is reported both as a rate over the chosen reporting period and as
an annual rate.
Price directives will be taken into account if you supply appropriate Price directives will be taken into account if you supply appropriate
`--cost` or `--value` flags (see [VALUATION](https://hledger.org/hledger.html#valuation)). `--cost` or `--value` flags (see [VALUATION](https://hledger.org/hledger.html#valuation)).
@ -125,15 +127,15 @@ different ways to compute rate of return, and this command implements
two of them: IRR and TWR. two of them: IRR and TWR.
Internal rate of return, or "IRR" (also called "money-weighted rate of Internal rate of return, or "IRR" (also called "money-weighted rate of
return") takes into account effects of in-flows and out-flows. return") takes into account effects of in-flows and out-flows, and the
Naively, if you are withdrawing from your investment, your future time between them. Investment at a particular fixed interest rate is
gains would be smaller (in absolute numbers), and will be a smaller going to give you more interest than the same amount invested at the
percentage of your initial investment, and if you are adding to your same interest rate, but made later in time. If you are withdrawing from
investment, you will receive bigger absolute gains (but probably at your investment, your future gains would be smaller (in absolute
the same rate of return). IRR is a way to compute rate of return for numbers), and will be a smaller percentage of your initial investment,
each period between in-flow or out-flow of money, and then combine so your IRR will be smaller. And if you are adding to your investment,
them in a way that gives you a compound annual rate of return that investment you will receive bigger absolute gains, which will be a bigger
is expected to generate. percentage of your initial investment, so your IRR will be larger.
As mentioned before, in-flows and out-flows would be any cash that you As mentioned before, in-flows and out-flows would be any cash that you
personally put in or withdraw, and for the "roi" command, these are personally put in or withdraw, and for the "roi" command, these are
@ -152,25 +154,28 @@ present value, and tries to find a discount rate that makes net
present value of all the cash flows of your investment to add up to present value of all the cash flows of your investment to add up to
zero. This could be hard to wrap your head around, especially if you zero. This could be hard to wrap your head around, especially if you
haven't done discounted cash flow analysis before. Implementation of haven't done discounted cash flow analysis before. Implementation of
IRR in hledger should produce results that match the `XIRR` formula in IRR in hledger should produce results that match the `=XIRR` formula in
Excel. Excel.
Second way to compute rate of return that `roi` command implements is Second way to compute rate of return that `roi` command implements is
called "time-weighted rate of return" or "TWR". Like IRR, it will also called "time-weighted rate of return" or "TWR". Like IRR, it will
break the history of your investment into periods between in-flows, account for the effect of your in-flows and out-flows, but unlike IRR
out-flows and value changes, to compute rate of return per each period it will try to compute the true rate of return of the underlying
and then a compound rate of return. However, internal workings of TWR asset, compensating for the effect that deposits and withdrawas have
are quite different. on the apparent rate of growth of your investment.
TWR represents your investment as an imaginary "unit fund" where in-flows/ TWR represents your investment as an imaginary "unit fund" where
out-flows lead to buying or selling "units" of your investment and changes in in-flows/ out-flows lead to buying or selling "units" of your
its value change the value of "investment unit". Change in "unit price" over the investment and changes in its value change the value of "investment
reporting period gives you rate of return of your investment. unit". Change in "unit price" over the reporting period gives you rate
of return of your investment, and make TWR less sensitive than IRR to
the effects of cash in-flows and out-flows.
References: References:
* [Explanation of rate of return](https://www.investopedia.com/terms/r/rateofreturn.asp) * [Explanation of rate of return](https://www.investopedia.com/terms/r/rateofreturn.asp)
* [Explanation of IRR](https://www.investopedia.com/terms/i/irr.asp) * [Explanation of IRR](https://www.investopedia.com/terms/i/irr.asp)
* [Explanation of TWR](https://www.investopedia.com/terms/t/time-weightedror.asp) * [Explanation of TWR](https://www.investopedia.com/terms/t/time-weightedror.asp)
* [IRR vs TWR](https://smartasset.com/investing/time-weighted-return)
* [Examples of computing IRR and TWR and discussion of the limitations of both metrics](https://blog.commonwealth.com/measuring-portfolio-performance-twr-vs.-irr) * [Examples of computing IRR and TWR and discussion of the limitations of both metrics](https://blog.commonwealth.com/measuring-portfolio-performance-twr-vs.-irr)