Simulate EI Solution via Importance Sampling
Arguments
- ei.object
ei
object- ndraws
integer. The number of draws. Default is 99.
- nsims
integer. The number of simulations within each draw. Default is 100.
References
Gary King (1997). A Solution to the Ecological Inference Problem. Princeton: Princeton University Press.
Examples
data(sample_ei)
form <- t ~ x
ei_obj <- ei(form, total = "n", data = sample_ei, simulate = FALSE)
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 0.5.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 3.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 5.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 0.1.
#> ℹ Running 2x2 ei
#> ✔ Running 2x2 ei [2ms]
#>
sims <- ei.sim(ei_obj)
#> ⠙ Beginning importance sampling.
#> ✔ Beginning importance sampling. [1.2s]
#>