Professional Documents
Culture Documents
Mohaimen Mansur
set.seed(1001)
n <- 100
x <- rnorm(n, mean = 3, sd = 2)
hist(x)
Histogram of x
30
25
20
Frequency
15
10
5
0
−4 −2 0 2 4 6 8 10
mean(x)
## [1] 2.998305
sd(x)
## [1] 2.288979
1
sqrt((n-1)/n)*sd(x) # MLE of sigma
## [1] 2.277506
##
## Call:
## mle(minuslogl = LL, start = list(mu = 1, sigma = 1), optim = options(warn = -1))
##
## Coefficients:
## mu sigma
## 2.998305 2.277506
## [1] 0.36
##
## Call:
## mle(minuslogl = LL3, start = list(p = 0.1))
##
## Coefficients:
## p
## 0.3600002
# Exercise: Find the MLE of parameters for Poisson, Exponential and Gamma distributions.