Skip to contents

dPi_n/dPi(theta) = p_theta(X^n) / int p_eta(X^n) dPi(eta). Batch updating and one-observation-at-a-time updating must give the same posterior – coherence is what makes the Bayesian recipe well defined at all – and the two are computed separately here so the agreement is measured rather than assumed.

Usage

Ghosalpriorposteriorupdate(
  x,
  data = NULL,
  log_lik_one = NULL,
  log_prior = NULL
)

Arguments

x

Grid of parameter values.

data

Observations; c(0.8, 1.2, 1) when NULL.

log_lik_one

Log-likelihood of one observation, f(theta, d).

log_prior

Log-prior as a function of theta.

Value

List with estimate, posterior, sequential_batch_gap, method.

Details

Formula: batch log weight = sum_j log p(d_j | theta) + log pi(theta); sequential accumulates the same terms one at a time.

References

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

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Ghosalpriorposteriorupdate(V)
#> $estimate
#> [1] 1.04751
#> 
#> $posterior
#> [1] 9.525329e-01 4.742382e-02 4.324493e-05 7.222639e-10 2.209422e-16
#> [6] 1.237894e-24 1.270312e-34 2.387588e-46
#> 
#> $sequential_batch_gap
#> [1] 8.999879e-39
#> 
#> $method
#> [1] "prior-to-posterior updating (GvdV 2017 sec. 1.3)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"