# -----------------------------------------------------
# Multivariate Gamma Distribution Example
# -----------------------------------------------------
# Create the distribution
a <- c(0.5, 3, 5) ; b <- 5
D <- Multigam(a, b)
# ------------------
# dpqr Functions
# ------------------
d(D, c(0.3, 2, 10)) # density function
# alternative way to use the function
df <- d(D) ; df(c(0.3, 2, 10)) # df is a function itself
x <- r(D, 100) # random generator function
# ------------------
# Moments
# ------------------
mean(D) # Expectation
var(D) # Variance
finf(D) # Fisher Information Matrix
# List of all available moments
mom <- moments(D)
mom$mean # expectation
# ------------------
# Point Estimation
# ------------------
ll(D, x)
llmultigam(x, a, b)
emultigam(x, type = "mle")
emultigam(x, type = "me")
emultigam(x, type = "same")
mle(D, x)
me(D, x)
same(D, x)
e(D, x, type = "mle")
mle("multigam", x) # the distr argument can be a character
# ------------------
# Estimator Variance
# ------------------
vmultigam(a, b, type = "mle")
vmultigam(a, b, type = "me")
vmultigam(a, b, type = "same")
avar_mle(D)
avar_me(D)
avar_same(D)
v(D, type = "mle")
Run the code above in your browser using DataLab