# Calculating returns across multiple securities and time

I've been getting very confused on the topic of calculating returns. To get cumulative returns in time, log-returns are used, but apparently log-returns aren't used across different securities at a fixed time?

I would like to work with log-returns. I have two securities, `A` and `B`. I buy both A and B when the market opens and sell when it closes.

Suppose these are the prices for a specific day:

``````    open    close
A   9       10
B   10      8
``````

What is my overall return for that day? If we calculate normal returns, I have 11.1% return on A and -20% return on B. If calculating normal returns, I've read elsewhere that the total return is the average of 11.1% and -20% yielding a total return of -4.44%. How about a total log-return?

• Surely your total return is (10 + 8) - (9 + 10) = -1 or 5.2% of the sum invested (19) ? – Peter K. Oct 7 '15 at 1:40
• I don't understand your calculation, but I think you're onto something. I wonder if the final log-return would be log(10+8) - log(10+9) = -0.023 or -2.3%. Is that correct? – David Oct 7 '15 at 1:41
• Peter simply calculated the total \$1 lost over the original amount invested. You lost 1/19. – JTP - Apologise to Monica Oct 7 '15 at 2:36
• It's just the guzzoutas minus the guzzintas (how much you get back minus how much you put in). Though I should have said -5.2% rathern than just 5.2%. – Peter K. Oct 7 '15 at 11:41
• What I'm after is getting the cumulative sum of my portfolio as a function of time. How do I do that with normal returns rather than log-returns? – David Oct 7 '15 at 14:15

Your question lacks some context since you're obviously confused about some things you read somewhere else, but you haven't given us much information about what it was. I'll try to answer putting in some context as best I can from what you said and general principles.

First, there's no strict rule that says using log or not using log is always better. There's some mathematical equivalences that more or less say that you can get to any result that you want using either approach. The practical question is whether it's easier or harder using one method or the other. The logarithm has a couple of nice properties that can help you in some calculations, especially that log (xy) = log(x) + log(y), in other words it "changes products to sums." If you're doing quantitative analysis, you may also care a lot that the derivative and integral of exp is exp itself, which will simplify a lot of calculations. (Since log and exp are inverses of each other, this is more related to your question about logs than it might appear.) There are other reasons too (log-normal distributions, numerical stability, ...), but I won't get too deep into those here.

In your problem as stated in your question, it seems most natural to think about this without logarithms. In that case, you have properly computed the individual returns in the statement of your question. The total return is (\$18 - \$19)/\$19 based on your total investment (\$19) and your total recovered (\$18). Looks like that's r = -5.3%. You said "I've read elsewhere that the total return is the average..." and that is wrong. You either misunderstood or there was some qualifying statement that you haven't passed along. (For example, it would work out to be true if you invested the same initial amount in A and in B even though it's not true in general.)

If you want the log total return, then you're really asking for log(1 + r) = log(0.947) = -.054.

Your problem as clarified in your comments is to compute your cumulative portfolio value as a function of time. This again requires a little interpretation, because in most cases I would think that would be the input that you have to compute returns. If for some reason you do have, say, daily return rates r1, r2, r3, ..., rN, then your cumulative return will be (1 + r1)(1 + r2)...(1 + rN) p, where p is your starting principal. This formula makes some assumptions about how the returns are computed though, so you'd need to make sure that it makes sense in your context.

If you want some external reading, I think this article has a good summary of reasons for going to the log space. It covers some of what I mentioned plus some additional reasons. https://quantivity.wordpress.com/2011/02/21/why-log-returns/

• Thanks for that write up. I'll use the `cumprod()` to calculate cumulative return. Just a follow up: would my return (aside from principal) for, say, day 2, be (1+r1)(1+r2), or (1+r1)(1+r2)-1? – David Oct 7 '15 at 15:06