Skip to contents

These functions calculate the variance (or variance - covariance matrix in the multidimensional case) of an estimator, given a specified family of distributions and the true parameter values.

Usage

v(distr, type, ...)

avar_mle(distr, ...)

avar_me(distr, ...)

avar_same(distr, ...)

Arguments

distr

A Distribution object.

type

character, case ignored. The estimator type.

...

extra arguments.

Value

numeric, or matrix for multidimensional cases.

Functions

  • avar_mle(): Asymptotic Variance of the Maximum Likelihood Estimator

  • avar_me(): Asymptotic Variance of the Moment Estimator

  • avar_same(): Asymptotic Variance of the Score-Adjusted Moment Estimator

References

General Textbooks

  • Van der Vaart, A. W. (2000), Asymptotic statistics, Vol. 3, Cambridge university press.

Beta and gamma distribution families

  • Ye, Z.-S. & Chen, N. (2017), Closed-form estimators for the gamma distribution derived from likelihood equations, The American Statistician 71(2), 177–181.

  • Tamae, H., Irie, K. & Kubokawa, T. (2020), A score-adjusted approach to closed-form estimators for the gamma and beta distributions, Japanese Journal of Statistics and Data Science 3, 543–561.

  • Mathal, A. & Moschopoulos, P. (1992), A form of multivariate gamma distribution, Annals of the Institute of Statistical Mathematics 44, 97–106.

  • Oikonomidis, I. & Trevezas, S. (2023), Moment-Type Estimators for the Dirichlet and the Multivariate Gamma Distributions, arXiv, https://arxiv.org/abs/2311.15025

See also

avar_mle, avar_me, avar_same

Examples

# -----------------------------------------------------
# Beta Distribution Example
# -----------------------------------------------------

# Create the distribution
a <- 3
b <- 5
D <- Beta(a, b)

# ------------------
# dpqr Functions
# ------------------

d(D, c(0.3, 0.8, 0.5)) # density function
#> [1] 2.268945 0.107520 1.640625
p(D, c(0.3, 0.8, 0.5)) # distribution function
#> [1] 0.3529305 0.9953280 0.7734375
qn(D, c(0.4, 0.8)) # inverse distribution function
#> [1] 0.3205858 0.5167578
x <- r(D, 100) # random generator function

# alternative way to use the function
df <- d(D) ; df(x) # df is a function itself
#>   [1] 0.1572970 1.5454142 2.0058226 2.2364940 2.0614202 2.1071009 1.9605580
#>   [8] 1.3343136 2.1398770 1.1550699 1.9822881 0.6586582 2.1869828 1.4420598
#>  [15] 2.3017163 2.3040962 2.1806766 0.9455563 1.4183353 1.9398146 2.2636975
#>  [22] 1.9232714 2.2851302 0.4823720 2.0626798 2.3026696 1.2279035 2.2961755
#>  [29] 1.7424295 1.4684633 2.0100832 1.3561398 2.2767099 0.5034545 2.1057995
#>  [36] 0.9771713 2.2533341 2.2852951 2.1213302 1.2978172 0.4394535 2.2793570
#>  [43] 1.8188347 2.1850711 1.6914703 0.9198661 2.2081535 2.3022816 1.8806846
#>  [50] 2.2774036 1.9236509 2.3031542 2.2900962 1.9219677 1.9656488 2.2307432
#>  [57] 2.1820941 2.2862714 0.8893830 1.1295654 2.2332697 1.7413016 0.4762772
#>  [64] 1.9562541 2.3013799 0.6221162 2.1975494 2.2120136 1.1121248 1.3905348
#>  [71] 1.2410044 2.2918156 2.2047656 2.2198158 1.9455657 2.2797529 2.0476333
#>  [78] 0.2464753 1.9139067 1.8467172 1.7820504 2.1758954 2.1697057 1.9759306
#>  [85] 2.2949465 1.6566477 2.3045264 1.6579025 2.0792419 1.5421868 2.2477841
#>  [92] 2.2442318 2.2576685 1.3982576 0.9067358 2.1075033 2.0814838 2.2017677
#>  [99] 1.8851979 2.2146271

# ------------------
# Moments
# ------------------

mean(D) # Expectation
#> [1] 0.375
var(D) # Variance
#> [1] 0.02604167
sd(D) # Standard Deviation
#> [1] 0.1613743
skew(D) # Skewness
#> [1] 0.3098387
kurt(D) # Excess Kurtosis
#> [1] 0.04
entro(D) # Entropy
#> [1] -0.4301508
finf(D) # Fisher Information Matrix
#>            shape1      shape2
#> shape1  0.2617971 -0.13313701
#> shape2 -0.1331370  0.08818594

# List of all available moments
mom <- moments(D)
mom$mean # expectation
#> [1] 0.375

# ------------------
# Point Estimation
# ------------------

ll(D, x)
#> [1] 50.2051
llbeta(x, a, b)
#> [1] 50.2051

ebeta(x, type = "mle")
#> $shape1
#> [1] 3.602139
#> 
#> $shape2
#> [1] 6.077413
#> 
ebeta(x, type = "me")
#> $shape1
#> [1] 3.687881
#> 
#> $shape2
#> [1] 6.209202
#> 
ebeta(x, type = "same")
#> $shape1
#> [1] 3.63299
#> 
#> $shape2
#> [1] 6.116783
#> 

mle(D, x)
#> $shape1
#> [1] 3.602139
#> 
#> $shape2
#> [1] 6.077413
#> 
me(D, x)
#> $shape1
#> [1] 3.687881
#> 
#> $shape2
#> [1] 6.209202
#> 
same(D, x)
#> $shape1
#> [1] 3.63299
#> 
#> $shape2
#> [1] 6.116783
#> 
e(D, x, type = "mle")
#> $shape1
#> [1] 3.602139
#> 
#> $shape2
#> [1] 6.077413
#> 

mle("beta", x) # the distr argument can be a character
#> $shape1
#> [1] 3.602139
#> 
#> $shape2
#> [1] 6.077413
#> 

# ------------------
# Estimator Variance
# ------------------

vbeta(a, b, type = "mle")
#>          shape1   shape2
#> shape1 16.44844 24.83272
#> shape2 24.83272 48.83039
vbeta(a, b, type = "me")
#>          shape1   shape2
#> shape1 17.64848 26.56970
#> shape2 26.56970 51.39394
vbeta(a, b, type = "same")
#>          shape1   shape2
#> shape1 16.57719 24.96198
#> shape2 24.96198 49.01071

avar_mle(D)
#>          shape1   shape2
#> shape1 16.44844 24.83272
#> shape2 24.83272 48.83039
avar_me(D)
#>          shape1   shape2
#> shape1 17.64848 26.56970
#> shape2 26.56970 51.39394
avar_same(D)
#>          shape1   shape2
#> shape1 16.57719 24.96198
#> shape2 24.96198 49.01071

v(D, type = "mle")
#>          shape1   shape2
#> shape1 16.44844 24.83272
#> shape2 24.83272 48.83039