Percentile interval for any functional of a fitted proxy
Source:R/ensemble.R
proxy_functional_ci.RdApplies a functional to every member of a bootstrap ensemble and
returns the base fit's point estimate with percentile confidence
limits. The functional may return a scalar or a fixed-length numeric
vector – the moments (gmm_mean(), gmm_cov()), a tail probability
via pgmm() on a marginal, an entropy, a conditional mean, or any
composition of the operator calculus.
Arguments
- ensemble
A
gmm_ensemblefromgmm_fit_ensemble().- fn
A function mapping a gmm to a numeric scalar or vector.
- level
Confidence level. Default
0.9.- ...
Forwarded to
fn.
Value
A data frame with one row per element of fn's value:
term, estimate (the base fit's value), conf.low, conf.high.
Examples
fit <- fit_proxymix(banana_target(), N = 2L, regime = "kld",
is_size = 1500L, max_iter = 20L, seed = 1L)
ens <- gmm_fit_ensemble(fit, B = 30L, seed = 2L)
proxy_functional_ci(ens, function(g) gmm_mean(g)[1L])
#> term estimate conf.low conf.high
#> 1 f1 -0.004937457 -0.08133735 0.07347874