# -------------------------------------------
# Beta Distribution Example
# -------------------------------------------
# Simulation
set.seed(1)
shape1 <- 1
shape2 <- 2
x <- rbeta(100, shape1, shape2)
library(distr)
D <- Beta(shape1, shape2)
# Likelihood - The ll Functions
llbeta(x, shape1, shape2)
ll(x, c(shape1, shape2), D)
ll(x, c(shape1, shape2), "beta")
# Point Estimation - The e Functions
ebeta(x, type = "mle")
ebeta(x, type = "me")
ebeta(x, type = "same")
mle(x, D)
me(x, D)
same(x, D)
estim(x, D, type = "mle")
# Asymptotic Variance - The v Functions
vbeta(shape1, shape2, type = "mle")
vbeta(shape1, shape2, type = "me")
vbeta(shape1, shape2, type = "same")
avar_mle(D)
avar_me(D)
avar_same(D)
avar(D, type = "mle")
Run the code above in your browser using DataLab