Skip to contents

For a single coordinate of the Gaussian white-noise model with unit noise variance and a mean-zero normal prior of variance prior_var, returns the posterior mean \(n X / (n + 1 / \lambda)\) and variance \(1 / (n + 1 / \lambda)\).

Usage

morie_gh_wn_posterior(X, n, prior_var)

Arguments

X

observed coordinate value (the sufficient statistic, scaled as a mean)

n

effective sample size / noise precision multiplier

prior_var

prior variance \(\lambda\) of the coordinate (positive)

Value

list with elements mean and var, the posterior mean and variance of the coordinate

References

Ghosal, S. and van der Vaart, A. (2017). Fundamentals of Nonparametric Bayesian Inference. Cambridge University Press.

Examples

morie_gh_wn_posterior(X = c(1, 2, 3, 4, 5, 6, 7, 8), n = 5L, prior_var = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $mean
#> [1] 0.8333333 1.8181818 2.8125000 3.8095238 4.8076923 5.8064516 6.8055556
#> [8] 7.8048780
#> 
#> $var
#> [1] 0.1666667 0.1818182 0.1875000 0.1904762 0.1923077 0.1935484 0.1944444
#> [8] 0.1951220
#>