ChromHMM chromatin-state model
The factored emission update
DefinitionWeight of binary vectors with a mark present#✓fully proved
The weight ∑ o with o j = true, c o of the binary vectors with mark j present.
Used by 8
Q(· | θ) · Factored per-mark update · Factored update is below one · Positivity of the factored update · The ChromHMM update is a valid parameter · Expected number of bins in a state with a mark present · Expected product-Bernoulli log-likelihood splits over marks · The factored update maximizes the expected log-likelihoodDefinitionWeight of binary vectors with a mark absent#✓fully proved
The weight ∑ o with o j = false, c o of the binary vectors with mark j absent.
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
Used by 8
Q(· | θ) · Factored per-mark update · Factored update is below one · Positivity of the factored update · The ChromHMM update is a valid parameter · Expected number of bins in a state with a mark absent · Expected product-Bernoulli log-likelihood splits over marks · The factored update maximizes the expected log-likelihoodDefinitionFactored per-mark update#✓fully proved
The factored (per-mark) update ones j / (ones j + zeros j).
noncomputable def factoredUpdate (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
onesCount c j / (onesCount c j + zerosCount c j)
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
TheoremProduct of Bernoulli distributions sums to one#✓fully proved
A product of Bernoulli distributions sums to one over the binary vectors, for every
parameter vector p (the identity is algebraic: ∏ j, (p j + (1 - p j)) = 1).
theorem sum_bernPMF (p : Fin d → ℝ) : ∑ x, bernPMF p x = 1
noncomputable def bernPMF (p : Fin d → ℝ) (x : Fin d → Bool) : ℝ :=
∏ j, if x j then p j else 1 - p j
CSLibExt/MachineLearning/LatentVariable/BernoulliMixture.lean:79
Uses 1 · Used by 1
TheoremExpected product-Bernoulli log-likelihood splits over marks#✓fully proved
The expected log-likelihood of weighted binary vectors under a product of Bernoulli
distributions with parameters in (0, 1) splits over the marks.
theorem sum_mul_log_bernPMF (c : (Fin d → Bool) → ℝ) {p : Fin d → ℝ} (hp0 : ∀ j, 0 < p j)
(hp1 : ∀ j, p j < 1) :
∑ o, c o * log (bernPMF p o) =
∑ j, (onesCount c j * log (p j) + zerosCount c j * log (1 - p j))
noncomputable def bernPMF (p : Fin d → ℝ) (x : Fin d → Bool) : ℝ :=
∏ j, if x j then p j else 1 - p j
CSLibExt/MachineLearning/LatentVariable/BernoulliMixture.lean:79
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
Uses 3 · Used by 1
TheoremThe factored update maximizes the expected log-likelihood#✓fully proved
The factored update maximizes the expected log-likelihood over all products of
Bernoulli distributions with parameters in (0, 1), for nonnegative weights c in which every
mark is both present and absent with positive weight.
theorem sum_mul_log_bernPMF_le_factoredUpdate {c : (Fin d → Bool) → ℝ} (hc : ∀ o, 0 ≤ c o)
(h1 : ∀ j, 0 < onesCount c j) (h0 : ∀ j, 0 < zerosCount c j) {p : Fin d → ℝ}
(hp0 : ∀ j, 0 < p j) (hp1 : ∀ j, p j < 1) :
∑ o, c o * log (bernPMF p o) ≤ ∑ o, c o * log (bernPMF (factoredUpdate c) o)
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
noncomputable def bernPMF (p : Fin d → ℝ) (x : Fin d → Bool) : ℝ :=
∏ j, if x j then p j else 1 - p j
CSLibExt/MachineLearning/LatentVariable/BernoulliMixture.lean:79
noncomputable def factoredUpdate (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
onesCount c j / (onesCount c j + zerosCount c j)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:78
Uses 5 · Used by 1
TheoremPositivity of the factored update#✓fully proved
The factored update is positive when both counts are.
theorem factoredUpdate_pos {c : (Fin d → Bool) → ℝ} (h1 : ∀ j, 0 < onesCount c j)
(h0 : ∀ j, 0 < zerosCount c j) (j : Fin d) : 0 < factoredUpdate c j
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
noncomputable def factoredUpdate (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
onesCount c j / (onesCount c j + zerosCount c j)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:78
Uses 3 · Used by 1
TheoremFactored update is below one#✓fully proved
The factored update is below one when both counts are positive.
theorem factoredUpdate_lt_one {c : (Fin d → Bool) → ℝ} (h1 : ∀ j, 0 < onesCount c j)
(h0 : ∀ j, 0 < zerosCount c j) (j : Fin d) : factoredUpdate c j < 1
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
noncomputable def factoredUpdate (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
onesCount c j / (onesCount c j + zerosCount c j)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:78
Uses 3 · Used by 1
The model
StructureChromHMM parameters#✓fully proved
ChromHMM parameters: initial and transition weights, and the presence probability of each mark in each state.
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
Used by 10
Q(· | θ) · One ChromHMM step on rich data · EM log-likelihood as a sum of HMM log-likelihoods · The ChromHMM M-step · The ChromHMM update is a valid parameter · HMM of ChromHMM parameters · Valid ChromHMM parameters give a valid HMM · Valid HMM built from a valid ChromHMM parameter · Valid ChromHMM parameters · Parameter space of ChromHMMDefinitionHMM of ChromHMM parameters#✓fully proved
The HMM of ChromHMM parameters: emissions are products of Bernoulli distributions.
noncomputable def Params.toHMM (θ : Params S d) : HMM S (Fin d → Bool) ℝ where
init := θ.init
trans := θ.trans
emit s o := bernPMF (θ.prob s) o
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:186
structure HMM (S O R : Type*) where
/-- The initial weight of each state. -/
init : S → R
/-- The weight of a transition from the first state to the second. -/
trans : S → S → R
/-- The weight of emitting an observation from a state. -/
emit : S → O → R
CSLibExt/MachineLearning/Sequence/HiddenMarkov.lean:59
emit : S → O → R
CSLibExt/MachineLearning/Sequence/HiddenMarkov.lean:65
noncomputable def bernPMF (p : Fin d → ℝ) (x : Fin d → Bool) : ℝ :=
∏ j, if x j then p j else 1 - p j
CSLibExt/MachineLearning/LatentVariable/BernoulliMixture.lean:79
StructureValid ChromHMM parameters#✓fully proved
Valid parameters: positive initial and transition distributions, mark probabilities in
(0, 1).
structure Params.Valid (θ : Params S d) : Prop where
init_pos : ∀ s, 0 < θ.init s
init_sum : ∑ s, θ.init s = 1
trans_pos : ∀ s s', 0 < θ.trans s s'
trans_sum : ∀ s, ∑ s', θ.trans s s' = 1
prob_pos : ∀ s j, 0 < θ.prob s j
prob_lt_one : ∀ s j, θ.prob s j < 1
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:186
Uses 1 · Used by 7
AbbreviationParameter space of ChromHMM#✓fully proved
The parameter space of ChromHMM.
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:186
Uses 2 · Used by 13
Q(· | θ) · One ChromHMM step on rich data · ChromHMM joint weight of a state path and mark vectors · Positivity of the ChromHMM joint weight · EM log-likelihood as a sum of HMM log-likelihoods · The log-likelihood is monotone along the ChromHMM iterates · Each ChromHMM step does not decrease the log-likelihood · The ChromHMM M-step · The ChromHMM update is a valid parameter · Expected number of bins in a state with a mark present · The factored update in posterior form · Expected number of bins in a state with a mark absent · Valid HMM built from a valid ChromHMM parameterTheoremValid ChromHMM parameters give a valid HMM#✓fully proved
A valid ChromHMM parameter is a valid HMM.
theorem Params.Valid.toHMM {θ : Params S d} (h : θ.Valid) : BaumWelch.Valid θ.toHMM
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:186
structure Valid (h : HMM S O ℝ) : Prop where
init_pos : ∀ s, 0 < h.init s
init_sum : ∑ s, h.init s = 1
trans_pos : ∀ s s', 0 < h.trans s s'
trans_sum : ∀ s, ∑ s', h.trans s s' = 1
emit_pos : ∀ s o, 0 < h.emit s o
emit_sum : ∀ s, ∑ o, h.emit s o = 1
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:80
Uses 7 · Used by 1
DefinitionValid HMM built from a valid ChromHMM parameter#✓fully proved
The valid HMM of a valid ChromHMM parameter.
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
abbrev ValidHMM (S O : Type*) [Fintype S] [Fintype O] := {h : HMM S O ℝ // Valid h}
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:89
Uses 8 · Used by 10
Q(· | θ) · ChromHMM joint weight of a state path and mark vectors · Positivity of the ChromHMM joint weight · The log-likelihood is monotone along the ChromHMM iterates · Each ChromHMM step does not decrease the log-likelihood · The ChromHMM M-step · The ChromHMM update is a valid parameter · Expected number of bins in a state with a mark present · The factored update in posterior form · Expected number of bins in a state with a mark absentDefinitionChromHMM joint weight of a state path and mark vectors#✓fully proved
The EM model of ChromHMM: the joint weight of a state path and a sequence of mark vectors.
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def joint (h : ValidHMM S O) (x : ℕ → O) (z : Fin (T + 1) → S) : ℝ :=
pathProb h.1 x T z
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:95
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:224
Uses 3 · Used by 5
DefinitionExpected number of bins in a state with a mark present#✓fully proved
The expected number of bins in state s with mark j present.
noncomputable def markOnes (θ : ValidParams S d) (s : S) (j : Fin d) : ℝ :=
onesCount (emitCount T xs (toValidHMM θ) s) j
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def onesCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then c o else 0
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:70
noncomputable def emitCount (h : ValidHMM S O) (s : S) (o : O) : ℝ :=
∑ n, ∑ z, post T xs h n z * pEmit T (xs n) z s o
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:187
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:224
Uses 4 · Used by 1
DefinitionExpected number of bins in a state with a mark absent#✓fully proved
The expected number of bins in state s with mark j absent.
noncomputable def markZeros (θ : ValidParams S d) (s : S) (j : Fin d) : ℝ :=
zerosCount (emitCount T xs (toValidHMM θ) s) j
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def zerosCount (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
∑ o, if o j then 0 else c o
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:74
noncomputable def emitCount (h : ValidHMM S O) (s : S) (o : O) : ℝ :=
∑ n, ∑ z, post T xs h n z * pEmit T (xs n) z s o
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:187
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:224
DefinitionThe ChromHMM M-step#✓fully proved
The Baum-Welch initial and transition updates, and the factored
emission update prob s j = markOnes / (markOnes + markZeros).
noncomputable def mStep (θ : ValidParams S d) : Params S d where
init := (BaumWelch.mStep T xs (toValidHMM θ)).init
trans := (BaumWelch.mStep T xs (toValidHMM θ)).trans
prob s := factoredUpdate (emitCount T xs (toValidHMM θ) s)
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
structure Params (S : Type*) (d : ℕ) where
/-- The initial weight of each state. -/
init : S → ℝ
/-- The transition weights. -/
trans : S → S → ℝ
/-- The probability that mark `j` is present in state `s`. -/
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:186
noncomputable def mStep (h : ValidHMM S O) : HMM S O ℝ where
init s := initCount T xs h s / N
trans s s' := transCount T xs h s s' / ∑ s'', transCount T xs h s s''
emit s o := emitCount T xs h s o / ∑ o', emitCount T xs h s o'
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:191
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:224
prob : S → Fin d → ℝ
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:192
noncomputable def factoredUpdate (c : (Fin d → Bool) → ℝ) (j : Fin d) : ℝ :=
onesCount c j / (onesCount c j + zerosCount c j)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:78
noncomputable def emitCount (h : ValidHMM S O) (s : S) (o : O) : ℝ :=
∑ n, ∑ z, post T xs h n z * pEmit T (xs n) z s o
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:187
Uses 7 · Used by 2
TheoremThe factored update in posterior form#✓fully proved
markOnes s j is the posterior expected number
of bins in state s at which mark j is present.
theorem markOnes_eq (θ : ValidParams S d) (s : S) (j : Fin d) :
markOnes T xs θ s j = ∑ n, ∑ z, post T xs (toValidHMM θ) n z *
∑ t : Fin (T + 1), if z t = s ∧ xs n t j = true then 1 else 0
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def markOnes (θ : ValidParams S d) (s : S) (j : Fin d) : ℝ :=
onesCount (emitCount T xs (toValidHMM θ) s) j
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:237
noncomputable def post (h : ValidHMM S O) (n : Fin N) (z : Fin (T + 1) → S) : ℝ :=
posterior (joint T) h (xs n) z
CSLibExt/MachineLearning/Sequence/BaumWelch.lean:175
noncomputable def toValidHMM (θ : ValidParams S d) : ValidHMM S (Fin d → Bool) :=
⟨θ.1.toHMM, θ.2.toHMM⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:224
StructureRich data for the ChromHMM M-step#✓fully proved
Data on which the ChromHMM M-step is valid: a sequence, a transition, and every mark both present and absent somewhere.
TheoremThe ChromHMM update is a valid parameter#✓fully proved
The ChromHMM update is a valid parameter on rich data.
theorem mStep_valid (hx : Rich T xs) (θ : ValidParams S d) : (mStep T xs θ).Valid
structure Rich (xs : Fin N → ℕ → Fin d → Bool) : Prop where
pos : 0 < N
len : 0 < T
marks : ∀ j b, ∃ n, ∃ t : Fin (T + 1), xs n t j = b
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:274
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def mStep (θ : ValidParams S d) : Params S d where
init := (BaumWelch.mStep T xs (toValidHMM θ)).init
trans := (BaumWelch.mStep T xs (toValidHMM θ)).trans
prob s := factoredUpdate (emitCount T xs (toValidHMM θ) s)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:246
Uses 26 · Used by 1
DefinitionOne ChromHMM step on rich data#✓fully proved
One ChromHMM step, on rich data.
noncomputable def emStep (hx : Rich T xs) (θ : ValidParams S d) : ValidParams S d :=
⟨mStep T xs θ, mStep_valid hx θ⟩
structure Rich (xs : Fin N → ℕ → Fin d → Bool) : Prop where
pos : 0 < N
len : 0 < T
marks : ∀ j b, ∃ n, ∃ t : Fin (T + 1), xs n t j = b
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:274
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def mStep (θ : ValidParams S d) : Params S d where
init := (BaumWelch.mStep T xs (toValidHMM θ)).init
trans := (BaumWelch.mStep T xs (toValidHMM θ)).trans
prob s := factoredUpdate (emitCount T xs (toValidHMM θ) s)
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:246
theorem mStep_valid (hx : Rich T xs) (θ : ValidParams S d) : (mStep T xs θ).Valid
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:340
Uses 6 · Used by 3
TheoremPositivity of the ChromHMM joint weight#✓fully proved
The ChromHMM joint weight is positive.
theorem joint_pos (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
0 < joint T θ x z
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:230
TheoremThe ChromHMM update maximizes Q(· | θ)#✓fully proved
The ChromHMM update maximizes Q(· | θ) over all valid product-Bernoulli HMMs.
theorem emQ_le_emStep (hx : Rich T xs) (θ' θ : ValidParams S d) :
emQ (joint T) xs θ' θ ≤ emQ (joint T) xs (emStep T xs hx θ) θ
structure Rich (xs : Fin N → ℕ → Fin d → Bool) : Prop where
pos : 0 < N
len : 0 < T
marks : ∀ j b, ∃ n, ∃ t : Fin (T + 1), xs n t j = b
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:274
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def emQ (p : Θ → X → Z → ℝ) (xs : Fin N → X) (θ' θ : Θ) : ℝ :=
∑ n, ∑ z, posterior p θ (xs n) z * log (p θ' (xs n) z)
CSLibExt/MachineLearning/LatentVariable/ExpectationMaximization.lean:122
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:230
noncomputable def emStep (hx : Rich T xs) (θ : ValidParams S d) : ValidParams S d :=
⟨mStep T xs θ, mStep_valid hx θ⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:356
Uses 29 · Used by 2
TheoremEach ChromHMM step does not decrease the log-likelihood#✓fully proved
Each ChromHMM step does not decrease the log-likelihood.
theorem logLik_le_emStep (hx : Rich T xs) (θ : ValidParams S d) :
logLik (joint T) xs θ ≤ logLik (joint T) xs (emStep T xs hx θ)
structure Rich (xs : Fin N → ℕ → Fin d → Bool) : Prop where
pos : 0 < N
len : 0 < T
marks : ∀ j b, ∃ n, ∃ t : Fin (T + 1), xs n t j = b
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:274
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def logLik (p : Θ → X → Z → ℝ) (xs : Fin N → X) (θ : Θ) : ℝ :=
∑ n, log (marginal p θ (xs n))
CSLibExt/MachineLearning/LatentVariable/ExpectationMaximization.lean:108
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:230
noncomputable def emStep (hx : Rich T xs) (θ : ValidParams S d) : ValidParams S d :=
⟨mStep T xs θ, mStep_valid hx θ⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:356
TheoremThe log-likelihood is monotone along the ChromHMM iterates#✓fully proved
The log-likelihood is monotone along the ChromHMM iterates.
theorem logLik_iterate_emStep_monotone (hx : Rich T xs) (θ₀ : ValidParams S d) :
Monotone fun k => logLik (joint T) xs ((emStep T xs hx)^[k] θ₀)
structure Rich (xs : Fin N → ℕ → Fin d → Bool) : Prop where
pos : 0 < N
len : 0 < T
marks : ∀ j b, ∃ n, ∃ t : Fin (T + 1), xs n t j = b
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:274
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def logLik (p : Θ → X → Z → ℝ) (xs : Fin N → X) (θ : Θ) : ℝ :=
∑ n, log (marginal p θ (xs n))
CSLibExt/MachineLearning/LatentVariable/ExpectationMaximization.lean:108
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:230
noncomputable def emStep (hx : Rich T xs) (θ : ValidParams S d) : ValidParams S d :=
⟨mStep T xs θ, mStep_valid hx θ⟩
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:356
TheoremEM log-likelihood as a sum of HMM log-likelihoods#✓fully proved
The EM log-likelihood is the sum of the HMM log-likelihoods of the sequences.
theorem logLik_eq (θ : ValidParams S d) :
logLik (joint T) xs θ = ∑ n, log (likelihood θ.1.toHMM (xs n) T)
abbrev ValidParams (S : Type*) [Fintype S] (d : ℕ) := {θ : Params S d // θ.Valid}
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:211
noncomputable def logLik (p : Θ → X → Z → ℝ) (xs : Fin N → X) (θ : Θ) : ℝ :=
∑ n, log (marginal p θ (xs n))
CSLibExt/MachineLearning/LatentVariable/ExpectationMaximization.lean:108
noncomputable def joint (θ : ValidParams S d) (x : ℕ → Fin d → Bool) (z : Fin (T + 1) → S) :
ℝ :=
BaumWelch.joint T (toValidHMM θ) x z
CSLibExt/Bioinformatics/Regulatory/ChromHMM.lean:230
def likelihood (t : ℕ) : R := ∑ z : Fin (t + 1) → S, pathProb h x t z
CSLibExt/MachineLearning/Sequence/HiddenMarkov.lean:79
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.