Files
ArtStudies/M1/Monte Carlo Methods/Exercise2.rmd
2024-09-18 16:53:09 +02:00

12 lines
239 B
Plaintext

# Exercise 2 : Exponential distribution and related distributions
```{r}
n <- 10000
u <- runif(n)
x <- -1/2 * log(1-u)
hist(x, breaks = 50, freq = FALSE)
curve(dexp(x, rate = 2), add = TRUE, col = "red")
qqplot(x, rexp(n, rate = 2))
```