# Convergence of the distribution of 0.05 quantiles through Monte-Carlo simulation

I am trying to get admitted to a masters in quantitative finance (I come from a computer science background), so next week I will have 3h to solve an exam in statistical computing using my favourite language (they recommended either MATLAB, Python or R). The mock exam I was provided with asks the following:

Generate a 2-year time-series (500 observations) from a stable distribution with parameters $$\alpha = 1.5, \quad \beta = 0.0, \quad \gamma = 1.0, \quad \delta = 1.0$$

a) Find the distribution of the $0.05$ quantiles of 5-day overlapping returns obtained from the 2-year time-series of 1-day returns.

b) Prove (numerically or theoretically) that enough trials have been considered.

Note: taking $P_i$ as the price on the $i$-th day,

• 1-day returns: $R_{1}^{i} = \frac{P_{i+1} - P_{i}}{P_{i}}, \; i=1,\ldots,499$
• n-day returns: $R_{n}^{i} = \frac{P_{i+n} - P_{i}}{P_{i}}$.

I am a little bit confused about the whole thing, so I would like some help to check if I am approaching this problem correctly. Here is how I would solve it:

1) generate a 500 value time-series using this technique (I'm assuming they're referring to the alpha-stable family of distributions);

2) after playing around a bit, I'm able to obtain the 5-day returns time-series from the original 1-day returns time-series: $$R^{n}_{i} = (R^{1}_{i} + 1) (R^{1}_{i+1} + 1) \ldots (R^{1}_{i+n-1} + 1) - 1$$

3) compute the empirical distribution function of the 5-day returns, say $F(x)$;

4) estimate each quantile $q_{\eta}$ by $$\hat q_{\eta} = F^{-1}(\eta)$$

Note: To invert the empirical distribution function I would order the simulated values by their size and then pick the value at position $k = \min \{ n \in \{ 1, \ldots, N \} | n/N \geq \eta \}$

5) save the distribution of $0.05$ quantiles

6) repeat steps 1) through 5) a minimum number of times, $K$, that I need to determine through some convergence law or something.

Question: Any hints on how to determine $K$?