Consider the following 11 continuous non-negative observations:
0, 0.3, 0.31, 0.33, 0.37, 0.49, 0.51, 0.53, 0.59, 0.6
- Obtain the empirical cumulative distribution function for these observations.
- Use the inversion method to simulate 1000 readings from this ECDF.
I tried using:
A<-c(0, 0.3, 0.31, 0.33, 0.37, 0.49, 0.51, 0.53, 0.59, 0.6)
ecdf(A)
plot.ecdf(A, main="ECDF of sample")
But this was I cannot get the function, and hence cannot simulate. Any ideas please?
runif
and thequantile
function, with careful consideration whichtype
is most suitable here $\endgroup$ – Henry Feb 12 '20 at 23:46