Adaptive multiple importance sampling

AMIS fits one proposal using all retained samples. Each new generating proposal changes the weights of both new and earlier samples.

Example

using ImportanceSamplers, Random, Statisticsfunction logtarget(x)    a = x[1] - 1    b = (x[2] + 1 - 0.8a) / 0.6    return -(a^2 + b^2) / 2endalgorithm = AMIS(    SphericalStudentT(5.0, zeros(2), 2.0);    rounds=4, round_size=2_000,)prepared = prepare_sampler(Xoshiro(42), logtarget, algorithm)samples = importance_sample!(prepared)(count=length(samples), mean=mean(samples), covariance=cov(samples))
(count = 8000, mean = [1.0009001155849768, -0.9902081898255795], covariance = [1.0245186822996266 0.8336245526969897; 0.8336245526969897 1.0345861960335894])

The reference mean is [1, -1]. The initial proposal is spherical, but adaptation learns a full covariance.

round_size is a total count per round. Use round_size=[1_000, 2_000, 3_000, 4_000] for unequal counts.

Adaptation recurrence

  1. Draw new samples from the current proposal.
  2. Evaluate their target values.
  3. Update every retained sample's temporal-mixture denominator.
  4. Fit proposal parameters by weighted moment matching using all retained samples.
  5. Retain the fitted proposal for the next round or prepared call.

Target values are not reevaluated for earlier samples. Student-t adaptation keeps the degrees of freedom fixed and requires nu > 2. The fitted covariance is converted to Student-t scale.

Gaussian and Student-t vector fits learn full covariance. Independent Gamma and Laplace proposals instead fit marginal means and variances, without correlations or a covariance ridge. Gamma uses shape = mean^2 / variance and scale = variance / mean. Laplace uses location = mean and scale = sqrt(variance / 2). These are moment fits, not maximum-likelihood fits. Degenerate or unrepresentable independent fits fail without committing new parameters.

Covariance stabilization

Gaussian and Student-t fits add a scale-relative ridge to the weighted covariance:

\[\Sigma_{t+1}=\widehat{\operatorname{Cov}}_{w_t}(X) +\sqrt{\operatorname{eps}(T)}\, \frac{\operatorname{tr}(\Sigma_t)}{d}I_d.\]

Here d is the sampling dimension, T is the sample floating-point type, and $\Sigma_t$ is the previous proposal's actual covariance. The fitting weights $w_t$ are normalized; the covariance uses their fitted mean and no sample-size correction. For scalar samples, d = 1. Student-t fits convert the result to scale only after this update.

The coefficient depends on precision and is not a tuning keyword. It reduces degeneracy risk but does not guarantee a finite, valid factorization. Independent Gamma and Laplace fits do not use this ridge.

Retrospective denominator

After round $t$, with counts $N_1,\ldots,N_t$, the denominator is

\[\psi_t(x)=\frac{\sum_{s=1}^tN_sq_s(x)}{\sum_{s=1}^tN_s}, \qquad \ell_i^{(t)}=\log\pi(x_i)-\log\psi_t(x_i).\]

Counts determine the mixture coefficients. The final fitted proposal generated no returned draw and does not enter that denominator.

The result includes every round under the final retrospective weights. diagnostics.round_ess and round_lognormalizers summarize cumulative history at each round, not each round in isolation.

Cost and interpretation

AMIS retains samples and proposal history. For T rounds and N total draws, it performs N target evaluations and T * N proposal-density evaluations. It accumulates denominators without storing a dense sample-by-proposal density matrix.

The package makes no general finite-sample unbiasedness or consistency claim for adaptive AMIS. The related MAMIS consistency results concern a different learning rule. Weight ESS still measures concentration, not proof of tail coverage.

A successful call retains its final fitted proposal. A failed call preserves the previously committed proposal and leaves the RNG advanced. See Adaptation and reuse.

Sources