Skip to content

Commit

Permalink
Merge 779573c into 1498a31
Browse files Browse the repository at this point in the history
  • Loading branch information
timueh committed Sep 12, 2019
2 parents 1498a31 + 779573c commit b60ed3d
Show file tree
Hide file tree
Showing 19 changed files with 275 additions and 283 deletions.
34 changes: 19 additions & 15 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ git-tree-sha1 = "9a11d428dcdc425072af4aea19ab1e8c3e01c032"
uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d"
version = "1.3.0"

[[DataAPI]]
git-tree-sha1 = "8903f0219d3472543fc4b2f5ebaf675a07f817c0"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.0.1"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections", "Random", "Serialization", "Test"]
git-tree-sha1 = "ca971f03e146cf144a9e2f2ce59674f5bf0e8038"
Expand Down Expand Up @@ -89,15 +94,15 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[Distributions]]
deps = ["LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"]
git-tree-sha1 = "4ae0ff1a3a556383f7b1b004f5fb964b26ac96c9"
git-tree-sha1 = "baaf9e165ba8a2d11fb4fb3511782ee070ee3694"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.20.0"
version = "0.21.1"

[[FFTW]]
deps = ["AbstractFFTs", "BinaryProvider", "Compat", "Conda", "Libdl", "LinearAlgebra", "Reexport", "Test"]
git-tree-sha1 = "29cda58afbf62f35b1a094882ad6c745a47b2eaa"
deps = ["AbstractFFTs", "BinaryProvider", "Conda", "Libdl", "LinearAlgebra", "Reexport", "Test"]
git-tree-sha1 = "03f8776fbdae28c20c0d1d2ae4e090cd1dfcd247"
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
version = "0.2.4"
version = "1.0.0"

[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "InteractiveUtils", "LinearAlgebra", "NaNMath", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Test"]
Expand Down Expand Up @@ -139,10 +144,9 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Missings]]
deps = ["SparseArrays", "Test"]
git-tree-sha1 = "f0719736664b4358aa9ec173077d4285775f8007"
git-tree-sha1 = "29858ce6c8ae629cf2d733bffa329619a1c843d0"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.4.1"
version = "0.4.2"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
Expand All @@ -167,9 +171,9 @@ version = "0.9.9"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "db2b35dedab3c0e46dc15996d170af07a5ab91c9"
git-tree-sha1 = "ef0af6c8601db18c282d092ccbd2f01f3f0cd70b"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.6"
version = "0.3.7"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
Expand All @@ -187,9 +191,9 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[QuadGK]]
deps = ["DataStructures", "LinearAlgebra"]
git-tree-sha1 = "389fd27b958a33df5234772cc464b663b208273d"
git-tree-sha1 = "438630b843c210b375b2a246329200c113acc61b"
uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
version = "2.0.4"
version = "2.1.0"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
Expand Down Expand Up @@ -251,10 +255,10 @@ deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[StatsBase]]
deps = ["DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
git-tree-sha1 = "8a0f4b09c7426478ab677245ab2b0b68552143c7"
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
git-tree-sha1 = "c53e809e63fe5cf5de13632090bc3520649c9950"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.30.0"
version = "0.32.0"

[[StatsFuns]]
deps = ["Rmath", "SpecialFunctions", "Test"]
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# PolyChaos Release Notes

## Version 0.2.1
- increased code coverage
- examples work with new type hierarchy
- updated dependencies

## Version 0.2.0
- new type hierarchy that involves four abstract types:
- `AbstractMeasure`
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PolyChaos"
uuid = "8d666b04-775d-5f6e-b778-5ac7c70f65a3"
authors = ["timueh <tillmann.muehlpfordt@kit.edu>"]
version = "0.2.0"
version = "0.2.1"

[deps]
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75"
Expand Down
4 changes: 2 additions & 2 deletions src/PolyChaos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ include("typesMeasures.jl")
include("typesQuad.jl")
include("typesOrthoPolys.jl")
include("typesTensor.jl")
include("multiIndices.jl")
include("multi_indices.jl")
include("evaluate.jl")
include("quadrature_rules.jl")
include("recurrence_coefficients_monic.jl")
include("stieltjes.jl")
include("densities.jl")
include("auxfuns.jl")
include("scalarproduct.jl")
include("scalar_product.jl")
include("tensor.jl")
include("show.jl")
include("polynomial_chaos.jl")
Expand Down
43 changes: 14 additions & 29 deletions src/densities.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export w_legendre,
build_w_jacobi,
build_w_jacobi01,
w_jacobi,
w_jacobi01,
w_laguerre,
w_hermite,
build_w_genhermite,
Expand All @@ -17,24 +15,18 @@ export w_legendre,
build_w_beta,
build_w_gamma

_throwError(t) = throw(DomainError(t, "not in support"))

function w_legendre(t)
-1. <= t <= 1. ? 1. : throw(error("$t not in support"))
-1. <= t <= 1. ? 1. : _throwError(t)
end

function build_w_jacobi(a,b)
return t->w_jacobi(t,a,b)
end
function w_jacobi(t,a,b)
-1. <=t<= 1. ? ((1-t)^a*(1+t)^b) : throw(error("$t not in support"))
end

function build_w_jacobi01(a,b)
@assert a > -1. && b > -1. "Invalid shape parameters"
return t->w_jacobi01(t,a,b)
end

function w_jacobi01(t,a,b)
0. <=t<= 1. ? ((1-t)^a*t^b) : throw(error("$t not in support"))
function w_jacobi(t,a,b)
-1. <= t <= 1. ? (1-t)^a*(1+t)^b : _throwError(t)
end

function w_hermite(t)
Expand All @@ -45,59 +37,52 @@ function build_w_genhermite(mu)
return t->w_genhermite(t,mu)
end

function w_genhermite(t,μ::Float64)
function w_genhermite(t,μ)
abs(t)^(2*μ)*exp(-t^2)
end

function build_w_genlaguerre(a)
return t->w_genlaguerre(t,a)
end

function w_genlaguerre(t,a)
t>=0. ? Float64(t)^a*exp(-Float64(t)) : throw(error("$t not in support"))
end

function w_laguerre(t)
t>=0. ? exp(-t) : throw(error("$t not in support"))
t >= 0. ? exp(-t) : _throwError(t)
end

function w_meixner_pollaczek(t,lambda,phi)
1/(2*pi)*exp((2*phi-pi)*t)*abs(gamma(lambda+im*t))^2
1 / (2pi) * exp((2*phi - pi)*t) * abs(gamma(lambda+im*t))^2
end

function build_w_meixner_pollaczek(lambda,phi)
t->w_meixner_pollaczek(t,lambda,phi)
end


##################################################
# probability density functions
function w_gaussian(t)
1/(sqrt(2*pi))*exp(-0.5*t^2)
1 / (sqrt(2*pi))*exp(-0.5*t^2)
end

function build_w_beta(α,β)
return t->w_beta(t,α,β)
end

function w_beta(t,α,β)
t^-1)*(1-t)^-1)/beta(α,β)
-1 <= t <= 1 ? t^-1)*(1-t)^-1)/beta(α,β) : _throwError(t)
end



function build_w_gamma(α)
return t->w_gamma(t,α)
end

function w_gamma(t,α)
t>=0. ? (1/gamma(α)*Float64(t)^-1)*exp(-t)) : (error("$t not in support"))
t >= 0. ? (1/gamma(α)*Float64(t)^-1)*exp(-t)) : _throwError(t)
end


function w_uniform01(t)
0. <=t<= 1. ? 1. : (error("$t not in support"))
0. <= t <= 1. ? 1. : _throwError(t)
end


function w_logistic(t)
0.25*sech(0.5t)^2
end
146 changes: 0 additions & 146 deletions src/multiIndices.jl

This file was deleted.

Loading

0 comments on commit b60ed3d

Please sign in to comment.