Skip to contents

Everything is done in logs. lam is the prior weight of the ALTERNATIVE, so the null carries 1 - lam.

Usage

Ptnulltst(loglik_null, log_marginal_alt, lam = 0.5)

Arguments

loglik_null

log prod_i p*(X_i).

log_marginal_alt

log int prod_i p(X_i) dPi_1(p).

lam

Prior weight of the ALTERNATIVE, in (0, 1).

Value

List with log_bayes_factor, bayes_factor, posterior_null, posterior_alt, prior_null, lam.

Details

Formula: B_n = prod_i p*(X_i) / int prod_i p(X_i) dPi_1(p); Pi_n(p = p* | X) = (1-lam) L* / [ (1-lam) L* + lam int L dPi_1 ]

References

Ghosal & van der Vaart (2017), Fundamentals of Nonparametric Bayesian Inference, Section 10.5.1 and Theorem 10.24. The book's prose calls lambda the weight of the null while its own formula gives the null the weight 1 - lambda; the FORMULA is followed here. Read from the copy of the book held in the corpus.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Ptnulltst(V, V)
#> $log_bayes_factor
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $bayes_factor
#> [1] 1 1 1 1 1 1 1 1
#> 
#> $posterior_null
#> [1] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
#> 
#> $posterior_alt
#> [1] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
#> 
#> $prior_null
#> [1] 0.5
#> 
#> $lam
#> [1] 0.5
#> 
#> $method
#> [1] "Point-null Bayes factor, Ghosal Section 10.5.1"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"