i want to simulate it 500 times but this function gives 187 correct values but after 187 values it give NA values

The line:


initializes X1 with 188 values. If you’re indexing X1[189], there is an error.

Try this:

print (X1[189])
> NA

In order to correct it, just change your runif:


Browse More Popular Posts

Leave a Comment