mercredi 27 septembre 2017

Runif is not generating a uniform distribution

n_len <- 400000
jdc<- data.frame(rnd = numeric(n_len))
jdc$rnd <- runif(n_len,0,1)
ggplot(jdc,aes(x = rnd)) + geom_density()

ggplot output

As you will note the distribution of the rnd variable drops off towards both boundaries.

I am trying to sample based on some i less than rnd, but range of i is between 0, .05, thus this distribution is a problem.




Aucun commentaire:

Enregistrer un commentaire