hist(rnorm(1000)/rnorm(1000), breaks=20000, xlim=c(-5,5), col = "grey", main = "X/Y Normal Distribution")
hist(rcauchy(1000), breaks=20000, xlim=c(-5,5), col = "grey", main = "Cauchy Distribution")
The two histograms are quite similar.
Lets simulate with 10000 trials.
trials <- 10000
# Normal Distribution
norm_dist <- rep(0,trials)
norm_avg <- rep(0,trials)
# Cauchy Distribution
cauchy_dist <- rep(0,trials)
cauchy_avg <- rep(0,trials)
# Calculate average
for (n in 1:trials) {
norm_dist[n] <- mean(rnorm(1000))
norm_avg[n] <- mean(norm_dist[1:n])
cauchy_dist[n] <- mean(rnorm(1000)/rnorm(1000))
cauchy_avg[n] <- mean(cauchy_dist[1:n])
}
# Cauchy plot for mean
plot(cauchy_avg, col = "red", main="")
# normal dist plot for mean
plot(norm_avg, col = "red", main="")
As we can see normal distribution converges to 0 but cauchy doesn’t.