Skip to contents

When every P_theta has a density with respect to a common mu the posterior exists and is the normalised density-weighted prior. The normalising constant – the marginal likelihood – is returned alongside because a zero marginal is precisely the signal that the domination assumption has failed, which is the failure mode section 1.3.1 is guarding against.

Usage

Ghosalabsolutecontinuity(x, log_lik = NULL, log_prior = NULL)

Arguments

x

Grid of parameter values.

log_lik

Log-likelihood as a function of theta; a single N(theta, 1) observation at 1 when NULL.

log_prior

Log-prior as a function of theta; standard normal when NULL.

Value

List with estimate, log_marginal, posterior, method.

Details

Formula: log m = log(mean_i exp(l_i)) with l_i = log p(X | theta_i) + log pi(theta_i).

References

Ghosal & van der Vaart (2017), Fundamentals of Nonparametric Bayesian Inference, CUP, section 1.3.1.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Ghosalabsolutecontinuity(V)
#> $estimate
#> [1] 1.123316
#> 
#> $log_marginal
#> [1] -2.450327
#> 
#> $posterior
#> [1] 8.788735e-01 1.189426e-01 2.178510e-03 5.399985e-06 1.811493e-09
#> [6] 8.224167e-14 5.053103e-19 4.201800e-25
#> 
#> $method
#> [1] "dominated posterior, Radon-Nikodym (GvdV 2017 sec. 1.3.1)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"