In the first project of the DS6 course we investigated the exponential distribution and the Central Limit Theorem.
lambda <- 0.2; n <- 40; nosim <- 1000
demo_exp <- rexp(n, lambda)
The mean of the exponential distribution is: \(\mu = 1/\lambda\) and the standard deviation is: \(\sigma = 1/\lambda\)
# Mean of the demo distribution: Theory vs Computed demo
c(1/lambda, mean(demo_exp))
## [1] 5.000000 4.353505
# Standard deviation of the demo distribution: Theory vs Computed demo
c(1/lambda, sd(demo_exp))
## [1] 5.00000 5.27591