Skip to contents

Posterior mean / variance of G(A) for DP(alpha, G0) and A = (A_lower, A_upper].

Usage

morie_ghosal_moment_matching(
  x,
  alpha = 1,
  A_lower = NULL,
  A_upper = NULL,
  base_mean = 0,
  base_sd = 1
)

Arguments

x

Numeric data vector.

alpha

DP concentration parameter (default 1).

A_lower

Optional numeric lower bound of set A (default -Inf).

A_upper

Optional numeric upper bound of set A (default mean(x)).

base_mean

Numeric base-measure mean (default 0).

base_sd

Numeric base-measure sd (default 1).

Value

Named list with estimate, se, prior_mean, prior_var, n_A, n, alpha, method.

Examples

morie_ghosal_moment_matching(x = rnorm(50))
#> $estimate
#> [1] 0.4803644
#> 
#> $se
#> [1] 0.06928404
#> 
#> $prior_mean
#> [1] 0.4985864
#> 
#> $prior_var
#> [1] 0.124999
#> 
#> $n_A
#> [1] 24
#> 
#> $n
#> [1] 50
#> 
#> $alpha
#> [1] 1
#> 
#> $method
#> [1] "DP moment-matching (Ferguson 1973)"
#>