-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix mgf of NegativeBinomial * fix mgf of Geometric * Update src/univariate/discrete/geometric.jl Co-authored-by: David Widmann <[email protected]> * create test/.../geometric.jl * fix geometric cf * fix NegativeBinomial cf * fix * Update src/univariate/discrete/geometric.jl Co-authored-by: David Widmann <[email protected]> * Update src/univariate/discrete/geometric.jl Co-authored-by: David Widmann <[email protected]> * Update test/univariate/discrete/geometric.jl Co-authored-by: David Widmann <[email protected]> * Update test/univariate/discrete/negativebinomial.jl Co-authored-by: David Widmann <[email protected]> * Update test/univariates.jl Co-authored-by: David Widmann <[email protected]> * Update test/univariates.jl Co-authored-by: David Widmann <[email protected]> * improve cf, mgf or Geometric, NegativeBinomial * fix * fix Co-authored-by: David Widmann <[email protected]>
- Loading branch information
Showing
5 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Distributions | ||
using Test | ||
using FiniteDifferences | ||
|
||
@testset "Geometric mgf and k vs k-1 parametrization #1604" begin | ||
d = Geometric(0.2) | ||
@test mgf(d, 0) == 1 | ||
@test cf(d, 0) == 1 | ||
|
||
fdm1 = central_fdm(5, 1) | ||
@test fdm1(Base.Fix1(mgf, d), 0) ≈ mean(d) | ||
@test fdm1(Base.Fix1(cf, d), 0) ≈ mean(d) * im | ||
|
||
fdm2 = central_fdm(5, 2) | ||
m2 = var(d) + mean(d)^2 | ||
@test fdm2(Base.Fix1(mgf, d), 0) ≈ m2 | ||
@test fdm2(Base.Fix1(cf, d), 0) ≈ -m2 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters