fitPriorParametersGPS: Prior Parameter Fit for the GPS

View source: R/fitPriorParametersGPS.R

fitPriorParametersGPSR Documentation

Prior Parameter Fit for the GPS

Description

Fits the prior parameters to the data for the Gamma Poisson shrinker (GPS). The initial guess for the parameter values are set the same as by DuMouchel (1999).

Usage

fitPriorParametersGPS(
  a,
  b,
  c,
  d,
  E = ((a + b) * (a + c))/(a + b + c + d),
  alpha1 = 0.2,
  beta1 = 0.1,
  alpha2 = 2,
  beta2 = 4,
  w = 1/3
)

Arguments

a

A vector with the counts of the upper left corner of the tables

b

A vector with the counts of the lower left corner of the tables

c

A vector with the counts of the upper right corner of the tables

d

A vector with the counts of the lower right corner of the tables

E

Passed to nlminb() (Default = ((a + b)*(a + c)) / (a + b + c + d))

alpha1

Prior parameter \alpha_1 (Default = 0.2)

beta1

Prior parameter \beta_1 (Default = 0.1)

alpha2

Prior parameter \alpha_2 (Default = 2.0)

beta2

Prior parameter \beta_2 (Default = 4.0)

w

Prior parameter w (Default = 1/3)

Value

A list with the prior parameters

References

DuMouchel, W. (1999). Bayesian Data Mining in Large Frequency Tables, with an Application to the FDA Spontaneous Reporting System. The American Statistician, 53(3), 177–190. https://doi.org/10.1080/00031305.1999.10474456

        DuMouchel, W., & Pregibon, D. (2001). Empirical bayes screening 
        for multi-item associations. Proceedings of the Seventh ACM 
        SIGKDD International Conference on Knowledge Discovery and 
        Data Mining - KDD ’01, (October), 67–76. 
        http://doi.org/10.1145/502512.502526

See Also

loglikelihood2NegativeBinomial()

Examples

a <- srdata$tables$a 
b <- srdata$tables$b 
c <- srdata$tables$c 
d <- srdata$tables$d 

fitPriorParametersGPS(a, b, c, d) 

# $alpha1
# [1] 98.28478
#
# $beta1
# [1] 16.48081
#
# $alpha2
# [1] 16.61439
#
# $beta2
# [1] 18.00642
#
# $w
# [1] 0.06132586


bips-hb/pvm documentation built on Feb. 13, 2025, 3:32 a.m.