-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Use julia implementations for pdfs and some cdf-like functions (#113)" This reverts commit 28d732a. * Fix test errors on Julia 1.0 * Run CI on Julia 1.0 * Bump version * Update Project.toml
- Loading branch information
Showing
11 changed files
with
104 additions
and
280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.0' | ||
- '1' | ||
os: | ||
- ubuntu-latest | ||
|
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 |
---|---|---|
@@ -1,11 +1,22 @@ | ||
# functions related to chi-square distribution | ||
|
||
# Just use the Gamma definitions | ||
for f in ("pdf", "logpdf", "cdf", "ccdf", "logcdf", "logccdf", "invcdf", "invccdf", "invlogcdf", "invlogccdf") | ||
_chisqf = Symbol("chisq"*f) | ||
_gammaf = Symbol("gamma"*f) | ||
@eval begin | ||
$(_chisqf)(k::Real, x::Real) = $(_chisqf)(promote(k, x)...) | ||
$(_chisqf)(k::T, x::T) where {T<:Real} = $(_gammaf)(k/2, 2, x) | ||
end | ||
end | ||
# R implementations | ||
# For pdf and logpdf we use the Julia implementation | ||
using .RFunctions: | ||
chisqcdf, | ||
chisqccdf, | ||
chisqlogcdf, | ||
chisqlogccdf, | ||
chisqinvcdf, | ||
chisqinvccdf, | ||
chisqinvlogcdf, | ||
chisqinvlogccdf | ||
|
||
# Julia implementations | ||
# promotion ensures that we do forward e.g. `chisqpdf(::Int, ::Float32)` to | ||
# `gammapdf(::Float32, ::Int, ::Float32)` but not `gammapdf(::Float64, ::Int, ::Float32)` | ||
chisqpdf(k::Real, x::Real) = chisqpdf(promote(k, x)...) | ||
chisqpdf(k::T, x::T) where {T<:Real} = gammapdf(k / 2, 2, x) | ||
|
||
chisqlogpdf(k::Real, x::Real) = chisqlogpdf(promote(k, x)...) | ||
chisqlogpdf(k::T, x::T) where {T<:Real} = gammalogpdf(k / 2, 2, x) |
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
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
Oops, something went wrong.
a93d6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
a93d6b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/58185
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: