Hacker News new | ask | show | jobs
by ryanmonroe 1844 days ago
As others have said, "Average return is just one statistic". When trading, losses hit harder than wins. Go up 50% then down 50% and you're not even, you're down 25%. The degree of overestimation from this mean return -> "annualized return" calculation depends on what the returns distribution looks like.

Here's the calculation used in main.js line 77 applied to a very extreme unrealistic example. I simulated 253 days of return percentages from a uniform distribution between -5.5% and 5.6%, and then the actual total return percent, calculated in R

    set.seed(2020)
    n <- 253
    daily_gain <- runif(n, -.055, .056)
    
    total_gain <- sum(daily_gain)
    avg <- total_gain/n
    annualizedReturn <- (1 + avg)^n -1
    
    annualizedReturn
    # [1] 0.2933685
    
    prod(1 + daily_gain) - 1
    # [1] 0.1324846
Edit:

In reality the actual numbers are likely to be not nearly as different as this example. I chose uniformly distributed returns with a wide range to make the reason against this calculation very obvious. Here's an example return distribution where there's hardly any difference. Normal returns with average of 0.085% and standard deviation of .05 i.e. daily_gain <- rnorm(n, .085/100, .05/100) gives

    annualizedReturn
    # 1] 0.2414539
    
    prod(1 + daily_gain) - 1
    # [1] 0.2414051
For good measure here's one in the middle where your returns are normally distributed with an average of 0.35% and a sd of .2%, but then you have on average 10 bad days a year where returns are 5 percentage points lower than that distribution i.e. daily_gain <- rnorm(n, .35/100, .2/100) - rbinom(n, 1, 10/n)*.05 gives

    annualizedReturn
    # [1] 0.2712024
    
    prod(1 + daily_gain) - 1
    # [1] 0.2490317
5 comments

> Go up 50% then down 50% and you're not even, you're down 25%.

It helps if you measure in the right units[0], namely bits, orders of magnitude, or fractions thereof. Up 50% is log(1.5) = +0.58 bits, down 50% is log(0.5) = -1 bits, and indeed 0.58-1 = -0.42, or 1.5*0.5=0.75, down 25%.

0: Well, strictly speaking the problem is that up/down X% isn't even in units at all.

I assumed they meant dollars.
Don’t know why this is on HN front page given it is an error.
The wording in the original comment was too strong, I've edited it. It's probably not best to consider it a plain "error" since this calculation is actually a typical one provided in finance. It's just that you usually look at other stats too rather than just this one, which gives you an idea about its accuracy wrt realized return e.g. Sharpe, Max Drawdown, Skew, Kurtosis
No, you were correct, arithmetic mean of returns is not standard in finance. If it was, financial crashes would be much worse. They do arithmetic means of "log returns" because 1/n sum(log(r)) = log(product(r)^(1/n)). That is, in log world, the arithmetic mean is the geometric mean.
Is it normal to deal with returns over time as log-returns log(R) rather than simple returns (R - 1) for this reason? The average log return does the right thing.
Right, I used to use the geometric mean when dabbling in this area in my teens which is mathematically equivalent to averaging the log returns.
The uniform distribution is the wrong distribution for this. A normal distribution is better, but also wrong- the normal distribution significantly under-predicts extreme events relative to the stock market.

Can you try it with the Laplace distribution? It's a bell curve like the normal distribution, but has fat tails. Extreme events aren't common, but much more common than with a normal distribution.

https://arxiv.org/pdf/1906.10325.pdf

Where do you take that uniform distribution from? I don’t think any ETF would conform to that.
> I chose uniformly distributed returns with a wide range to make the reason against this calculation very obvious.

The uniform distribution is a pedagogical choice, to explain why OP's average return calculation is misleading.

That’s the point - the choice of a normal distribution is misleading. It doesn’t model market behaviour on any time scale.

Backtesting is more likely to be meaningful. Am I missing something here?

The question isn’t backtesting vs no backtesting. The question is do you use the arithmetic mean of daily returns as your metric or use the final return over the entire period. The arithmetic mean hides the fact that large downswings hurt your net return more than they would otherwise seem to, and is therefore misleading, making the strategy looking better than it actually is.