Write a program in (mathrm{R}) that generates a sample (X_{1}, ldots, X_{n}) from a specified distribution (F),
Question:
Write a program in \(\mathrm{R}\) that generates a sample \(X_{1}, \ldots, X_{n}\) from a specified distribution \(F\), computes the empirical distribution function of \(X_{1}, \ldots, X_{n}\), computes the maximum distance between \(\hat{F}_{n}\) and \(F\), and computes the location of the maximum distance between \(\hat{F}_{n}\) and \(F\). Use this program with \(n=5,10,25,50\), and 100 and plot the sample size versus the maximum distance to demonstrate Theorem 3.18. Separately, plot the location of the maximum distance between \(\hat{F}_{n}\) and \(F\) against the sample size. Is there an area where the maximum tends to stay, or does it tend to occur where \(F\) has certain properties? Repeat this experiment for each of the following distributions: \(\mathrm{N}(0,1)\), Binomial \((10,0.25)\), Cauchy \((0,1)\), and \(\operatorname{Gamma}(2,4)\).
Step by Step Answer: