# -----------------------------------------------------
# Cauchy Distribution Example
# -----------------------------------------------------
# Create the distribution
x0 <- 3 ; scale <- 5
D <- Cauchy(x0, scale)
# ------------------
# dpqr Functions
# ------------------
d(D, c(-5, 3, 10)) # density function
p(D, c(-5, 3, 10)) # distribution function
qn(D, c(0.4, 0.8)) # inverse distribution function
x <- r(D, 100) # random generator function
# alternative way to use the function
df <- d(D) ; df(x) # df is a function itself
# ------------------
# Moments
# ------------------
median(D) # Median
mode(D) # Mode
entro(D) # Entropy
finf(D) # Fisher Information Matrix
# ------------------
# Point Estimation
# ------------------
ll(D, x)
llcauchy(x, x0, scale)
ecauchy(x, type = "mle")
ecauchy(x, type = "me")
mle(D, x)
me(D, x)
e(D, x, type = "mle")
mle("cauchy", x) # the distr argument can be a character
# ------------------
# Estimator Variance
# ------------------
vcauchy(x0, scale, type = "mle")
avar_mle(D)
v(D, type = "mle")
Run the code above in your browser using DataLab