<a id="sphx-glr-auto-examples-data-preparation-plot-1-investment-horizon-py"></a>

<a id="investment-horizon"></a>

# Investment Horizon

This tutorial explores the difference between the general
procedure using different investment horizons and the simplified procedure as explained
in [data preparation](https://skfolio.org/user_guide/data_preparation.html.md#data-preparation).

<a id="prices"></a>

## Prices

We load the S&P 500 [dataset](https://skfolio.org/user_guide/datasets.html.md#datasets) composed of the daily prices of 20
assets from the S&P 500 Index composition starting from 1990-01-02 up to 2022-12-28:

```Python
from plotly.io import show

from skfolio import PerfMeasure, Population, RiskMeasure
from skfolio.datasets import load_sp500_dataset
from skfolio.optimization import MeanRisk
from skfolio.preprocessing import prices_to_returns
from skfolio.prior import EmpiricalPrior

prices = load_sp500_dataset()
prices.head()
```

[plotly figure stripped from llms output]
<br />
<br />

We can see that the simplified procedure only start to diverge from the general one
for investment horizons longer than one year.

**Total running time of the script:** (0 minutes 2.856 seconds)

<a id="sphx-glr-download-auto-examples-data-preparation-plot-1-investment-horizon-py"></a>
