Skip to content

Commit

Permalink
#3
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Mar 23, 2022
1 parent 6741314 commit 8ce1a64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24, 0.25"
FillArrays = "0.9, 0.10, 0.11, 0.12, 0.13"
Primes = "0.5"
StatsBase = "0.29, 0.30, 0.31, 0.32, 0.33"
julia = "1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/MvNormalCDF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright © 2019-2021 Vladimir Arnautov aka PharmCat <mail@pharmcat.net>, Andrew Gough

module MvNormalCDF
using Distributions, Primes, Random, LinearAlgebra, FillArrays
using Distributions, Primes, Random, LinearAlgebra, FillArrays, StatsBase

export MvNormal, mvnormcdf

Expand Down
2 changes: 1 addition & 1 deletion src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function mvnormcdf(μ, Σ::AbstractMatrix{<:Real}, a::AbstractVector{<:Real}, b:
#Σstd = sqrt.(diag(Σ))
Σstd = Vector{Float64}(undef, n)
@inbounds for i in 1:n
d[i] = sqrt(Σ[i, i])
Σstd[i] = sqrt(Σ[i, i])
end
Rcorr = cov2cor(Σ, Σstd)
if n == 2
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ td[14,1] = [59.227 2.601 3.38 8.303 -0.334 11.029 10.908 0.739 4.703 7.075 8.049
@test v td[i, 9] atol=1e-10
end

#just test not validation
@test_nowarn MvNormalCDF.mvnormcdf(td[3,1], [0, 0, 0], [Inf, Inf, Inf]; m=m, rng = StableRNG(1234))

# test warning on singular Σ
r = td[6,1]
a = td[6,2]
Expand Down

2 comments on commit 8ce1a64

@PharmCat
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

#2 compat
#3 bugfix

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/57163

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:

git tag -a v0.2.4 -m "<description of version>" 8ce1a648b8c9d1b99998bbd6a1c707513ed48bac
git push origin v0.2.4

Please sign in to comment.