feat(Probability): add mean and variance of Poisson distribution#37583
feat(Probability): add mean and variance of Poisson distribution#37583huaizhangchu wants to merge 3 commits intoleanprover-community:masterfrom
Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 5289bf289aImport changes exceeding 2%
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Probability.Distributions.Poisson.Basic | 2298 | 2410 | +112 (+4.87%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.Probability.Distributions.Poisson.PoissonLimitThm |
37 |
Mathlib.Probability.Distributions.Poisson.Basic |
112 |
Declarations diff
+ hasSum_poissonMeasure_descFactorial_two
+ hasSum_poissonMeasure_nat
+ hasSum_poissonMeasure_sq
+ lintegral_sq_nat_poissonMeasure
+ memLp_two_nat_poissonMeasure
+ poissonMeasure_mean
+ poissonMeasure_moment_two
+ poissonMeasure_variance
You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
This PR adds the mean and variance of the Poisson distribution over ℕ.
Main results
poissonMeasure_mean: the mean ofpoissonMeasure requalsrpoissonMeasure_moment_two: the second moment equalsr² + rpoissonMeasure_variance: the variance equalsrImplementation notes
The moments are computed via descending factorial moments. We first prove
hasSumlemmas forE[X]andE[X(X-1)], then obtainE[X²] = E[X(X-1)] + E[X] = r² + r, from which the variance follows.Related lemmas
hasSum_poissonMeasure_nat: weighted sum for the meanhasSum_poissonMeasure_descFactorial_two: weighted sum for the second descending factorial momenthasSum_poissonMeasure_sq: weighted sum for the second momentmemLp_two_nat_poissonMeasure: integrability condition for variance