Skip to contents

This function calculates statistical measures for the gamma distribution based on the given data.

Usage

stats_g(data, alpha = 0.0027, mu = NULL, k = NULL, ...)

Arguments

data

The data matrix

alpha

The significance level

mu

The mean of the gamma distribution (optional)

k

The shape parameter of the gamma distribution (optional)

...

Additional arguments to be passed lbfgs::lbfgs()

Value

A list containing the statistical measures and other information

Examples


set.seed(0)
x <- r_g(lots = 1000, n = 10, mu = 1, k = 1.7)

# Estimate for maximum likelihood
stats_g(data = x)
#> $mu_hat
#> [1] 1.002737
#> 
#> $k_hat
#> [1] 1.734834
#> 
#> $alpha_hat
#> [1] 0.004
#> 
#> $ARL
#> [1] 250
#> 
#> $MRL
#> [1] 172.94
#> 
#> $SDRL
#> [1] 249.4995
#> 
#> $li
#> [1] 0.4309558
#> 
#> $ls
#> [1] 1.880363
#> 
#> $convergence
#> [1] 0
#> 
#> $value
#> [1] -24.56983
#> 

# Using the true parameters
stats_g(data = x, mu = 1, k = 1.7)
#> $mu_hat
#> [1] 1
#> 
#> $k_hat
#> [1] 1.7
#> 
#> $alpha_hat
#> [1] 0.004
#> 
#> $ARL
#> [1] 250
#> 
#> $MRL
#> [1] 172.94
#> 
#> $SDRL
#> [1] 249.4995
#> 
#> $li
#> [1] 0.4254575
#> 
#> $ls
#> [1] 1.885751
#> 
#> $convergence
#> NULL
#> 
#> $value
#> NULL
#>