Skip to contents

Pi = sum_k pi_k Pi_k with pi_k proportional to exp(-lam k log n): the posterior over the model index k concentrates, so the contraction rate adapts to the truth without the truth being known. The evidence of each sub-model is available in closed form here (conjugate normal means), so the model posterior is exact rather than sampled.

Usage

Ghosaladaptthm(y = NULL, n = 200, K_true = 3, lam = 1, K_max = 12, seed = 42)

Arguments

y

Numeric vector of observed coordinates; simulated when NULL.

n

Precision (sample size) of each coordinate.

K_true

Number of nonzero coordinates in the simulated truth.

lam

Complexity-penalty scale of the model prior.

K_max

Largest model dimension considered.

seed

Seed for the deterministic draw of y.

Value

List with estimate (posterior mode of K), model_posterior, K_true, method.

Details

Formula: log m_K(y) = sum_k [-log(2 pi s_k^2)/2 - y_k^2/(2 s_k^2)], s_k^2 = 1/n + tau2 1{k < K}; pi_K propto m_K(y) exp(-lam K log n).

References

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

Examples

Ghosaladaptthm()
#> $estimate
#> [1] 3
#> 
#> $model_posterior
#>  [1] 1.615165e-128  3.472216e-86  1.053545e-51  9.995909e-01  4.088065e-04
#>  [6]  2.576932e-07  4.387080e-10  2.972506e-13  1.084305e-16  3.644088e-19
#> [11]  1.788374e-22  6.530961e-26  3.019763e-29
#> 
#> $K_true
#> [1] 3
#> 
#> $method
#> [1] "adaptive model prior (GvdV 2017 sec. 10.1)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"