Generate a distribution for each i element of my sample

Asked

Viewed 20 times

1

I am interested in applying this model described in the variable d for each of the 1024 elements described in my second for and finally store the percentiles of each of these distributions in a vector I called vetorPercent.

I believe that with this code I am only generating a distribution d and not a distribution d[i] for each element i of my sample:

precomed = vector(mode = "numeric", length = 1581L)

for (x in 1:1581) {
  precomed[x] = (dados1[x] + dados2[x])/2
}

vetorPercent <- list()

for (i in 1:1024) {

  d <- dados3[i]*rnorm(1024, precomed[i], 
                                      sqrt(var(dados3)))

    vetorPercent[[i]] <- quantile(d, c(.05, .95))
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.