Gene constraint scores (pLI and LOEUF)
DefinitionPoisson likelihood of an observed count#✓fully proved
The Poisson likelihood e^{-μ} μ^o / (o!) of an observed count o at mean μ.
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
Used by 10
Q(· | w) · Flat-prior posterior of γ · Joint likelihood of gene data and constraint class · Positivity of the Poisson mixture joint likelihood · Positivity of the Poisson likelihood · Recursion for the Poisson likelihood · Class posteriors sum to oneTheoremPositivity of the Poisson likelihood#✓fully proved
The likelihood is positive at a positive mean.
theorem poissonLik_pos {μ : ℝ} (hμ : 0 < μ) (o : ℕ) : 0 < poissonLik μ o
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:67
TheoremFlat-prior posterior of γ#✓fully proved
The likelihood γ ↦ P(o | Poisson(γ E)) times E is the
Gamma density of shape o + 1 and rate E. For E > 0 that density integrates to one, so E
is the normalizing constant of the flat-prior posterior (the identity itself is algebraic and
holds for every real E).
theorem flatPosterior_density (E : ℝ) {γ : ℝ} (hγ : 0 ≤ γ) (o : ℕ) :
E * poissonLik (γ * E) o = gammaPDFReal (o + 1) E γ
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:67
Uses 1
DefinitionUpper confidence bound for the observed/expected ratio#✓fully proved
The upper confidence bound for the observed/expected ratio at level α:
u_α(o) / E, with u_α Garwood's bound for the Poisson mean.
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
noncomputable def garwoodUpper (α : ℝ) (k : ℕ) : ℝ :=
sSup {x : ℝ | 0 ≤ x ∧ α ≤ poissonCDF x k}
MathlibExt/Probability/Distributions/PoissonGamma.lean:174
Uses 1 · Used by 7
DefinitionLOEUF#✓fully proved
The upper end of the 90% interval, oeUpper (1/20).
noncomputable def loeuf (E : ℝ) (o : ℕ) : ℝ := oeUpper (1 / 20) E o
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
Uses 1 · Used by 1
TheoremThe flat-prior posterior quantile is Garwood's bound#✓fully proved
The Gamma(o + 1, E) posterior
puts mass exactly 1 - α below oeUpper α E o.
theorem gammaMeasure_real_Iic_oeUpper {α E : ℝ} (hα0 : 0 < α) (hα1 : α < 1) (hE : 0 < E)
(o : ℕ) : (gammaMeasure (o + 1) E).real (Iic (oeUpper α E o)) = 1 - α
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
Uses 6
TheoremExact coverage#✓fully proved
For every true ratio γ ≥ 0 and E > 0, when o ~ Poisson(γ E),
P(γ ≤ oeUpper α E o) ≥ 1 - α.
theorem oeUpper_coverage {α E : ℝ} (hα0 : 0 < α) (hα1 : α < 1) (hE : 0 < E) (γ : ℝ≥0) :
1 - α ≤ (poissonMeasure (γ * ⟨E, hE.le⟩)).real {o | (γ : ℝ) ≤ oeUpper α E o}
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
Uses 3
TheoremObserved/expected upper bound with no observed variants#✓fully proved
With no observed variants the bound is log (1 / α) / E.
theorem oeUpper_zero {α E : ℝ} (hα0 : 0 < α) (hα1 : α < 1) :
oeUpper α E 0 = log (1 / α) / E
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
Uses 3 · Used by 1
TheoremLOEUF of a gene with no observed LoF variants#✓fully proved
LOEUF of a gene with no observed LoF variants is log 20 / E.
theorem loeuf_zero (E : ℝ) : loeuf E 0 = log 20 / E
noncomputable def loeuf (E : ℝ) (o : ℕ) : ℝ := oeUpper (1 / 20) E o
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:93
Uses 3
TheoremObserved/expected upper bound increases with the observed count#✓fully proved
The bound is strictly increasing in the observed count.
theorem oeUpper_strictMono {α E : ℝ} (hα0 : 0 < α) (hα1 : α < 1) (hE : 0 < E) :
StrictMono (oeUpper α E)
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
TheoremObserved/expected upper bound decreases with the expected count#✓fully proved
The bound is strictly decreasing in the expected count E > 0.
theorem oeUpper_strictAntiOn {α : ℝ} (hα0 : 0 < α) (hα1 : α < 1) (o : ℕ) :
StrictAntiOn (fun E => oeUpper α E o) (Ioi 0)
noncomputable def oeUpper (α E : ℝ) (o : ℕ) : ℝ := garwoodUpper α o / E
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:90
Uses 3
DefinitionPosterior class probability in the Poisson mixture#✓fully proved
The posterior probability of class c for a gene with o observed and E expected LoF
variants, in the Poisson mixture with prior weights w and class rates rate:
w_c P(o | rate_c E) / ∑_{c'} w_{c'} P(o | rate_{c'} E). pLI is this at the class with the smallest
rate.
noncomputable def classPosterior (w rate : ι → ℝ) (E : ℝ) (o : ℕ) (c : ι) : ℝ :=
w c * poissonLik (rate c * E) o / ∑ c', w c' * poissonLik (rate c' * E) o
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:67
Uses 1 · Used by 3
TheoremClass posteriors sum to one#✓fully proved
The class posteriors sum to one.
theorem sum_classPosterior {w rate : ι → ℝ} {E : ℝ} (hw : ∀ c, 0 < w c) (hrate : ∀ c, 0 < rate c)
(hE : 0 < E) [Nonempty ι] (o : ℕ) : ∑ c, classPosterior w rate E o c = 1
noncomputable def classPosterior (w rate : ι → ℝ) (E : ℝ) (o : ℕ) (c : ι) : ℝ :=
w c * poissonLik (rate c * E) o / ∑ c', w c' * poissonLik (rate c' * E) o
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:145
Uses 3
TheoremRecursion for the Poisson likelihood#✓fully proved
The likelihood recursion P(o + 1 | μ) = P(o | μ) μ / (o + 1).
theorem poissonLik_succ (μ : ℝ) (o : ℕ) :
poissonLik μ (o + 1) = poissonLik μ o * μ / (o + 1)
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:67
Uses 1 · Used by 2
TheorempLI is antitone in the observed count#✓fully proved
The posterior of a class c₀ whose rate is the
smallest is antitone in o, for every prior.
theorem classPosterior_antitone {w rate : ι → ℝ} {E : ℝ} (hw : ∀ c, 0 < w c)
(hrate : ∀ c, 0 < rate c) (hE : 0 < E) {c₀ : ι} (hmin : ∀ c, rate c₀ ≤ rate c) :
Antitone fun o => classPosterior w rate E o c₀
noncomputable def classPosterior (w rate : ι → ℝ) (E : ℝ) (o : ℕ) (c : ι) : ℝ :=
w c * poissonLik (rate c * E) o / ∑ c', w c' * poissonLik (rate c' * E) o
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:145
TheoremClass posterior is strictly antitone in the observed count#✓fully proved
Strictly antitone when some class has a strictly larger rate.
theorem classPosterior_strictAnti {w rate : ι → ℝ} {E : ℝ} (hw : ∀ c, 0 < w c)
(hrate : ∀ c, 0 < rate c) (hE : 0 < E) {c₀ : ι} (hmin : ∀ c, rate c₀ ≤ rate c)
(hlt : ∃ c, rate c₀ < rate c) : StrictAnti fun o => classPosterior w rate E o c₀
noncomputable def classPosterior (w rate : ι → ℝ) (E : ℝ) (o : ℕ) (c : ι) : ℝ :=
w c * poissonLik (rate c * E) o / ∑ c', w c' * poissonLik (rate c' * E) o
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:145
DefinitionStrictly positive class weights summing to one#✓fully proved
Strictly positive class weights summing to one.
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
Used by 9
Q(· | w) · EM update of the Poisson mixture class weights · Joint likelihood of gene data and constraint class · Positivity of the Poisson mixture joint likelihood · Monotonicity of the log-likelihood along the class-weight EM iterates · EM does not decrease the likelihood · Expected number of genes in a constraint class · Positivity of the class masses · Class masses sum to the number of genesStructureLoss-of-function count data for a gene#✓fully proved
A gene's data: observed LoF count o and positive expected count E.
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
E : ℝ
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:64
Used by 9
Q(· | w) · EM update of the Poisson mixture class weights · Joint likelihood of gene data and constraint class · Positivity of the Poisson mixture joint likelihood · Monotonicity of the log-likelihood along the class-weight EM iterates · EM does not decrease the likelihood · Expected number of genes in a constraint class · Positivity of the class masses · Class masses sum to the number of genesDefinitionJoint likelihood of gene data and constraint class#✓fully proved
The joint likelihood of a gene's data and class z: w_z P(o | rate_z E).
noncomputable def joint (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
noncomputable def poissonLik (μ : ℝ) (o : ℕ) : ℝ := exp (-μ) * μ ^ o / (o ! : ℝ)
MathlibExt/Biology/StatisticalGenetics/GeneConstraint.lean:67
Uses 3 · Used by 7
Q(· | w) · Positivity of the Poisson mixture joint likelihood · Monotonicity of the log-likelihood along the class-weight EM iterates · EM does not decrease the likelihood · Expected number of genes in a constraint class · Positivity of the class masses · Class masses sum to the number of genesTheoremPositivity of the Poisson mixture joint likelihood#✓fully proved
The joint likelihood is positive for positive rates.
theorem joint_pos {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c) (w : PosWeights ι) (x : GeneData)
(z : ι) : 0 < joint rate w x z
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
noncomputable def joint (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:68
Uses 5 · Used by 4
DefinitionExpected number of genes in a constraint class#✓fully proved
The expected number of genes in class z under the posteriors at weights w:
∑_n P_w(z | o_n).
noncomputable def mass (rate : ι → ℝ) (xs : Fin N → GeneData) (w : PosWeights ι) (z : ι) : ℝ :=
∑ n, posterior (joint rate) w (xs n) z
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
noncomputable def posterior (p : Θ → X → Z → ℝ) (θ : Θ) (x : X) (z : Z) : ℝ :=
p θ x z / marginal p θ x
CSLibExt/MachineLearning/LatentVariable/ExpectationMaximization.lean:112
noncomputable def joint (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:68
TheoremPositivity of the class masses#✓fully proved
The class masses are positive when there is at least one gene.
theorem mass_pos [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) (z : ι) : 0 < mass rate xs w z
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
noncomputable def mass (rate : ι → ℝ) (xs : Fin N → GeneData) (w : PosWeights ι) (z : ι) : ℝ :=
∑ n, posterior (joint rate) w (xs n) z
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:78
Uses 7 · Used by 2
TheoremClass masses sum to the number of genes#✓fully proved
The class masses add up to the number of genes.
theorem sum_mass [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (w : PosWeights ι) : ∑ z, mass rate xs w z = N
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
noncomputable def mass (rate : ι → ℝ) (xs : Fin N → GeneData) (w : PosWeights ι) (z : ι) : ℝ :=
∑ n, posterior (joint rate) w (xs n) z
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:78
Uses 7 · Used by 2
DefinitionEM update of the Poisson mixture class weights#✓fully proved
The EM update w'_z = (1/N) ∑_n P_w(z | o_n), for N > 0 genes and positive rates.
noncomputable def emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) : PosWeights ι :=
⟨fun z => mass rate xs w z / N, fun z => div_pos (mass_pos hrate xs hN w z)
(by exact_mod_cast hN), by
rw [← Finset.sum_div, sum_mass hrate xs w]
exact div_self (by exact_mod_cast hN.ne')⟩
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
noncomputable def mass (rate : ι → ℝ) (xs : Fin N → GeneData) (w : PosWeights ι) (z : ι) : ℝ :=
∑ n, posterior (joint rate) w (xs n) z
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:78
theorem mass_pos [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) (z : ι) : 0 < mass rate xs w z
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:87
TheoremThe M-step maximizes Q(· | w)#✓fully proved
The M-step maximizes Q(· | w) over admissible weights.
theorem emQ_le_emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w' w : PosWeights ι) :
emQ (joint rate) xs w' w ≤ emQ (joint rate) xs (emStep hrate xs hN w) w
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
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 (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:68
noncomputable def emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) : PosWeights ι :=
⟨fun z => mass rate xs w z / N, fun z => div_pos (mass_pos hrate xs hN w z)
(by exact_mod_cast hN), by
rw [← Finset.sum_div, sum_mass hrate xs w]
exact div_self (by exact_mod_cast hN.ne')⟩
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:100
Uses 12 · Used by 2
TheoremEM does not decrease the likelihood#✓fully proved
EM does not decrease the likelihood of the class weights.
theorem logLik_le_logLik_emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) :
logLik (joint rate) xs w ≤ logLik (joint rate) xs (emStep hrate xs hN w)
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
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 (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:68
noncomputable def emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) : PosWeights ι :=
⟨fun z => mass rate xs w z / N, fun z => div_pos (mass_pos hrate xs hN w z)
(by exact_mod_cast hN), by
rw [← Finset.sum_div, sum_mass hrate xs w]
exact div_self (by exact_mod_cast hN.ne')⟩
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:100
TheoremMonotonicity of the log-likelihood along the class-weight EM iterates#✓fully proved
The log-likelihood is monotone along the EM iterates.
theorem logLik_iterate_emStep_monotone [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w₀ : PosWeights ι) :
Monotone fun k => logLik (joint rate) xs ((emStep hrate xs hN)^[k] w₀)
structure GeneData where
/-- Observed LoF count. -/
o : ℕ
/-- Expected LoF count under neutrality. -/
E : ℝ
E_pos : 0 < E
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:60
def PosWeights (ι : Type*) [Fintype ι] : Type _ :=
{w : ι → ℝ // (∀ c, 0 < w c) ∧ ∑ c, w c = 1}
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:56
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 (rate : ι → ℝ) (w : PosWeights ι) (x : GeneData) (z : ι) : ℝ :=
w.1 z * poissonLik (rate z * x.E) x.o
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:68
noncomputable def emStep [Nonempty ι] {rate : ι → ℝ} (hrate : ∀ c, 0 < rate c)
(xs : Fin N → GeneData) (hN : 0 < N) (w : PosWeights ι) : PosWeights ι :=
⟨fun z => mass rate xs w z / N, fun z => div_pos (mass_pos hrate xs hN w z)
(by exact_mod_cast hN), by
rw [← Finset.sum_div, sum_mass hrate xs w]
exact div_self (by exact_mod_cast hN.ne')⟩
CSLibExt/Bioinformatics/StatisticalGenetics/PoissonClassEM.lean:100
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.