Proposals and transforms
Proposals explains scale conventions. Constraints and named parameters explains coordinates and Jacobian adjustments.
Native families
ImportanceSamplers.AbstractProposalFamily — Type
AbstractProposalFamilyAbstract supertype for native proposal-family markers.
ImportanceSamplers.AbstractRadialProposalFamily — Type
AbstractRadialProposalFamily <: AbstractProposalFamilyAbstract supertype for radially symmetric native proposal families.
ImportanceSamplers.SphericalGaussian — Function
SphericalGaussian(location, scale)Construct a normalized scalar or vector Gaussian proposal with finite Float32 or Float64 location and a finite positive scalar standard deviation of the same type. Its covariance is scale^2 for a scalar and scale^2 I for a vector.
See DiagonalGaussian, FactorGaussian, and SphericalStudentT.
ImportanceSamplers.DiagonalGaussian — Function
DiagonalGaussian(location, scales)Construct a normalized vector Gaussian proposal with independent finite positive coordinate scales. Location and scales must use the same Float32 or Float64 element type. The scales are standard deviations, so the covariance diagonal is scales .^ 2.
See SphericalGaussian, FactorGaussian, and DiagonalStudentT.
ImportanceSamplers.FactorGaussian — Function
FactorGaussian(location, factor)Construct a normalized vector Gaussian proposal with affine map x = location + L * z, where z is standard normal and L is a finite lower-triangular factor with positive diagonal. A Cholesky factorization is accepted through its lower factor. The covariance is L * L'; pass a factor, not an inverse covariance. Density evaluation uses triangular solves and never forms a covariance inverse.
See FactorStudentT for heavier tails and BatchedFactorExecution for matrix-based draws and densities in ImportanceSampling.
ImportanceSamplers.SphericalStudentT — Function
SphericalStudentT(dof, location, scale)Construct a normalized scalar or spherical multivariate Student-t proposal. dof, location, and scale must share a Float32 or Float64 type. The scale is the standard elliptical scale, not the standard deviation.
See SphericalGaussian, DiagonalStudentT, and FactorStudentT.
ImportanceSamplers.DiagonalStudentT — Function
DiagonalStudentT(dof, location, scales)Construct a normalized multivariate Student-t proposal with diagonal elliptical scales. The scales are not marginal standard deviations.
Coordinates share a radial multiplier and are not independent. See DiagonalGaussian, SphericalStudentT, and FactorStudentT.
ImportanceSamplers.FactorStudentT — Function
FactorStudentT(dof, location, factor)Construct a normalized multivariate Student-t proposal with elliptical scale matrix factor * factor'. Density evaluation uses triangular solves.
For dof > 2, covariance is dof / (dof - 2) * factor * factor'. See FactorGaussian and BatchedFactorExecution.
ImportanceSamplers.BoxUniform — Function
BoxUniform(lower, upper)Normalized uniform proposal on a scalar interval or an independent vector box. Bounds must be finite Float32 or Float64 values of matching precision and shape, with lower < upper in every coordinate. Vector inputs are copied. Density evaluation includes the endpoints and returns -Inf outside the box. Finite intervals with an overflowing upper - lower remain supported.
The proposal is fixed. It does not use Gaussian covariance adaptation.
ImportanceSamplers.IndependentGamma — Function
IndependentGamma(shape, scale)Normalized Gamma proposal with shape–scale parameters, or a product of independent Gamma coordinates. Parameters must be finite, strictly positive, matching Float32 or Float64 scalars or vectors. Vector inputs are copied. The mean is shape .* scale and variance is shape .* scale.^2.
Plain IS and homogeneous static MIS banks use fixed parameters. AMIS and NPMC fit weighted marginal moments, then use shape = mean^2 / variance and scale = variance / mean. This is moment matching, not maximum likelihood. Correlations are not fitted. Degenerate or unrepresentable fits fail without replacing the committed proposal. APIS and DeterministicMixturePMC instead update each mean at fixed coordinate variance, changing both shape and scale. Gamma proposals require a target supported on positive coordinates. Adaptation can produce tiny shapes whose draws underflow at the chosen precision. Native execution uses eight rejection candidates per coordinate. Exhaustion or a nonpositive/nonfinite rounded draw fails the entire call, without discarding selected samples.
ImportanceSamplers.IndependentLaplace — Function
IndependentLaplace(location, scale)Normalized scalar Laplace proposal, or a product of independent Laplace coordinates. Parameters must be finite, matching Float32 or Float64 scalars or vectors, with strictly positive scales. Vector inputs are copied. The mean is location and coordinate variances are 2 .* scale.^2.
Plain IS and homogeneous static MIS banks use fixed parameters. AMIS and NPMC fit the weighted marginal mean and sqrt(variance / 2). This is moment matching, not the weighted-median/absolute-deviation maximum likelihood fit. Correlations are not fitted. Invalid fits fail without replacing the committed proposal. Each coordinate uses one uniform draw. A nonfinite rounded affine draw fails the call without redrawing. APIS, DeterministicMixturePMC, and LAIS update locations while retaining each coordinate scale.
Composition and populations
ImportanceSamplers.AbstractProposalPopulation — Type
AbstractProposalPopulationAbstract supertype for explicit populations of normalized proposals.
Population values are sampler configuration, not probability distributions. Concrete subtypes describe proposals that assignment and denominator schemes can use separately during preparation.
ImportanceSamplers.ProposalBank — Type
ProposalBank(proposals)
ProposalBank(proposals, masses)Construct an explicit proposal population with copied proposals and normalized nonnegative masses. Omitted masses are equal and use the promoted precision of native proposals or Distributions.jl inputs; unknown generic proposals use Float64. Explicit masses keep their existing promotion rules. The readable proposals and masses fields preserve input order; masses sum to one. A configured positive mass must remain positive through floating conversion and normalization; otherwise construction rejects the bank instead of making that proposal inert.
Zero-mass proposals remain in the configuration and retain their stable one-based IDs, but are neither assigned nor evaluated. Positive-mass proposals must share a sample dimension. Generic CPU execution additionally requires one concrete proposal element type. Homogeneous native Gaussian, Student-t, BoxUniform, IndependentGamma, and IndependentLaplace banks with one scalar/vector layout and floating type may be packed during preparation. Loading Distributions.jl converts supported entries to their native forms during construction.
ProposalBank deliberately implements neither rand nor DensityInterface.logdensityof: a bank is a proposal population, not a mixture distribution. AbstractMISScheme independently selects both the assignment law and the density used in each MIS denominator. A pre-existing mixture object remains one atomic proposal unless its components are explicitly placed in a bank.
ImportanceSamplers.ProductProposal — Type
ProductProposal(blocks::NamedTuple)Construct a proposal for the product of independent named proposal blocks. Blocks are drawn in field order with the supplied RNG, and their normalized log densities are summed. Plain and static MIS support native preparation of same-precision Gaussian blocks, preserving names, scalar/vector shapes, and within-block covariance. Diagonal products use native CPU execution. Correlated products retain blockwise generic CPU execution where available and become dense native proposals on explicit accelerator transfer. Heterogeneous banks without a generic CPU route use native packing. Supported named transforms also follow these paths. Other products remain CPU-only. Direct rand uses the original blocks. Named LogDensityProblems targets retain the generic CPU path; use a callable target to prepare a native named sampler.
ImportanceSamplers.TransformedProposal — Type
TransformedProposal(base, transform)Construct a proposal that maps draws from base into logical values through transform. Its density uses the exact normalized change of variables log q_x(x) = log q_z(z) - log|J(z)|. The proposal applies this Jacobian; target densities must use the resulting logical reference measure without applying it again.
For named flat layouts, bare indices or ranges mean identity transforms, for example (rate=1=>PositiveTransform(), offsets=2:3). Every coordinate still requires a named selector.
Coordinate transforms
ImportanceSamplers.AbstractSampleTransform — Type
AbstractSampleTransformAbstract supertype for transforms from unconstrained coordinates to a logical sample value. A TransformedProposal subtracts the forward log Jacobian from its base proposal density. A sampler's transform= adds it to the logical target composed with the transform. Apply each change of variables once.
ImportanceSamplers.IdentityTransform — Type
IdentityTransform()Leave an unconstrained scalar or vector unchanged with zero log Jacobian. A named product layout inserts this transform for omitted known fields.
ImportanceSamplers.PositiveTransform — Type
PositiveTransform()Map an unconstrained scalar z to exp(z) on the positive real line, with forward log Jacobian z. With a Gaussian base, this induces a lognormal upper tail, versus the Gaussian-like upper tail from SoftplusTransform. Proposal tails must cover target tails for stable importance weights; neither transform alone guarantees finite weight variance. Both Gaussian-based transforms can still be too light near zero for targets with substantial boundary mass.
ImportanceSamplers.SoftplusTransform — Type
SoftplusTransform()Map an unconstrained scalar smoothly to the positive real line with softplus and its stable forward log Jacobian. With a Gaussian base, this induces a Gaussian-like upper tail, lighter than the lognormal upper tail from PositiveTransform. Proposal tails must cover target tails for stable importance weights; neither transform alone guarantees finite weight variance. Both Gaussian-based transforms can still be too light near zero for targets with substantial boundary mass.
ImportanceSamplers.IntervalTransform — Type
IntervalTransform(lower, upper)Construct a scalar transform onto the open interval defined by finite Float32 or Float64 endpoints. Use nothing for the unbounded endpoint; at least one endpoint is required. (lower, nothing), (nothing, upper), and (lower, upper) represent lower-bounded, upper-bounded, and bounded support.
ImportanceSamplers.SimplexTransform — Type
SimplexTransform(K)Transform K - 1 unconstrained coordinates into K positive weights that sum to one. The coordinates use an orthonormal embedding into the sum-zero logit subspace. The forward Jacobian is measured against the first K - 1 simplex coordinates, dx₁⋯dxₖ₋₁, and includes the full constant: log|J| = 0.5log(K) + sum(log, x).