Documentation

MetropolizedBackwardSampling.Algorithm.Validity

The validity of Algorithm 1 #

The joint distribution of the reference trajectory x_{1:T} ∼ π and of the variables generated by steps (a) and (b) of Algorithm 1 of the paper is computed here. Integrals with respect to it are integrals, with respect to the product of μ on the particle positions, of a sum, over the ancestor indices and the final index b_T, of the density (6) times the integrand evaluated at the trajectory traced back from b_T.

Lemma 3 of the paper follows. By its first part, (x, a, b_T) ∼ π̄, with x_{1:T} the trajectory traced back from b_T, which is stated as an identity of joint distributions. By its second part, under π̄, the conditional distribution of (a, b_T) given x is the product of W_T and of the B_t(·|n). This proof is not ours and is provided for completeness and ease of reference. The first part of Lemma 3 is due to Andrieu et al. (2010), in the form of Chopin and Singh (2015, Section 2.3). The second part is the observation of Chopin and Singh (2015, proof of Proposition 9).

With the variables of steps (c) and (d) of Algorithm 1, Lemma 4 follows: the particle positions have their distribution under π̄ and, given them, the indices (b, l) of the reference and of the output form the backward Markov chain pairChain K, both with the backward pass of Algorithm 1 and, if K_{t,j,j'}(i, ·) = B_t(·|j') for j ≠ j', with its usual implementation. The sums over the ancestor indices are those of Algorithm/Lineage. As for Lemma 3, the identity of joint distributions includes the reference trajectory, which is (x_1^{b_1}, …, x_T^{b_T}).

Proposition 1 then follows: under the hypotheses of Algorithm 1, pairChain K does not change when b and l are exchanged. The joint distribution of the reference trajectory and of the output (x_1^{l_1}, …, x_T^{l_T}) therefore does not change when the two are exchanged, so that the kernel of Algorithm 1 is reversible with respect to π and hence leaves π invariant.

theorem CSMC.lintegral_unifIdx {n N : ℕ} (h : Idx n N → ENNReal) :
∫⁻ (b : Idx n N), h b ∂unifIdx n N = ∑ b : Idx n N, (↑N)⁻¹ ^ (n + 1) * h b

Integrals with respect to the uniform distribution of the indices of the reference are averages over the N ^ T sequences of indices.

theorem CSMC.sum_ite_eq_traceBack {n N : ℕ} {M' : Type u_2} [AddCommMonoid M'] (a : Anc n N) (h : Idx n N → M') :
(∑ b : Idx n N, if b = traceBack a (b (Fin.last n)) then h b else 0) = ∑ bT : Fin N, h (traceBack a bT)

The sum over the sequences of indices traced back from their final index is the sum over the final index.

The numerator of the target density is a measurable function of the trajectory.

theorem CSMC.FeynmanKac.measurable_fwdDensity {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) (b : Idx n N) (a : Anc n N) :
Measurable fun (y : Pos X n N) => ↑(M.fwdDensity b y a)

The density of step (b) of Algorithm 1 is a measurable function of the particle positions.

The forward pass of Algorithm 1 is an s-finite kernel.

The target distribution is a probability measure.

The joint distribution of the variables of Algorithm 1 is an s-finite kernel.

The joint distribution of the variables of Algorithm 1 with the usual implementation of Algorithm 1.d is an s-finite kernel.

theorem CSMC.FeynmanKac.lintegral_target_compProd_forwardPass {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] {f : Traj X n × Idx n N × Pos X n N × Anc n N → ENNReal} (hf : Measurable f) :
∫⁻ (z : Traj X n × Idx n N × Pos X n N × Anc n N), f z ∂M.target.compProd ((ProbabilityTheory.Kernel.const (Traj X n) (unifIdx n N)).compProd (M.forwardPass N)) = ∫⁻ (y : Fin (n + 1) × Fin N → X), ∑ a : Anc n N, ∑ b : Idx n N, (if b = traceBack a (b (Fin.last n)) then M.extDensity y a (b (Fin.last n)) else 0) * f (trajOf y b, b, y, a) ∂MeasureTheory.Measure.pi fun (x : Fin (n + 1) × Fin N) => μ

Integrals with respect to the joint distribution of x_{1:T} ∼ π and of the variables (b, (y, a)) of steps (a) and (b) of Algorithm 1 are integrals over the particle positions of sums, over the ancestor indices and the sequences b traced back from their final index, of the density (6) times the integrand evaluated at the reference trajectory (x_1^{b_1}, …, x_T^{b_T}).

theorem CSMC.FeynmanKac.lintegral_exttarget {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) {g : Pos X n N × Anc n N × Fin N → ENNReal} (hg : Measurable g) :
∫⁻ (w : Pos X n N × Anc n N × Fin N), g w ∂M.exttarget N = ∫⁻ (y : Fin (n + 1) × Fin N → X), ∑ a : Anc n N, ∑ bT : Fin N, M.extDensity y a bT * g (y, a, bT) ∂MeasureTheory.Measure.pi fun (x : Fin (n + 1) × Fin N) => μ

Integrals with respect to the extended distribution π̄ are integrals over the particle positions of sums over the ancestor indices and the final index of the density (6) times the integrand.

theorem CSMC.FeynmanKac.measurable_trajOf_traceBack {X : Type u_1} [MeasurableSpace X] {n N : ℕ} :
Measurable fun (w : Pos X n N × Anc n N × Fin N) => trajOf w.1 (traceBack w.2.1 w.2.2)

The trajectory traced back from the final index is a measurable function of the particle positions, the ancestor indices, and the final index.

theorem CSMC.FeynmanKac.measurable_traced {X : Type u_1} [MeasurableSpace X] {n N : ℕ} :
Measurable fun (w : Pos X n N × Anc n N × Fin N) => (trajOf w.1 (traceBack w.2.1 w.2.2), w)

The map w ↦ (x, w) which adds the trajectory traced back from the final index is measurable.

theorem CSMC.FeynmanKac.map_target_compProd_forwardPass_traced {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] :
MeasureTheory.Measure.map (fun (z : Traj X n × Idx n N × Pos X n N × Anc n N) => (z.1, z.2.2.1, z.2.2.2, z.2.1 (Fin.last n))) (M.target.compProd ((ProbabilityTheory.Kernel.const (Traj X n) (unifIdx n N)).compProd (M.forwardPass N))) = MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Fin N) => (trajOf w.1 (traceBack w.2.1 w.2.2), w)) (M.exttarget N)

The joint distribution of x_{1:T} ∼ π and of the variables of steps (a) and (b) of Algorithm 1, arranged as (x, (y, a, b_T)), is that of the trajectory traced back from b_T and of (y, a, b_T) ∼ π̄: the variables (y, a, b_T) have the distribution π̄, with x_{1:T} the trajectory traced back from b_T (first part of Lemma 3).

The variables (y, a, b_T) of steps (a) and (b) of Algorithm 1 started from x_{1:T} ∼ π have the extended distribution π̄ (first part of Lemma 3).

With at least one particle, the uniform distribution of the indices of the reference is a probability measure.

With at least one particle, the extended distribution is a probability measure.

theorem CSMC.FeynmanKac.sum_ofReal_weight_mul_prod_bsprob {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) (hN : 0 < N) (y : Pos X n N) :
∑ a : Anc n N, ∑ bT : Fin N, ENNReal.ofReal (M.weight y (Fin.last n) bT * ∏ s : Fin n, ∏ i : Fin N, M.bsprob y s (a s i) i) = 1

The probabilities W_T^{b_T} ∏_{t,n} B_t(a_t^n|n) of the final index and the ancestor indices given the particle positions, as extended nonnegative real numbers, sum to one.

theorem CSMC.FeynmanKac.exttarget_eq_compProd {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) :
M.exttarget N = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (kernelOfMassFn fun (y : Pos X n N) (ab : Anc n N × Fin N) => (M.weight y (Fin.last n) ab.2 * ∏ s : Fin n, ∏ i : Fin N, M.bsprob y s (ab.1 s i) i).toNNReal)

Under π̄, conditionally on the particle positions, the indices b_T and a_t^n are independent, with the distributions W_T and B_t(·|n) (second part of Lemma 3).

theorem CSMC.FeynmanKac.lintegral_target_compProd_compProd {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] {γ : Type u_2} [MeasurableSpace γ] {η : ProbabilityTheory.Kernel (Traj X n × Idx n N × Pos X n N × Anc n N) γ} [ProbabilityTheory.IsSFiniteKernel η] {f : Traj X n × (Idx n N × Pos X n N × Anc n N) × γ → ENNReal} (hf : Measurable f) :
∫⁻ (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × γ), f z ∂M.target.compProd (((ProbabilityTheory.Kernel.const (Traj X n) (unifIdx n N)).compProd (M.forwardPass N)).compProd η) = ∫⁻ (y : Fin (n + 1) × Fin N → X), ∑ a : Anc n N, ∑ bT : Fin N, M.extDensity y a bT * ∫⁻ (c : γ), f (trajOf y (traceBack a bT), (traceBack a bT, y, a), c) ∂η (trajOf y (traceBack a bT), traceBack a bT, y, a) ∂MeasureTheory.Measure.pi fun (x : Fin (n + 1) × Fin N) => μ

Integrals with respect to the joint distribution of x_{1:T} ∼ π, of the variables (b, (y, a)) of steps (a) and (b) of Algorithm 1, and of a variable c drawn from a kernel η given these, are integrals over the particle positions of sums, over the ancestor indices and the final index b_T, of the density (6) times the integral with respect to η, at the indices b traced back from b_T and at the reference trajectory (x_1^{b_1}, …, x_T^{b_T}).

theorem CSMC.FeynmanKac.measurable_pathProb {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) {K : Pos X n N → BackwardKernels (Fin N) n} (hKm : MeasurableKernels K) (b l : Idx n N) :
Measurable fun (y : Pos X n N) => pathProb (M.weight y (Fin.last n)) (M.bsprob y) (K y) b l

The probability pathProb W_T B K b l of the indices b of the reference and l of the output is a measurable function of the particle positions.

theorem CSMC.FeynmanKac.lintegral_pairChain {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) {K : Pos X n N → BackwardKernels (Fin N) n} (hKm : MeasurableKernels K) (y : Pos X n N) (g : Idx n N × Idx n N → ENNReal) :
∫⁻ (bl : Idx n N × Idx n N), g bl ∂(M.pairChain K) y = ∑ b : Fin (n + 1) → Fin N, ∑ l : Fin (n + 1) → Fin N, ENNReal.ofReal (pathProb (M.weight y (Fin.last n)) (M.bsprob y) (K y) b l) * g (b, l)

Integrals with respect to the backward Markov chain on pairs of indices are sums over the pairs, weighted by pathProb W_T B K.

The backward Markov chain on pairs of indices is an s-finite kernel.

theorem CSMC.FeynmanKac.measurable_trajOf {X : Type u_1} [MeasurableSpace X] {n N : ℕ} :
Measurable fun (w : Pos X n N × Idx n N) => trajOf w.1 w.2

The trajectory (x_1^{l_1}, …, x_T^{l_T}) of the particles with the indices l is a measurable function of the particle positions and of l.

theorem CSMC.FeynmanKac.measurable_traced_pairs {X : Type u_1} [MeasurableSpace X] {n N : ℕ} :
Measurable fun (w : Pos X n N × Idx n N × Idx n N) => (trajOf w.1 w.2.1, w)

The map (y, (b, l)) ↦ (x, (y, (b, l))) which adds the trajectory (x_1^{b_1}, …, x_T^{b_T}) of the particles with the indices b is measurable.

theorem CSMC.FeynmanKac.sum_extDensity_mul_of_sum {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) (hN : 0 < N) (y : Pos X n N) {T : Anc n N → Fin N → ENNReal} {S : ENNReal} (h : ∑ a : Anc n N, ∑ bT : Fin N, ENNReal.ofReal (M.weight y (Fin.last n) bT * ∏ s : Fin n, ∏ i : Fin N, M.bsprob y s (a s i) i) * T a bT = S) :
∑ a : Anc n N, ∑ bT : Fin N, M.extDensity y a bT * T a bT = ∑ a : Anc n N, ∑ bT : Fin N, M.extDensity y a bT * S

Under π̄, conditionally on the particle positions y, (a, b_T) has the probabilities W_T^{b_T} ∏_{t,n} B_t(a_t^n|n) (second part of Lemma 3): if the expectation of T(a, b_T) under these probabilities is S, the integral of T against the density (6) at y is that of S.

theorem CSMC.FeynmanKac.map_target_compProd_algLaw_traced {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :
MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.1, z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLaw K)) = MeasureTheory.Measure.map (fun (w : Pos X n N × Idx n N × Idx n N) => (trajOf w.1 w.2.1, w)) ((MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K))

The joint distribution of x_{1:T} ∼ π, of the particle positions, and of the indices of the reference and of the output of Algorithm 1, arranged as (x, (y, b, l)), is that of the trajectory (x_1^{b_1}, …, x_T^{b_T}) and of (y, b, l), where y has its distribution under π̄ and, given y, (b, l) is the backward Markov chain pairChain K (Lemma 4).

theorem CSMC.FeynmanKac.map_target_compProd_algLawUsual_traced {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) (hoff : ∀ (y : Pos X n N) (s : Fin n) (j j' i i' : Fin N), j ≠ j' → (K y).step s j j' i i' = M.bsprob y s i' j') :
MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.1, z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLawUsual K)) = MeasureTheory.Measure.map (fun (w : Pos X n N × Idx n N × Idx n N) => (trajOf w.1 w.2.1, w)) ((MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K))

The joint distribution of x_{1:T} ∼ π, of the particle positions, and of the indices of the reference and of the output of Algorithm 1 with the usual implementation of Algorithm 1.d, arranged as (x, (y, b, l)), is that of Algorithm 1 (map_target_compProd_algLaw_traced) if K_{t,j,j'}(i, ·) = B_t(·|j') for j ≠ j' (Lemma 4).

theorem CSMC.FeynmanKac.map_target_compProd_algLaw {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :
MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLaw K)) = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K)

The particle positions and the indices of the reference and of the output of Algorithm 1 started from x_{1:T} ∼ π have the distribution of the particle positions under π̄ followed by the backward Markov chain pairChain K (Lemma 4).

theorem CSMC.FeynmanKac.map_target_compProd_algLawUsual {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) (hoff : ∀ (y : Pos X n N) (s : Fin n) (j j' i i' : Fin N), j ≠ j' → (K y).step s j j' i i' = M.bsprob y s i' j') :
MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLawUsual K)) = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K)

The same holds with the usual implementation of Algorithm 1.d if K_{t,j,j'}(i, ·) = B_t(·|j') for j ≠ j' (Lemma 4).

theorem CSMC.FeynmanKac.pairChain_map_swap {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :

Under the hypotheses of Algorithm 1, the backward Markov chain on pairs of indices does not change when the indices of the reference and of the output are exchanged.

theorem CSMC.FeynmanKac.isMarkovKernel_csmc {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :

For measurable kernels which satisfy the hypotheses of Algorithm 1, the kernel of Algorithm 1 is a Markov kernel.

theorem CSMC.FeynmanKac.target_compProd_csmc {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :
M.target.compProd (M.csmc K) = MeasureTheory.Measure.map (fun (w : Pos X n N × Idx n N × Idx n N) => (trajOf w.1 w.2.1, trajOf w.1 w.2.2)) ((MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K))

The joint distribution of x_{1:T} ∼ π and of the output of Algorithm 1 is that of the trajectories (x_1^{b_1}, …, x_T^{b_T}) and (x_1^{l_1}, …, x_T^{l_T}), where the particle positions have their distribution under π̄ and, given them, (b, l) is the backward Markov chain pairChain K.

theorem CSMC.FeynmanKac.isReversible_csmc {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :

For kernels K_T and K_{t,j,j'} as in Algorithm 1, the Markov kernel defined by Algorithm 1 is reversible with respect to π (Proposition 1).

theorem CSMC.FeynmanKac.invariant_csmc {X : Type u_1} [MeasurableSpace X] {n N : ℕ} {μ : MeasureTheory.Measure X} (M : FeynmanKac μ n) [MeasureTheory.SigmaFinite μ] (hN : 0 < N) {K : Pos X n N → BackwardKernels (Fin N) n} (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :

For kernels K_T and K_{t,j,j'} as in Algorithm 1, the Markov kernel defined by Algorithm 1 leaves π invariant (Proposition 1).