I am learning the basics of portfolio management. I am confused about different ways to calculate rate of returns mentioned in the text investment and portfolio analysis.

There are three methods to calculate rate of return

1. mean of last n years returns

2. Through CAPM and Asset pricing theory

3. Based on stock valuation and forecasting of earnings

So which one we should use and when, especially while trying to find optimal portfolio weights

No. 1 is inaccurate unless you use $N>>10$ years of data. But decades of data may not be available or may no longer be relevant to today's economy.