diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c29c1a0b7..c61d02151 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -52,8 +52,8 @@ steps: export PYTHONHOME="$$JULIA_DEPOT_PATH/conda/3/bin" export CONDA_JL_HOME="$$JULIA_DEPOT_PATH/conda/3" - mkdir examples/GaussianProcessEmulator/depot - export JULIA_DEPOT_PATH="$$(pwd)/examples/GaussianProcessEmulator/depot:$JULIA_DEPOT_PATH" + mkdir examples/Emulator/GaussianProcess/depot + export JULIA_DEPOT_PATH="$$(pwd)/examples/Emulator/GaussianProcess/depot:$JULIA_DEPOT_PATH" julia --color=yes --project -e ' println("--- Instantiating Project") @@ -61,12 +61,10 @@ steps: Pkg.instantiate() Pkg.activate("examples/GaussianProcessEmulator") Pkg.instantiate() - println("+++ Running Learn Noise") - include("examples/GaussianProcessEmulator/learn_noise.jl") println("+++ Running PlotGP") - include("examples/GaussianProcessEmulator/plot_GP.jl")' + include("examples/Emulator/GaussianProcess/plot_GP.jl")' artifact_paths: - - "examples/GaussianProcessEmulator/output/*.png" + - "examples/Emulator/GaussianProcess/output/*.png" env: PYTHON: "$$JULIA_DEPOT_PATH/conda/3/bin/python" PYTHONHOME: "$$JULIA_DEPOT_PATH/conda/3/bin" diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index 4b7afa04f..794b7cdd9 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: - version: 1.5.4 + version: 1.6 - name: Cache artifacts uses: actions/cache@v1 env: diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 9939624e2..e2abf00d2 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Julia uses: julia-actions/setup-julia@v1 with: - version: 1.5.4 + version: 1.6 - name: Install Julia Project Packages # we add this ENV varaible to force PyCall to download and use Conda rather than @@ -80,7 +80,7 @@ jobs: - name: Set up Julia uses: julia-actions/setup-julia@v1 with: - version: 1.5.4 + version: 1.6 - name: Install Julia Project Packages env: @@ -119,7 +119,7 @@ jobs: - name: Set up Julia uses: julia-actions/setup-julia@v1 with: - version: 1.5.4 + version: 1.6 - name: Install Julia Project Packages env: diff --git a/Manifest.toml b/Manifest.toml index 0ed911242..c78a0570d 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,55 +1,78 @@ # This file is machine-generated - editing it directly is not advised -[[AbstractFFTs]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" -uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "0.5.0" +[[AMD]] +deps = ["Libdl", "LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "fc66ffc5cff568936649445f58a55b81eaf9592c" +uuid = "14f7f29c-3bd6-536c-9a0b-7339e30b5a3e" +version = "0.4.0" + +[[AbstractTrees]] +git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.3.4" [[Adapt]] deps = ["LinearAlgebra"] -git-tree-sha1 = "ffcfa2d345aaee0ef3d8346a073d5dd03c983ebe" +git-tree-sha1 = "84918055d15b3114ede17ac6a7182f68870c16f7" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.2.0" +version = "3.3.1" + +[[ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[ArrayInterface]] -deps = ["IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"] -git-tree-sha1 = "da557609446152beb6ee134683d7b79ece129eae" +deps = ["Compat", "IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"] +git-tree-sha1 = "265b06e2b1f6a216e0e8f183d28e4d354eab3220" uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "3.1.5" - -[[ArrayLayouts]] -deps = ["Compat", "FillArrays", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "a577e27915fdcb3f6b96118b56655b38e3b466f2" -uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -version = "0.4.12" +version = "3.2.1" [[Artifacts]] -deps = ["Pkg"] -git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744" uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -version = "1.3.0" [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[CategoricalArrays]] -deps = ["DataAPI", "Future", "JSON", "Missings", "Printf", "Statistics", "StructTypes", "Unicode"] -git-tree-sha1 = "dbfddfafb75fae5356e00529ce67454125935945" -uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597" -version = "0.9.3" +[[BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "940001114a0147b6e4d10624276d56d531dd9b49" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "1.2.2" + +[[BinaryProvider]] +deps = ["Libdl", "Logging", "SHA"] +git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.10" -[[ChainRules]] -deps = ["ChainRulesCore", "Compat", "LinearAlgebra", "Random", "Reexport", "Requires", "Statistics"] -git-tree-sha1 = "e01f521443e3700f40ad3c7c1c6aa3a6940aaea1" -uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" -version = "0.7.54" +[[Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+0" [[ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3" +git-tree-sha1 = "4c26b4e9e91ca528ea212927326ece5918a04b47" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.29" +version = "1.11.2" + +[[ChangesOfVariables]] +deps = ["ChainRulesCore", "LinearAlgebra", "Test"] +git-tree-sha1 = "bf98fa45a0a4cee295de98d4c1462be26345b9a1" +uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" +version = "0.1.2" + +[[CodecBzip2]] +deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "2e62a725210ce3c3c2e1a3080190e7ca491f18d7" +uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +version = "0.7.2" + +[[CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.0" [[CommonSubexpressions]] deps = ["MacroTools", "Test"] @@ -59,27 +82,25 @@ version = "0.3.0" [[Compat]] deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" +git-tree-sha1 = "44c37b4636bc54afac5c574d2d02b625349d6582" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.25.0" +version = "3.41.0" [[CompilerSupportLibraries_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "8e695f735fca77e9708e795eda62afdb869cbb70" +deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "0.3.4+0" [[Conda]] -deps = ["JSON", "VersionParsing"] -git-tree-sha1 = "c0647249d785f1d5139c0cc96db8f6b32f7ec416" +deps = ["Downloads", "JSON", "VersionParsing"] +git-tree-sha1 = "6cdc8832ba11c7695f494c9d9a1c31e90959ce0f" uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" -version = "1.5.0" +version = "1.6.0" -[[CpuId]] -deps = ["Markdown", "Test"] -git-tree-sha1 = "f0464e499ab9973b43c20f8216d088b61fda80c6" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.2.2" +[[Convex]] +deps = ["AbstractTrees", "BenchmarkTools", "LDLFactorizations", "LinearAlgebra", "MathOptInterface", "OrderedCollections", "SparseArrays", "Test"] +git-tree-sha1 = "145c5e0b3ea3c9dd3bba134a58bab4112aa250c8" +uuid = "f65535da-76fb-5f13-bab9-19810c17039a" +version = "0.14.18" [[Crayons]] git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d" @@ -87,21 +108,21 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.0.4" [[DataAPI]] -git-tree-sha1 = "dfb3b7e89e395be1e25c2ad6d7690dc29cc53b1d" +git-tree-sha1 = "cc70b17275652eb47bc9e5f81635981f13cea5c8" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.6.0" +version = "1.9.0" [[DataFrames]] -deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] -git-tree-sha1 = "b0db5579803eabb33f1274ca7ca2f472fdfb7f2a" +deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "cfdfef912b7f93e4b848e80b9befdf9e331bc05a" uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -version = "0.22.5" +version = "1.3.1" [[DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" +git-tree-sha1 = "3daef5523dd2e769dad2365274f760ff5f282c7d" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" +version = "0.18.11" [[DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -123,16 +144,16 @@ uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" version = "1.0.3" [[DiffRules]] -deps = ["NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "214c3fcac57755cfda163d91c58893a8723f93e9" +deps = ["LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "9bc5dac3c8b6706b58ad5ce24cffd9861f07c94f" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.0.2" +version = "1.9.0" [[Distances]] -deps = ["LinearAlgebra", "Statistics"] -git-tree-sha1 = "366715149014943abd71aa647a07a43314158b2d" +deps = ["LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "3258d0659f812acde79e8a74b11f17ac06d0ca04" uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" -version = "0.10.2" +version = "0.10.7" [[Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -140,21 +161,25 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[Distributions]] deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"] -git-tree-sha1 = "f0e06a5b5ccda38e2fb8f59d91316e657b67047d" +git-tree-sha1 = "a837fdf80f333415b69684ba8e8ae6ba76de6aaa" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.24.12" +version = "0.24.18" [[DocStringExtensions]] -deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" +deps = ["LibGit2"] +git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.3" +version = "0.8.6" + +[[Downloads]] +deps = ["ArgTools", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[ElasticArrays]] deps = ["Adapt"] -git-tree-sha1 = "395e36b5962bd11bf080f4fe06546cd26a34e0d8" +git-tree-sha1 = "a0fcc1bb3c9ceaf07e1d0529c9806ce94be6adf9" uuid = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4" -version = "1.2.6" +version = "1.2.9" [[ElasticPDMats]] deps = ["LinearAlgebra", "MacroTools", "PDMats"] @@ -163,30 +188,30 @@ uuid = "2904ab23-551e-5aed-883f-487f97af5226" version = "0.2.2" [[EnsembleKalmanProcesses]] -deps = ["Distributions", "DocStringExtensions", "LinearAlgebra", "Random", "Statistics", "StatsBase"] -git-tree-sha1 = "4b8328fecf09cb427e18b319edaf9989f8389fed" +deps = ["Convex", "Distributions", "DocStringExtensions", "LinearAlgebra", "Random", "SCS", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "8d64c688e053de72dbe24d3ecc2945ee51c8930c" repo-rev = "main" repo-url = "https://github.com/CliMA/EnsembleKalmanProcesses.jl" uuid = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" -version = "0.1.0" +version = "0.1.2" [[FastGaussQuadrature]] deps = ["LinearAlgebra", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "5829b25887e53fb6730a9df2ff89ed24baa6abf6" +git-tree-sha1 = "58d83dd5a78a36205bdfddb82b1bb67682e64487" uuid = "442a2c76-b920-505d-bb47-c5924d526838" -version = "0.4.7" +version = "0.4.9" [[FillArrays]] deps = ["LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "ff537e5a3cba92fb48f30fec46723510450f2c0e" +git-tree-sha1 = "693210145367e7685d8604aee33d9bfb85db8b31" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "0.10.2" +version = "0.11.9" [[FiniteDiff]] deps = ["ArrayInterface", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays"] -git-tree-sha1 = "f6f80c8f934efd49a286bb5315360be66956dfc4" +git-tree-sha1 = "8b3c09b56acaf3c0e581c66638b85c8650ee9dca" uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.8.0" +version = "2.8.1" [[Formatting]] deps = ["Printf"] @@ -195,46 +220,50 @@ uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" version = "0.4.2" [[ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "d48a40c0f54f29a5c8748cfb3225719accc72b77" +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "2b72a5624e289ee18256111657663721d59c143e" uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.16" +version = "0.10.24" [[Future]] deps = ["Random"] uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" [[GaussianProcesses]] -deps = ["Distances", "Distributions", "ElasticArrays", "ElasticPDMats", "FastGaussQuadrature", "ForwardDiff", "LinearAlgebra", "Optim", "PDMats", "Printf", "ProgressMeter", "Random", "RecipesBase", "ScikitLearnBase", "SpecialFunctions", "StaticArrays", "Statistics", "StatsFuns", "Zygote"] -git-tree-sha1 = "06f890e71136832f1c577aa443d3777ffa9594fa" +deps = ["Distances", "Distributions", "ElasticArrays", "ElasticPDMats", "FastGaussQuadrature", "ForwardDiff", "LinearAlgebra", "Optim", "PDMats", "Printf", "ProgressMeter", "Random", "RecipesBase", "ScikitLearnBase", "SpecialFunctions", "StaticArrays", "Statistics", "StatsFuns"] +git-tree-sha1 = "9cf8ba8037e332b1be14c71e549143e68c42a22d" uuid = "891a1506-143c-57d2-908e-e1f8e92e6de9" -version = "0.12.3" - -[[IRTools]] -deps = ["InteractiveUtils", "MacroTools", "Test"] -git-tree-sha1 = "c67e7515a11f726f44083e74f218d134396d6510" -uuid = "7869d1d1-7146-5819-86e3-90919afe41df" -version = "0.4.2" +version = "0.12.4" [[IfElse]] -git-tree-sha1 = "28e837ff3e7a6c3cdb252ce49fb412c8eb3caeef" +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.0" +version = "0.1.1" [[InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -[[InvertedIndices]] +[[InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc" +git-tree-sha1 = "a7254c0acd8e62f1ac75ad24d5db43f5f19f3c65" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.2" + +[[InvertedIndices]] +git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f" uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" -version = "1.0.0" +version = "1.1.0" + +[[IrrationalConstants]] +git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.1.1" [[IterTools]] -git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" +git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.3.0" +version = "1.4.0" [[IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -242,20 +271,39 @@ uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[JLLWrappers]] -git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0" +deps = ["Preferences"] +git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.2.0" +version = "1.3.0" [[JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" +git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" +version = "0.21.2" + +[[LDLFactorizations]] +deps = ["AMD", "LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "399bbe845e06e1c2d44ebb241f554d45eaf66788" +uuid = "40e66cde-538c-5869-a4ad-c39174c6795b" +version = "0.8.1" + +[[LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" + +[[LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[LibGit2]] -deps = ["Printf"] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" +[[LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" + [[Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -269,73 +317,91 @@ version = "7.1.1" deps = ["Libdl"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +[[LogExpFunctions]] +deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "e5718a00af0ab9756305a0392832c8952c7426c1" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.6" + [[Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" -[[LoopVectorization]] -deps = ["DocStringExtensions", "LinearAlgebra", "OffsetArrays", "SIMDPirates", "SLEEFPirates", "UnPack", "VectorizationBase"] -git-tree-sha1 = "3242a8f411e19eda9adc49d0b877681975c11375" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.8.26" - [[MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" +git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.6" +version = "0.5.9" [[Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +[[MathOptInterface]] +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "JSON", "LinearAlgebra", "MutableArithmetics", "OrderedCollections", "Printf", "SparseArrays", "Test", "Unicode"] +git-tree-sha1 = "92b7de61ecb616562fd2501334f729cc9db2a9a6" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "0.10.6" + +[[MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" + [[Missings]] deps = ["DataAPI"] -git-tree-sha1 = "f8c673ccc215eb50fcadb285f522420e29e69e1c" +git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f" uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "0.4.5" +version = "1.0.2" [[Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" +[[MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" + +[[MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "7bb6853d9afec54019c1397c6eb610b9b9a19525" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "0.3.1" + [[NLSolversBase]] deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "39d6bc45e99c96e6995cbddac02877f9b61a1dd1" +git-tree-sha1 = "50310f934e55e5ca3912fb941dec199b49ca9b68" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.7.1" - -[[NNlib]] -deps = ["ChainRulesCore", "Compat", "LinearAlgebra", "Pkg", "Requires", "Statistics"] -git-tree-sha1 = "5ce2e4b2bfe3811811e7db4b6a148439806fd2f8" -uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" -version = "0.7.16" +version = "7.8.2" [[NaNMath]] -git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" +git-tree-sha1 = "f755f36b19a5116bb580de457cda0c140153f283" uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "0.3.5" +version = "0.3.6" -[[OffsetArrays]] -deps = ["Adapt"] -git-tree-sha1 = "b3dfef5f2be7d7eb0e782ba9146a5271ee426e90" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.6.2" +[[NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" + +[[OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" + +[[OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" [[OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.3+4" +version = "0.5.5+0" [[Optim]] -deps = ["Compat", "FillArrays", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "3286df38aba45acf7445f3acd87b7b57b7c7feb7" +deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] +git-tree-sha1 = "35d435b512fbab1d1a29138b5229279925eba369" uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.2.4" +version = "1.5.0" [[OrderedCollections]] -git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf" +git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.4.0" +version = "1.4.1" [[PDMats]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] @@ -345,25 +411,25 @@ version = "0.10.1" [[Parameters]] deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "2276ac65f1e236e0a6ea70baff3f62ad4c625345" +git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.2" +version = "0.12.3" [[Parsers]] deps = ["Dates"] -git-tree-sha1 = "223a825cccef2228f3fdbf2ecc7ca93363059073" +git-tree-sha1 = "d7fa6237da8004be601e19bd6666083056649918" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.16" +version = "2.1.3" [[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[PooledArrays]] deps = ["DataAPI", "Future"] -git-tree-sha1 = "cde4ce9d6f33219465b55162811d8de8139c0414" +git-tree-sha1 = "db3a23166af8aebf4db5ef87ac5b00d36eb771e2" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" -version = "1.2.1" +version = "1.4.0" [[PositiveFactorizations]] deps = ["LinearAlgebra"] @@ -371,36 +437,46 @@ git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" version = "0.2.4" +[[Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.2.2" + [[PrettyTables]] deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"] -git-tree-sha1 = "574a6b3ea95f04e8757c0280bb9c29f1a5e35138" +git-tree-sha1 = "dfb54c4e414caa595a1f2ed759b160f5a3ddcba5" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "0.11.1" +version = "1.3.1" [[Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +[[Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + [[ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "6e9c89cba09f6ef134b00e10625590746ba1e036" +git-tree-sha1 = "afadeba63d90ff223a6a48d2009434ecee2ec9e8" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.5.0" +version = "1.7.1" [[PyCall]] deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"] -git-tree-sha1 = "dd1a970b543bd02efce2984582e996af28cab27f" +git-tree-sha1 = "71fd4022ecd0c6d20180e23ff1b3e05a143959c2" uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" -version = "1.92.2" +version = "1.93.0" [[QuadGK]] deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b" +git-tree-sha1 = "78aadffb3efd2155af139781b8a8df1ef279ea39" uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.4.1" +version = "2.4.2" [[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets"] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[Random]] @@ -408,53 +484,59 @@ deps = ["Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[RecipesBase]] -git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae" +git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.1.1" +version = "1.2.1" [[Reexport]] -git-tree-sha1 = "57d8440b0c7d98fc4f889e478e80f268d534c9d5" +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.0.0" +version = "1.2.2" [[Requires]] deps = ["UUIDs"] -git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621" +git-tree-sha1 = "8f82019e525f4d5c669692772a6f4b0a58b06a6a" uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.1.3" +version = "1.2.0" [[Rmath]] deps = ["Random", "Rmath_jll"] -git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370" +git-tree-sha1 = "bf3188feca147ce108c76ad82c2792c57abe7b1f" uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.6.1" +version = "0.7.0" [[Rmath_jll]] -deps = ["Libdl", "Pkg"] -git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "68db32dff12bb6127bac73c209881191bf0efbb7" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.2.2+1" +version = "0.3.0+0" + +[[SCS]] +deps = ["BinaryProvider", "Libdl", "LinearAlgebra", "MathOptInterface", "Requires", "SCS_GPU_jll", "SCS_jll", "SparseArrays"] +git-tree-sha1 = "c819d023621358f3c08f08d41bd9354cf1357d35" +uuid = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13" +version = "0.8.1" + +[[SCS_GPU_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "a96402e3b494a8bbec61b1adb86d4be04112c646" +uuid = "af6e375f-46ec-5fa0-b791-491b0dfa44a4" +version = "2.1.4+0" + +[[SCS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "66c07568ecec96260aaac194ee1e5ee8df62f386" +uuid = "f4f2fc5b-1d94-523c-97ea-2ab488bedf4b" +version = "2.1.4+0" [[SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -[[SIMDPirates]] -deps = ["VectorizationBase"] -git-tree-sha1 = "a1b418634d6478bf2163920eae3b536dcc768626" -uuid = "21efa798-c60a-11e8-04d3-e1a92915a26a" -version = "0.8.26" - -[[SLEEFPirates]] -deps = ["Libdl", "SIMDPirates", "VectorizationBase"] -git-tree-sha1 = "67ae90a18aa8c22bf159318300e765fbd89ddf6e" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.5.5" - [[ScikitLearn]] deps = ["Compat", "Conda", "DataFrames", "Distributed", "IterTools", "LinearAlgebra", "MacroTools", "Parameters", "Printf", "PyCall", "Random", "ScikitLearnBase", "SparseArrays", "StatsBase", "VersionParsing"] -git-tree-sha1 = "bf4c558a0d0f1129b23e80f1ca772a9db457df4d" +git-tree-sha1 = "ccb822ff4222fcf6ff43bbdbd7b80332690f168e" uuid = "3646fa90-6ef7-5e7e-9f22-8aca16db6324" -version = "0.6.3" +version = "0.6.4" [[ScikitLearnBase]] deps = ["LinearAlgebra", "Random", "Statistics"] @@ -473,75 +555,88 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[SortingAlgorithms]] -deps = ["DataStructures", "Random", "Test"] -git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" +deps = ["DataStructures"] +git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "0.3.1" +version = "1.0.1" [[SparseArrays]] deps = ["LinearAlgebra", "Random"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[SpecialFunctions]] -deps = ["ChainRulesCore", "OpenSpecFun_jll"] -git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902" +deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "f0bccf98e16759818ffc5d97ac3ebf87eb950150" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "1.3.0" +version = "1.8.1" [[Static]] deps = ["IfElse"] -git-tree-sha1 = "e59fea643e12d4fa39098c833bd07cd0cd950297" +git-tree-sha1 = "7f5a513baec6f122401abfc8e9c074fdac54f6c1" uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "0.2.3" +version = "0.4.1" [[StaticArrays]] deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "9da72ed50e94dbff92036da395275ed114e04d49" +git-tree-sha1 = "3c76dde64d03699e074ac02eb2e8ba8254d428da" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.0.1" +version = "1.2.13" [[Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +[[StatsAPI]] +git-tree-sha1 = "0f2aa8e32d511f758a2ce49208181f7733a0936a" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.1.0" + [[StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] -git-tree-sha1 = "7bab7d4eb46b225b35179632852b595a3162cb61" +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "2bb0cb32026a66037360606510fca5984ccc6b75" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.33.2" +version = "0.33.13" [[StatsFuns]] -deps = ["Rmath", "SpecialFunctions"] -git-tree-sha1 = "3b9f665c70712af3264b61c27a7e1d62055dafd1" +deps = ["ChainRulesCore", "InverseFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] +git-tree-sha1 = "bedb3e17cc1d94ce0e6e66d3afa47157978ba404" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "0.9.6" - -[[StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "d7f4287dbc1e590265f50ceda1b40ed2bb31bbbb" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.4.0" +version = "0.9.14" [[SuiteSparse]] deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" +[[TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" + [[TableTraits]] deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.0" +version = "1.0.1" [[Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] -git-tree-sha1 = "a716dde43d57fa537a19058d044b495301ba6565" +git-tree-sha1 = "bb1064c9a84c52e277f1096cf41434b675cd368b" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.3.2" +version = "1.6.1" + +[[Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +[[TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.6" + [[UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" @@ -554,25 +649,19 @@ version = "1.0.2" [[Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" -[[VectorizationBase]] -deps = ["CpuId", "Libdl", "LinearAlgebra"] -git-tree-sha1 = "03e2fbb479a1ea350398195b6fbf439bae0f8260" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.12.33" - [[VersionParsing]] -git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f" +git-tree-sha1 = "e575cf85535c7c3292b4d89d89cc29e8c3098e47" uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" -version = "1.2.0" +version = "1.2.1" + +[[Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" + +[[nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -[[Zygote]] -deps = ["AbstractFFTs", "ArrayLayouts", "ChainRules", "DiffRules", "Distributed", "FillArrays", "ForwardDiff", "IRTools", "InteractiveUtils", "LinearAlgebra", "LoopVectorization", "MacroTools", "NNlib", "NaNMath", "Random", "Requires", "SpecialFunctions", "Statistics", "ZygoteRules"] -git-tree-sha1 = "18f758f28ca2c236e449be64e366e201965129a7" -uuid = "e88e6eb3-aa80-5325-afca-941959d7151f" -version = "0.5.17" - -[[ZygoteRules]] -deps = ["MacroTools"] -git-tree-sha1 = "9e7a1e8ca60b742e508a315c17eef5211e7fbfd7" -uuid = "700de1a5-db45-46bc-99cf-38207098b444" -version = "0.2.1" +[[p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" diff --git a/docs/make.jl b/docs/make.jl index e5806af48..c90af5b4c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,9 +7,12 @@ using Documenter #---------- api = ["CalibrateEmulateSample" => [ - "GPEmulator" => "API/GaussianProcessEmulator.md", - "MarkovChainMonteCarlo" => "API/MarkovChainMonteCarlo.md", - "Utilities" => "API/Utilities.md" + "Emulators" => [ + "General Emulator" => "API/Emulators.md", + "Gaussian Process" => "API/GaussianProcess.md", + ], + "MarkovChainMonteCarlo" => "API/MarkovChainMonteCarlo.md", + "Utilities" => "API/Utilities.md" ], ] diff --git a/docs/src/API/Emulators.md b/docs/src/API/Emulators.md new file mode 100644 index 000000000..f4c97aa11 --- /dev/null +++ b/docs/src/API/Emulators.md @@ -0,0 +1,17 @@ +# Emulators + +```@meta +CurrentModule = CalibrateEmulateSample.Emulators +``` + +```@docs +Decomposition +Emulator +optimize_hyperparameters!(::Emulator) +predict +normalize +standardize +reverse_standardize +svd_transform +svd_reverse_transform_mean_cov +``` \ No newline at end of file diff --git a/docs/src/API/GaussianProcess.md b/docs/src/API/GaussianProcess.md new file mode 100644 index 000000000..79be9e7c0 --- /dev/null +++ b/docs/src/API/GaussianProcess.md @@ -0,0 +1,13 @@ +# GaussianProcess + +```@meta +CurrentModule = CalibrateEmulateSample.Emulators +``` + +```@docs +GaussianProcessesPackage +PredictionType +GaussianProcess +build_models! +optimize_hyperparameters!(::GaussianProcess{GPJL}) +``` \ No newline at end of file diff --git a/docs/src/API/GaussianProcessEmulator.md b/docs/src/API/GaussianProcessEmulator.md deleted file mode 100644 index a97b37f83..000000000 --- a/docs/src/API/GaussianProcessEmulator.md +++ /dev/null @@ -1,14 +0,0 @@ -# GaussianProcessEmulator - -```@meta -CurrentModule = CalibrateEmulateSample.GaussianProcessEmulator -``` - -```@docs -GaussianProcessesPackage -PredictionType -GaussianProcess -predict -svd_transform -svd_reverse_transform_mean_cov -``` \ No newline at end of file diff --git a/examples/Emulator/GaussianProcess/Manifest.toml b/examples/Emulator/GaussianProcess/Manifest.toml new file mode 100644 index 000000000..941b6abe4 --- /dev/null +++ b/examples/Emulator/GaussianProcess/Manifest.toml @@ -0,0 +1,1149 @@ +# This file is machine-generated - editing it directly is not advised + +[[Adapt]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "84918055d15b3114ede17ac6a7182f68870c16f7" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "3.3.1" + +[[ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" + +[[ArrayInterface]] +deps = ["Compat", "IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"] +git-tree-sha1 = "e527b258413e0c6d4f66ade574744c94edef81f8" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "3.1.40" + +[[Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+0" + +[[Cairo_jll]] +deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "f2202b55d816427cd385a9a4f3ffb226bee80f99" +uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" +version = "1.16.1+0" + +[[CalibrateEmulateSample]] +deps = ["Conda", "Distributions", "DocStringExtensions", "EnsembleKalmanProcesses", "GaussianProcesses", "JLD2", "LinearAlgebra", "PyCall", "Random", "ScikitLearn", "Statistics", "StatsBase"] +path = "/home/odunbar/Dropbox/Caltech/CESjl/CalibrateEmulateSample.jl/" +uuid = "95e48a1f-0bec-4818-9538-3db4340308e3" +version = "0.1.0" + +[[ChainRulesCore]] +deps = ["Compat", "LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "f885e7e7c124f8c92650d61b9477b9ac2ee607dd" +uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +version = "1.11.1" + +[[ChangesOfVariables]] +deps = ["LinearAlgebra", "Test"] +git-tree-sha1 = "9a1d594397670492219635b35a3d830b04730d62" +uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" +version = "0.1.1" + +[[CodeTracking]] +deps = ["InteractiveUtils", "UUIDs"] +git-tree-sha1 = "9aa8a5ebb6b5bf469a7e0e2b5202cf6f8c291104" +uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" +version = "1.0.6" + +[[ColorSchemes]] +deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random"] +git-tree-sha1 = "a851fec56cb73cfdf43762999ec72eff5b86882a" +uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" +version = "3.15.0" + +[[ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "024fe24d83e4a5bf5fc80501a314ce0d1aa35597" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.11.0" + +[[Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] +git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.8" + +[[CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + +[[Compat]] +deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] +git-tree-sha1 = "dce3e3fea680869eaa0b774b2e8343e9ff442313" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "3.40.0" + +[[CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" + +[[Conda]] +deps = ["JSON", "VersionParsing"] +git-tree-sha1 = "299304989a5e6473d985212c28928899c74e9421" +uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" +version = "1.5.2" + +[[Contour]] +deps = ["StaticArrays"] +git-tree-sha1 = "9f02045d934dc030edad45944ea80dbd1f0ebea7" +uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" +version = "0.5.7" + +[[Crayons]] +git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.0.4" + +[[DataAPI]] +git-tree-sha1 = "cc70b17275652eb47bc9e5f81635981f13cea5c8" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.9.0" + +[[DataFrames]] +deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "d785f42445b63fc86caa08bb9a9351008be9b765" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "1.2.2" + +[[DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "7d9d316f04214f7efdbb6398d545446e246eff02" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.10" + +[[DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[DiffResults]] +deps = ["StaticArrays"] +git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.0.3" + +[[DiffRules]] +deps = ["LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "d8f468c5cd4d94e86816603f7d18ece910b4aaf1" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.5.0" + +[[Distances]] +deps = ["LinearAlgebra", "Statistics", "StatsAPI"] +git-tree-sha1 = "837c83e5574582e07662bbbba733964ff7c26b9d" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.6" + +[[Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[Distributions]] +deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"] +git-tree-sha1 = "a837fdf80f333415b69684ba8e8ae6ba76de6aaa" +uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" +version = "0.24.18" + +[[DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.8.6" + +[[Downloads]] +deps = ["ArgTools", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" + +[[EarCut_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "3f3a2501fa7236e9b911e0f7a588c657e822bb6d" +uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" +version = "2.2.3+0" + +[[ElasticArrays]] +deps = ["Adapt"] +git-tree-sha1 = "a0fcc1bb3c9ceaf07e1d0529c9806ce94be6adf9" +uuid = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4" +version = "1.2.9" + +[[ElasticPDMats]] +deps = ["LinearAlgebra", "MacroTools", "PDMats"] +git-tree-sha1 = "5157c93fe9431a041e4cd84265dfce3d53a52323" +uuid = "2904ab23-551e-5aed-883f-487f97af5226" +version = "0.2.2" + +[[EnsembleKalmanProcesses]] +deps = ["Distributions", "DocStringExtensions", "LinearAlgebra", "Random", "Statistics", "StatsBase"] +git-tree-sha1 = "6e6cff0111d9849c2a2ce253325478a2903b16d0" +uuid = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" +version = "0.1.1" + +[[Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "b3bfd02e98aedfa5cf885665493c5598c350cd2f" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.2.10+0" + +[[FFMPEG]] +deps = ["FFMPEG_jll"] +git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8" +uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" +version = "0.4.1" + +[[FFMPEG_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "d8a578692e3077ac998b50c0217dfd67f21d1e5f" +uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" +version = "4.4.0+0" + +[[FastGaussQuadrature]] +deps = ["LinearAlgebra", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "5ccd8547615457402a499af9603d55876423eea8" +uuid = "442a2c76-b920-505d-bb47-c5924d526838" +version = "0.4.8" + +[[FileIO]] +deps = ["Pkg", "Requires", "UUIDs"] +git-tree-sha1 = "2db648b6712831ecb333eae76dbfd1c156ca13bb" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.11.2" + +[[FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[FillArrays]] +deps = ["LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "693210145367e7685d8604aee33d9bfb85db8b31" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "0.11.9" + +[[FiniteDiff]] +deps = ["ArrayInterface", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays"] +git-tree-sha1 = "8b3c09b56acaf3c0e581c66638b85c8650ee9dca" +uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" +version = "2.8.1" + +[[FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.4" + +[[Fontconfig_jll]] +deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "21efd19106a55620a188615da6d3d06cd7f6ee03" +uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" +version = "2.13.93+0" + +[[Formatting]] +deps = ["Printf"] +git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.2" + +[[ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "6406b5112809c08b1baa5703ad274e1dded0652f" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.23" + +[[FreeType2_jll]] +deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "87eb71354d8ec1a96d4a7636bd57a7347dde3ef9" +uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" +version = "2.10.4+0" + +[[FriBidi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91" +uuid = "559328eb-81f9-559d-9380-de523a88c83c" +version = "1.0.10+0" + +[[Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[GLFW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] +git-tree-sha1 = "0c603255764a1fa0b61752d2bec14cfbd18f7fe8" +uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" +version = "3.3.5+1" + +[[GR]] +deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "30f2b340c2fff8410d89bfcdc9c0a6dd661ac5f7" +uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" +version = "0.62.1" + +[[GR_jll]] +deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt5Base_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "fd75fa3a2080109a2c0ec9864a6e14c60cca3866" +uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" +version = "0.62.0+0" + +[[GaussianProcesses]] +deps = ["Distances", "Distributions", "ElasticArrays", "ElasticPDMats", "FastGaussQuadrature", "ForwardDiff", "LinearAlgebra", "Optim", "PDMats", "Printf", "ProgressMeter", "Random", "RecipesBase", "ScikitLearnBase", "SpecialFunctions", "StaticArrays", "Statistics", "StatsFuns"] +git-tree-sha1 = "9cf8ba8037e332b1be14c71e549143e68c42a22d" +uuid = "891a1506-143c-57d2-908e-e1f8e92e6de9" +version = "0.12.4" + +[[GeometryBasics]] +deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] +git-tree-sha1 = "58bcdf5ebc057b085e58d95c138725628dd7453c" +uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" +version = "0.4.1" + +[[Gettext_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046" +uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" +version = "0.21.0+0" + +[[Glib_jll]] +deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "7bf67e9a481712b3dbe9cb3dac852dc4b1162e02" +uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" +version = "2.68.3+0" + +[[Graphite2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011" +uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" +version = "1.3.14+0" + +[[Grisu]] +git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" +uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" +version = "1.0.2" + +[[HTTP]] +deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] +git-tree-sha1 = "0fa77022fe4b511826b39c894c90daf5fce3334a" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.9.17" + +[[HarfBuzz_jll]] +deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] +git-tree-sha1 = "8a954fed8ac097d5be04921d595f741115c1b2ad" +uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566" +version = "2.8.1+0" + +[[IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "a7254c0acd8e62f1ac75ad24d5db43f5f19f3c65" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.2" + +[[InvertedIndices]] +git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.1.0" + +[[IrrationalConstants]] +git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.1.1" + +[[IterTools]] +git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.3.0" + +[[IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[JLD2]] +deps = ["DataStructures", "FileIO", "MacroTools", "Mmap", "Pkg", "Printf", "Reexport", "TranscodingStreams", "UUIDs"] +git-tree-sha1 = "46b7834ec8165c541b0b5d1c8ba63ec940723ffb" +uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +version = "0.4.15" + +[[JLLWrappers]] +deps = ["Preferences"] +git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.3.0" + +[[JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.2" + +[[JpegTurbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "d735490ac75c5cb9f1b00d8b5509c11984dc6943" +uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" +version = "2.1.0+0" + +[[JuliaInterpreter]] +deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] +git-tree-sha1 = "e273807f38074f033d94207a201e6e827d8417db" +uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" +version = "0.8.21" + +[[LAME_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c" +uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" +version = "3.100.1+0" + +[[LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.1+0" + +[[LaTeXStrings]] +git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.3.0" + +[[Latexify]] +deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] +git-tree-sha1 = "a8f4f279b6fa3c3c4f1adadd78a621b13a506bce" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.15.9" + +[[LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" + +[[LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" + +[[LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Libffi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0b4a5d71f3e5200a7dff793393e09dfc2d874290" +uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" +version = "3.2.2+1" + +[[Libgcrypt_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] +git-tree-sha1 = "64613c82a59c120435c067c2b809fc61cf5166ae" +uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" +version = "1.8.7+0" + +[[Libglvnd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] +git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf" +uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" +version = "1.3.0+3" + +[[Libgpg_error_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c333716e46366857753e273ce6a69ee0945a6db9" +uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" +version = "1.42.0+0" + +[[Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "42b62845d70a619f063a7da093d995ec8e15e778" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.16.1+1" + +[[Libmount_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9c30530bf0effd46e15e0fdcf2b8636e78cbbd73" +uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" +version = "2.35.0+0" + +[[Libtiff_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "340e257aada13f95f98ee352d316c3bed37c8ab9" +uuid = "89763e89-9b03-5906-acba-b20f662cd828" +version = "4.3.0+0" + +[[Libuuid_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "7f3efec06033682db852f8b3bc3c1d2b0a0ab066" +uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" +version = "2.36.0+0" + +[[LineSearches]] +deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] +git-tree-sha1 = "f27132e551e959b3667d8c93eae90973225032dd" +uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" +version = "7.1.1" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[LogExpFunctions]] +deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "be9eef9f9d78cecb6f262f3c10da151a6c5ab827" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.5" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[LoweredCodeUtils]] +deps = ["JuliaInterpreter"] +git-tree-sha1 = "491a883c4fef1103077a7f648961adbf9c8dd933" +uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" +version = "2.1.2" + +[[MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.9" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] +git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.0.3" + +[[MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" + +[[Measures]] +git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f" +uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" +version = "0.3.1" + +[[Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "1.0.2" + +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" + +[[NLSolversBase]] +deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] +git-tree-sha1 = "50310f934e55e5ca3912fb941dec199b49ca9b68" +uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" +version = "7.8.2" + +[[NaNMath]] +git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "0.3.5" + +[[NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" + +[[Ogg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "7937eda4681660b4d6aeeecc2f7e1c81c8ee4e2f" +uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" +version = "1.3.5+0" + +[[OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" + +[[OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "15003dcb7d8db3c6c857fda14891a539a8f2705a" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.10+0" + +[[OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[Optim]] +deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] +git-tree-sha1 = "35d435b512fbab1d1a29138b5229279925eba369" +uuid = "429524aa-4258-5aef-a3af-852621145aeb" +version = "1.5.0" + +[[Opus_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720" +uuid = "91d4177d-7536-5919-b921-800302f37372" +version = "1.3.2+0" + +[[OrderedCollections]] +git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.4.1" + +[[PCRE_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "b2a7af664e098055a7529ad1a900ded962bca488" +uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc" +version = "8.44.0+0" + +[[PDMats]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] +git-tree-sha1 = "95a4038d1011dfdbde7cecd2ad0ac411e53ab1bc" +uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" +version = "0.10.1" + +[[Parameters]] +deps = ["OrderedCollections", "UnPack"] +git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.12.3" + +[[Parsers]] +deps = ["Dates"] +git-tree-sha1 = "ae4bbcadb2906ccc085cf52ac286dc1377dceccc" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.1.2" + +[[Pixman_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "b4f5d02549a10e20780a24fce72bea96b6329e29" +uuid = "30392449-352a-5448-841d-b1acce4e97dc" +version = "0.40.1+0" + +[[Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[PlotThemes]] +deps = ["PlotUtils", "Requires", "Statistics"] +git-tree-sha1 = "a3a964ce9dc7898193536002a6dd892b1b5a6f1d" +uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" +version = "2.0.1" + +[[PlotUtils]] +deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"] +git-tree-sha1 = "b084324b4af5a438cd63619fd006614b3b20b87b" +uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" +version = "1.0.15" + +[[Plots]] +deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun"] +git-tree-sha1 = "0d185e8c33401084cab546a756b387b15f76720c" +uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +version = "1.23.6" + +[[PooledArrays]] +deps = ["DataAPI", "Future"] +git-tree-sha1 = "db3a23166af8aebf4db5ef87ac5b00d36eb771e2" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "1.4.0" + +[[PositiveFactorizations]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" +uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" +version = "0.2.4" + +[[Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.2.2" + +[[PrettyTables]] +deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"] +git-tree-sha1 = "d940010be611ee9d67064fe559edbb305f8cc0eb" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "1.2.3" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[ProgressMeter]] +deps = ["Distributed", "Printf"] +git-tree-sha1 = "afadeba63d90ff223a6a48d2009434ecee2ec9e8" +uuid = "92933f4c-e287-5a05-a399-4b506db050ca" +version = "1.7.1" + +[[PyCall]] +deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"] +git-tree-sha1 = "4ba3651d33ef76e24fef6a598b63ffd1c5e1cd17" +uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" +version = "1.92.5" + +[[PyPlot]] +deps = ["Colors", "LaTeXStrings", "PyCall", "Sockets", "Test", "VersionParsing"] +git-tree-sha1 = "14c1b795b9d764e1784713941e787e1384268103" +uuid = "d330b81b-6aea-500a-939a-2ce795aea3ee" +version = "2.10.0" + +[[Qt5Base_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] +git-tree-sha1 = "ad368663a5e20dbb8d6dc2fddeefe4dae0781ae8" +uuid = "ea2cea3b-5b76-57ae-a6ef-0a8af62496e1" +version = "5.15.3+0" + +[[QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "78aadffb3efd2155af139781b8a8df1ef279ea39" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.4.2" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[RecipesBase]] +git-tree-sha1 = "a4425fe1cde746e278fa895cc69e3113cb2614f6" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.2.0" + +[[RecipesPipeline]] +deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"] +git-tree-sha1 = "7ad0dfa8d03b7bcf8c597f59f5292801730c55b8" +uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" +version = "0.4.1" + +[[Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.1.3" + +[[Revise]] +deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"] +git-tree-sha1 = "41deb3df28ecf75307b6e492a738821b031f8425" +uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" +version = "3.1.20" + +[[Rmath]] +deps = ["Random", "Rmath_jll"] +git-tree-sha1 = "bf3188feca147ce108c76ad82c2792c57abe7b1f" +uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" +version = "0.7.0" + +[[Rmath_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "68db32dff12bb6127bac73c209881191bf0efbb7" +uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" +version = "0.3.0+0" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[ScikitLearn]] +deps = ["Compat", "Conda", "DataFrames", "Distributed", "IterTools", "LinearAlgebra", "MacroTools", "Parameters", "Printf", "PyCall", "Random", "ScikitLearnBase", "SparseArrays", "StatsBase", "VersionParsing"] +git-tree-sha1 = "ccb822ff4222fcf6ff43bbdbd7b80332690f168e" +uuid = "3646fa90-6ef7-5e7e-9f22-8aca16db6324" +version = "0.6.4" + +[[ScikitLearnBase]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "7877e55c1523a4b336b433da39c8e8c08d2f221f" +uuid = "6e75b9c4-186b-50bd-896f-2d2496a4843e" +version = "0.5.0" + +[[Scratch]] +deps = ["Dates"] +git-tree-sha1 = "0b4b7f1393cff97c33891da2a0bf69c6ed241fda" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.1.0" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[Showoff]] +deps = ["Dates", "Grisu"] +git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de" +uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" +version = "1.0.3" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[SortingAlgorithms]] +deps = ["DataStructures"] +git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "1.0.1" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[SpecialFunctions]] +deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "f0bccf98e16759818ffc5d97ac3ebf87eb950150" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "1.8.1" + +[[Static]] +deps = ["IfElse"] +git-tree-sha1 = "e7bc80dc93f50857a5d1e3c8121495852f407e6a" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "0.4.0" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "3c76dde64d03699e074ac02eb2e8ba8254d428da" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.2.13" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[StatsAPI]] +git-tree-sha1 = "0f2aa8e32d511f758a2ce49208181f7733a0936a" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.1.0" + +[[StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "2bb0cb32026a66037360606510fca5984ccc6b75" +uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +version = "0.33.13" + +[[StatsFuns]] +deps = ["ChainRulesCore", "InverseFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] +git-tree-sha1 = "bedb3e17cc1d94ce0e6e66d3afa47157978ba404" +uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" +version = "0.9.14" + +[[StructArrays]] +deps = ["Adapt", "DataAPI", "StaticArrays", "Tables"] +git-tree-sha1 = "2ce41e0d042c60ecd131e9fb7154a3bfadbf50d3" +uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" +version = "0.6.3" + +[[SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" + +[[TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] +git-tree-sha1 = "fed34d0e71b91734bf0a7e10eb1bb05296ddbcd0" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.6.0" + +[[Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" + +[[Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.6" + +[[URIs]] +git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.3.0" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[UnicodeFun]] +deps = ["REPL"] +git-tree-sha1 = "53915e50200959667e78a92a418594b428dffddf" +uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1" +version = "0.4.1" + +[[VersionParsing]] +git-tree-sha1 = "e575cf85535c7c3292b4d89d89cc29e8c3098e47" +uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" +version = "1.2.1" + +[[Wayland_jll]] +deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "3e61f0b86f90dacb0bc0e73a0c5a83f6a8636e23" +uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" +version = "1.19.0+0" + +[[Wayland_protocols_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "66d72dc6fcc86352f01676e8f0f698562e60510f" +uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" +version = "1.23.0+0" + +[[XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "1acf5bdf07aa0907e0a37d3718bb88d4b687b74a" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.9.12+0" + +[[XSLT_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] +git-tree-sha1 = "91844873c4085240b95e795f692c4cec4d805f8a" +uuid = "aed1982a-8fda-507f-9586-7b0439959a61" +version = "1.1.34+0" + +[[Xorg_libX11_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] +git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" +uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" +version = "1.6.9+4" + +[[Xorg_libXau_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" +uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" +version = "1.0.9+4" + +[[Xorg_libXcursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" +uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" +version = "1.2.0+4" + +[[Xorg_libXdmcp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" +uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" +version = "1.1.3+4" + +[[Xorg_libXext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" +uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" +version = "1.3.4+4" + +[[Xorg_libXfixes_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" +uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" +version = "5.0.3+4" + +[[Xorg_libXi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] +git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" +uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" +version = "1.7.10+4" + +[[Xorg_libXinerama_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] +git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" +uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" +version = "1.1.4+4" + +[[Xorg_libXrandr_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" +uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" +version = "1.5.2+4" + +[[Xorg_libXrender_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" +uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" +version = "0.9.10+4" + +[[Xorg_libpthread_stubs_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" +uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" +version = "0.1.0+3" + +[[Xorg_libxcb_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] +git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" +uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" +version = "1.13.0+3" + +[[Xorg_libxkbfile_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2" +uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" +version = "1.1.0+4" + +[[Xorg_xcb_util_image_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "0fab0a40349ba1cba2c1da699243396ff8e94b97" +uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" +version = "0.4.0+1" + +[[Xorg_xcb_util_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] +git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" +uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" +version = "0.4.0+1" + +[[Xorg_xcb_util_keysyms_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" +uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" +version = "0.4.0+1" + +[[Xorg_xcb_util_renderutil_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" +uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" +version = "0.3.9+1" + +[[Xorg_xcb_util_wm_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" +uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" +version = "0.4.1+1" + +[[Xorg_xkbcomp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"] +git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b" +uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" +version = "1.4.2+4" + +[[Xorg_xkeyboard_config_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"] +git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d" +uuid = "33bec58e-1273-512f-9401-5d533626f822" +version = "2.27.0+4" + +[[Xorg_xtrans_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" +uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" +version = "1.4.0+3" + +[[Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" + +[[Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "cc4bf3fdde8b7e3e9fa0351bdeedba1cf3b7f6e6" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.0+0" + +[[libass_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "5982a94fcba20f02f42ace44b9894ee2b140fe47" +uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" +version = "0.15.1+0" + +[[libfdk_aac_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "daacc84a041563f965be61859a36e17c4e4fcd55" +uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" +version = "2.0.2+0" + +[[libpng_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c" +uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" +version = "1.6.38+0" + +[[libvorbis_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] +git-tree-sha1 = "c45f4e40e7aafe9d086379e5578947ec8b95a8fb" +uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" +version = "1.3.7+0" + +[[nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" + +[[p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" + +[[x264_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4fea590b89e6ec504593146bf8b988b2c00922b2" +uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" +version = "2021.5.5+0" + +[[x265_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ee567a171cce03570d77ad3a43e90218e38937a9" +uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" +version = "3.5.0+0" + +[[xkbcommon_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] +git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6" +uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" +version = "0.9.1+5" diff --git a/examples/GaussianProcessEmulator/Project.toml b/examples/Emulator/GaussianProcess/Project.toml similarity index 76% rename from examples/GaussianProcessEmulator/Project.toml rename to examples/Emulator/GaussianProcess/Project.toml index 00a75c4d8..4bb6a44ed 100644 --- a/examples/GaussianProcessEmulator/Project.toml +++ b/examples/Emulator/GaussianProcess/Project.toml @@ -1,8 +1,10 @@ [deps] +CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3" Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" diff --git a/examples/GaussianProcessEmulator/plot_GP.jl b/examples/Emulator/GaussianProcess/plot_GP.jl similarity index 65% rename from examples/GaussianProcessEmulator/plot_GP.jl rename to examples/Emulator/GaussianProcess/plot_GP.jl index 9955e3346..b9eafb466 100644 --- a/examples/GaussianProcessEmulator/plot_GP.jl +++ b/examples/Emulator/GaussianProcess/plot_GP.jl @@ -7,11 +7,19 @@ using Random using Distributions using Statistics using LinearAlgebra -using CalibrateEmulateSample.GaussianProcessEmulator +using CalibrateEmulateSample.Emulators using CalibrateEmulateSample.DataStorage -using Plots; pyplot(size=(1500, 700)) -Plots.scalefontsizes(1.3) +plot_flag = true +if plot_flag + using Plots + gr(size=(1500, 700)) + Plots.scalefontsizes(1.3) + font = Plots.font("Helvetica", 18) + fontdict = Dict(:guidefont=>font, :xtickfont=>font, :ytickfont=>font, + :legendfont=>font) + +end ############################################################################### # # @@ -61,8 +69,10 @@ if !isdir(output_directory) mkdir(output_directory) end +#create the machine learning tools: Gaussian Process gppackage = GPJL() pred_type = YType() +gaussian_process = GaussianProcess(gppackage,noise_learn=true) # Generate training data (x-y pairs, where x ∈ ℝ ᵖ, y ∈ ℝ ᵈ) # x = [x1, x2]: inputs/predictors/features/parameters @@ -70,7 +80,7 @@ pred_type = YType() # The observables y are related to the parameters x by: # y = G(x1, x2) + η, # where G(x1, x2) := [sin(x1) + cos(x2), sin(x1) - cos(x2)], and η ~ N(0, Σ) -n = 50 # number of training points +n = 100 # number of training points p = 2 # input dim d = 2 # output dim @@ -81,7 +91,7 @@ g2x = sin.(X[1, :]) .- cos.(X[2, :]) gx = zeros(2,n) gx[1,:] = g1x gx[2,:] = g2x - + # Add noise η μ = zeros(d) Σ = 0.1 * [[0.8, 0.0] [0.0, 0.5]] # d x d @@ -89,70 +99,80 @@ noise_samples = rand(MvNormal(μ, Σ), n) # y = G(x) + η Y = gx .+ noise_samples + #plot training data with and without noise -p1 = plot(X[1,:], X[2,:], g1x, st=:surface, camera=(-30, 30), c=:cividis, +if plot_flag + p1 = plot(X[1,:], X[2,:], g1x, st=:surface, camera=(30, 60), c=:cividis, xlabel="x1", ylabel="x2", zguidefontrotation=90) -figpath = joinpath(output_directory, "GP_test_observed_y1nonoise.png") -savefig(figpath) -linkfig(figpath) - -p2 = plot(X[1,:], X[2,:], g2x, st=:surface, camera=(-30, 30), c=:cividis, + + figpath = joinpath(output_directory, "GP_test_observed_y1nonoise.png") + savefig(figpath) + + p2 = plot(X[1,:], X[2,:], g2x, st=:surface, camera=(30, 60), c=:cividis, xlabel="x1", ylabel="x2", zguidefontrotation=90) -figpath = joinpath(output_directory, "GP_test_observed_y2nonoise.png") -savefig(figpath) -linkfig(figpath) - -p1 = plot(X[1,:], X[2,:], Y[1,:], st=:surface, camera=(-30, 30), c=:cividis, + figpath = joinpath(output_directory, "GP_test_observed_y2nonoise.png") + savefig(figpath) + + p1 = plot(X[1,:], X[2,:], Y[1,:], st=:surface, camera=(30, 60), c=:cividis, xlabel="x1", ylabel="x2", zguidefontrotation=90) -figpath = joinpath(output_directory, "GP_test_observed_y1.png") -savefig(figpath) -linkfig(figpath) - -p2 = plot(X[1,:], X[2,:], Y[2,:], st=:surface, camera=(-30, 30), c=:cividis, + figpath = joinpath(output_directory, "GP_test_observed_y1.png") + savefig(figpath) + + p2 = plot(X[1,:], X[2,:], Y[2,:], st=:surface, camera=(30, 60), c=:cividis, xlabel="x1", ylabel="x2", zguidefontrotation=90) -figpath = joinpath(output_directory, "GP_test_observed_y2.png") -savefig(figpath) -linkfig(figpath) + figpath = joinpath(output_directory, "GP_test_observed_y2.png") + savefig(figpath) + +end iopairs = PairedDataContainer(X,Y,data_are_columns=true) @assert get_inputs(iopairs) == X @assert get_outputs(iopairs) == Y -# Fit 2D Gaussian Process regression model +# Create the emulator class, and build the 2D Gaussian Process regression model # (To be precise: We fit two models, one that predicts y1 from x1 and x2, # and one that predicts y2 from x1 and x2) # Setting GPkernel=nothing leads to the creation of a default squared # exponential kernel. # Setting noise_learn=true leads to the addition of white noise to the # kernel -gpobj = GaussianProcess(iopairs, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=true, prediction_type=pred_type) +emulator = Emulator( + gaussian_process, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=false) +println("build GP with ", n, " training points") + +#optimize the hyperparameters to best fit the GP. +optimize_hyperparameters!(emulator) +println("GP trained") + +#gpobj = GaussianProcess(iopairs, gppackage, GPkernel=nothing, obs_noise_cov=Σ, +# normalized=true, noise_learn=true, prediction_type=pred_type) # Plot mean and variance of the predicted observables y1 and y2 # For this, we generate test points on a x1-x2 grid. -n_pts = 100 +n_pts = 50 x1 = range(0.0, stop=2*π, length=n_pts) x2 = range(0.0, stop=2*π, length=n_pts) X1, X2 = meshgrid(x1, x2) # Input for predict has to be of size N_samples x input_dim inputs = permutedims(hcat(X1[:], X2[:]),(2,1)) -font = Plots.font("Helvetica", 18) -fontdict = Dict(:guidefont=>font, :xtickfont=>font, :ytickfont=>font, - :legendfont=>font) +#gp_mean, gp_cov = GaussianProcessEmulator.predict(gpobj, +# inputs, +# transform_to_real=true) # Predict on the grid points (note that `predict` returns the full # covariance matrices, not just the variance -- gp_cov is a vector # of covariance matrices) -gp_mean, gp_cov = GaussianProcessEmulator.predict(gpobj, - inputs, - transform_to_real=true) + +gp_mean, gp_cov = predict(emulator, inputs, transform_to_real=true) println("end predictions at ", n_pts*n_pts, " points") -println("start plotting...") #plot predictions for y_i in 1:d @@ -161,42 +181,44 @@ for y_i in 1:d gp_var = permutedims(vcat([x' for x in gp_var_temp]...),(2,1)) # 2 x 40000 mean_grid = reshape(gp_mean[y_i, :], n_pts, n_pts) # 2 x 40000 - p1 = plot(x1, x2, mean_grid, st=:surface, camera=(-30, 30), c=:cividis, - xlabel="x1", ylabel="x2", zlabel="mean of y"*string(y_i), - zguidefontrotation=90) - + if plot_flag + p1 = plot(x1, x2, mean_grid, st=:surface, camera=(30, 60), c=:cividis, + xlabel="x1", ylabel="x2", zlabel="mean of y"*string(y_i), + zguidefontrotation=90) + end var_grid = reshape(gp_var[y_i, :], n_pts, n_pts) - p2 = plot(x1, x2, var_grid, st=:surface, camera=(-30, 30), c=:cividis, - xlabel="x1", ylabel="x2", zlabel="var of y"*string(y_i), - zguidefontrotation=90) + if plot_flag + p2 = plot(x1, x2, var_grid, st=:surface, camera=(30, 60), c=:cividis, + xlabel="x1", ylabel="x2", zlabel="var of y"*string(y_i), + zguidefontrotation=90) - plot(p1, p2, layout=(1, 2), legend=false) + plot(p1, p2, layout=(1, 2), legend=false) - figpath = joinpath(output_directory, "GP_test_y"*string(y_i)*"_predictions.png") - savefig(figpath) - linkfig(figpath) + savefig(joinpath(output_directory, "GP_test_y"*string(y_i)*"_predictions.png")) + end end # Plot the true components of G(x1, x2) g1_true = sin.(inputs[1,:]) .+ cos.(inputs[2, :]) g1_true_grid = reshape(g1_true, n_pts, n_pts) -p3 = plot(x1, x2, g1_true_grid, st=:surface, camera=(-30, 30), c=:cividis, - xlabel="x1", ylabel="x2", zlabel="sin(x1) + cos(x2)", - zguidefontrotation=90) -figpath = joinpath(output_directory, "GP_test_true_g1.png") -savefig(figpath) -linkfig(figpath) +if plot_flag + p3 = plot(x1, x2, g1_true_grid, st=:surface, camera=(30, 60), c=:cividis, + xlabel="x1", ylabel="x2", zlabel="sin(x1) + cos(x2)", + zguidefontrotation=90) + savefig(joinpath(output_directory, "GP_test_true_g1.png")) +end g2_true = sin.(inputs[1, :]) .- cos.(inputs[2, :]) g2_true_grid = reshape(g2_true, n_pts, n_pts) -p4 = plot(x1, x2, g2_true_grid, st=:surface, camera=(-30, 30), c=:cividis, - xlabel="x1", ylabel="x2", zlabel="sin(x1) - cos(x2)", - zguidefontrotation=90) -g_true_grids = [g1_true_grid, g2_true_grid] -figpath = joinpath(output_directory, "GP_test_true_g2.png") -savefig(figpath) -linkfig(figpath) +if plot_flag + p4 = plot(x1, x2, g2_true_grid, st=:surface, camera=(30, 60), c=:cividis, + xlabel="x1", ylabel="x2", zlabel="sin(x1) - cos(x2)", + zguidefontrotation=90) + g_true_grids = [g1_true_grid, g2_true_grid] + + savefig(joinpath(output_directory, "GP_test_true_g2.png")) +end # Plot the difference between the truth and the mean of the predictions for y_i in 1:d @@ -208,15 +230,17 @@ for y_i in 1:d mean_grid = reshape(gp_mean[y_i,:], n_pts, n_pts) var_grid = reshape(gp_var[y_i, :], n_pts, n_pts) # Compute and plot 1/variance * (truth - prediction)^2 - zlabel = "1/var * (true_y"*string(y_i)*" - predicted_y"*string(y_i)*")^2" - p5 = plot(x1, x2, 1.0 ./ var_grid .* (g_true_grids[y_i] .- mean_grid).^2, - st=:surface, camera=(-30, 30), c=:magma, zlabel=zlabel, - xlabel="x1", ylabel="x2", - zguidefontrotation=90) - figpath = joinpath(output_directory, "GP_test_y"*string(y_i)*"_difference_truth_prediction.png") - savefig(figpath) - linkfig(figpath) + if plot_flag + zlabel = "1/var * (true_y"*string(y_i)*" - predicted_y"*string(y_i)*")^2" + + p5 = plot(x1, x2, sqrt.(1.0 ./ var_grid .* (g_true_grids[y_i] .- mean_grid).^2), + st=:surface, camera=(30, 60), c=:magma, zlabel=zlabel, + xlabel="x1", ylabel="x2", + zguidefontrotation=90) + + savefig(joinpath(output_directory, "GP_test_y"*string(y_i)*"_difference_truth_prediction.png")) + end end -Plots.scalefontsizes(1/1.3) +#Plots.scalefontsizes(1/1.3) diff --git a/examples/GaussianProcessEmulator/Manifest.toml b/examples/GaussianProcessEmulator/Manifest.toml deleted file mode 100644 index 126c9113f..000000000 --- a/examples/GaussianProcessEmulator/Manifest.toml +++ /dev/null @@ -1,836 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -[[Adapt]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "ffcfa2d345aaee0ef3d8346a073d5dd03c983ebe" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.2.0" - -[[Artifacts]] -deps = ["Pkg"] -git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744" -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -version = "1.3.0" - -[[Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.6+5" - -[[Cairo_jll]] -deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6" -uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" -version = "1.16.0+6" - -[[ChainRulesCore]] -deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.29" - -[[ColorSchemes]] -deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"] -git-tree-sha1 = "3141757b5832ee7a0386db87997ee5a23ff20f4d" -uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" -version = "3.10.2" - -[[ColorTypes]] -deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "5e9769a17f17b587c951d57ba4319782b40c3513" -uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.10.10" - -[[Colors]] -deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] -git-tree-sha1 = "ac5f2213e56ed8a34a3dd2f681f4df1166b34929" -uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" -version = "0.12.6" - -[[Compat]] -deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.25.0" - -[[CompilerSupportLibraries_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "8e695f735fca77e9708e795eda62afdb869cbb70" -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "0.3.4+0" - -[[Conda]] -deps = ["JSON", "VersionParsing"] -git-tree-sha1 = "6231e40619c15148bcb80aa19d731e629877d762" -uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" -version = "1.5.1" - -[[Contour]] -deps = ["StaticArrays"] -git-tree-sha1 = "9f02045d934dc030edad45944ea80dbd1f0ebea7" -uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" -version = "0.5.7" - -[[DataAPI]] -git-tree-sha1 = "dfb3b7e89e395be1e25c2ad6d7690dc29cc53b1d" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.6.0" - -[[DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" - -[[DataValueInterfaces]] -git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" -uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" -version = "1.0.0" - -[[Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[DelimitedFiles]] -deps = ["Mmap"] -uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" - -[[Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[Distributions]] -deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"] -git-tree-sha1 = "e64debe8cd174cc52d7dd617ebc5492c6f8b698c" -uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.24.15" - -[[EarCut_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "92d8f9f208637e8d2d28c664051a00569c01493d" -uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" -version = "2.1.5+1" - -[[Expat_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1402e52fcda25064f51c77a9655ce8680b76acf0" -uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.2.7+6" - -[[FFMPEG]] -deps = ["FFMPEG_jll", "x264_jll"] -git-tree-sha1 = "9a73ffdc375be61b0e4516d83d880b265366fe1f" -uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" -version = "0.4.0" - -[[FFMPEG_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] -git-tree-sha1 = "3cc57ad0a213808473eafef4845a74766242e05f" -uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" -version = "4.3.1+4" - -[[FillArrays]] -deps = ["LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "ff537e5a3cba92fb48f30fec46723510450f2c0e" -uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "0.10.2" - -[[FixedPointNumbers]] -deps = ["Statistics"] -git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" -uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" -version = "0.8.4" - -[[Fontconfig_jll]] -deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f" -uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" -version = "2.13.1+14" - -[[Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - -[[FreeType2_jll]] -deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6" -uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.10.1+5" - -[[FriBidi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0d20aed5b14dd4c9a2453c1b601d08e1149679cc" -uuid = "559328eb-81f9-559d-9380-de523a88c83c" -version = "1.0.5+6" - -[[GLFW_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] -git-tree-sha1 = "a1bbf700b5388bffc3d882f4f4d625cf1c714fd7" -uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" -version = "3.3.2+1" - -[[GR]] -deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] -git-tree-sha1 = "12d971c928b7ecf19b748a2c7df6a365690dbf2c" -uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.55.0" - -[[GR_jll]] -deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "8aee6fa096b0cbdb05e71750c978b96a08c78951" -uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.53.0+0" - -[[GeometryBasics]] -deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] -git-tree-sha1 = "c7f81b22b6c255861be4007a16bfdeb60e1c7f9b" -uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" -version = "0.3.11" - -[[Gettext_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "8c14294a079216000a0bdca5ec5a447f073ddc9d" -uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" -version = "0.20.1+7" - -[[Glib_jll]] -deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "04690cc5008b38ecbdfede949220bc7d9ba26397" -uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" -version = "2.59.0+4" - -[[Grisu]] -git-tree-sha1 = "03d381f65183cb2d0af8b3425fde97263ce9a995" -uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" -version = "1.0.0" - -[[HTTP]] -deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] -git-tree-sha1 = "c7ec02c4c6a039a98a15f955462cd7aea5df4508" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.8.19" - -[[IniFile]] -deps = ["Test"] -git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.0" - -[[InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[IterTools]] -git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" -uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.3.0" - -[[IteratorInterfaceExtensions]] -git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" -uuid = "82899510-4779-5014-852e-03e436cf321d" -version = "1.0.0" - -[[JLLWrappers]] -git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.2.0" - -[[JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" - -[[JpegTurbo_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9aff0587d9603ea0de2c6f6300d9f9492bbefbd3" -uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "2.0.1+3" - -[[LAME_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "df381151e871f41ee86cee4f5f6fd598b8a68826" -uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" -version = "3.100.0+3" - -[[LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f128cd6cd05ffd6d3df0523ed99b90ff6f9b349a" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.0+3" - -[[LaTeXStrings]] -git-tree-sha1 = "c7f1c695e06c01b95a67f0cd1d34994f3e7db104" -uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" -version = "1.2.1" - -[[Latexify]] -deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] -git-tree-sha1 = "537df0b32bc0a99620872cc6d06278e454da4533" -uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" -version = "0.14.10" - -[[LibGit2]] -deps = ["Printf"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[LibVPX_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "85fcc80c3052be96619affa2fe2e6d2da3908e11" -uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a" -version = "1.9.0+1" - -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[Libffi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "a2cd088a88c0d37eef7d209fd3d8712febce0d90" -uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" -version = "3.2.1+4" - -[[Libgcrypt_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] -git-tree-sha1 = "b391a18ab1170a2e568f9fb8d83bc7c780cb9999" -uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" -version = "1.8.5+4" - -[[Libglvnd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] -git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf" -uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" -version = "1.3.0+3" - -[[Libgpg_error_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "ec7f2e8ad5c9fa99fc773376cdbc86d9a5a23cb7" -uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" -version = "1.36.0+3" - -[[Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f" -uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.0+7" - -[[Libmount_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "51ad0c01c94c1ce48d5cad629425035ad030bfd5" -uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" -version = "2.34.0+3" - -[[Libtiff_jll]] -deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "291dd857901f94d683973cdf679984cdf73b56d0" -uuid = "89763e89-9b03-5906-acba-b20f662cd828" -version = "4.1.0+2" - -[[Libuuid_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f879ae9edbaa2c74c922e8b85bb83cc84ea1450b" -uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" -version = "2.34.0+7" - -[[LinearAlgebra]] -deps = ["Libdl"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.6" - -[[Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] -git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" -uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.0.3" - -[[MbedTLS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6" -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.16.8+1" - -[[Measures]] -git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f" -uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" -version = "0.3.1" - -[[Missings]] -deps = ["DataAPI"] -git-tree-sha1 = "f8c673ccc215eb50fcadb285f522420e29e69e1c" -uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "0.4.5" - -[[Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[NaNMath]] -git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "0.3.5" - -[[Ogg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "a42c0f138b9ebe8b58eba2271c5053773bde52d0" -uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" -version = "1.3.4+2" - -[[OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "71bbbc616a1d710879f5a1021bcba65ffba6ce58" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.1+6" - -[[OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.3+4" - -[[Opus_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f9d57f4126c39565e05a2b0264df99f497fc6f37" -uuid = "91d4177d-7536-5919-b921-800302f37372" -version = "1.3.1+3" - -[[OrderedCollections]] -git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.4.0" - -[[PCRE_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1b556ad51dceefdbf30e86ffa8f528b73c7df2bb" -uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc" -version = "8.42.0+4" - -[[PDMats]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] -git-tree-sha1 = "95a4038d1011dfdbde7cecd2ad0ac411e53ab1bc" -uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" -version = "0.10.1" - -[[Parsers]] -deps = ["Dates"] -git-tree-sha1 = "223a825cccef2228f3fdbf2ecc7ca93363059073" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.16" - -[[Pixman_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6a20a83c1ae86416f0a5de605eaea08a552844a3" -uuid = "30392449-352a-5448-841d-b1acce4e97dc" -version = "0.40.0+0" - -[[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[PlotThemes]] -deps = ["PlotUtils", "Requires", "Statistics"] -git-tree-sha1 = "a3a964ce9dc7898193536002a6dd892b1b5a6f1d" -uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" -version = "2.0.1" - -[[PlotUtils]] -deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"] -git-tree-sha1 = "ae9a295ac761f64d8c2ec7f9f24d21eb4ffba34d" -uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" -version = "1.0.10" - -[[Plots]] -deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"] -git-tree-sha1 = "142dd04f5060c04de91cc10ca76dffb291a02426" -uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.10.6" - -[[Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[PyCall]] -deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"] -git-tree-sha1 = "dd1a970b543bd02efce2984582e996af28cab27f" -uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" -version = "1.92.2" - -[[PyPlot]] -deps = ["Colors", "LaTeXStrings", "PyCall", "Sockets", "Test", "VersionParsing"] -git-tree-sha1 = "67dde2482fe1a72ef62ed93f8c239f947638e5a2" -uuid = "d330b81b-6aea-500a-939a-2ce795aea3ee" -version = "2.9.0" - -[[Qt_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] -git-tree-sha1 = "7760cfea90bec61814e31dfb204fa4b81bba7b57" -uuid = "ede63266-ebff-546c-83e0-1c6fb6d0efc8" -version = "5.15.2+1" - -[[QuadGK]] -deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b" -uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.4.1" - -[[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[RecipesBase]] -git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.1.1" - -[[RecipesPipeline]] -deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"] -git-tree-sha1 = "c4d54a78e287de7ec73bbc928ce5eb3c60f80b24" -uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" -version = "0.3.1" - -[[Reexport]] -git-tree-sha1 = "57d8440b0c7d98fc4f889e478e80f268d534c9d5" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.0.0" - -[[Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.1.3" - -[[Rmath]] -deps = ["Random", "Rmath_jll"] -git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370" -uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.6.1" - -[[Rmath_jll]] -deps = ["Libdl", "Pkg"] -git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0" -uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.2.2+1" - -[[SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" - -[[Scratch]] -deps = ["Dates"] -git-tree-sha1 = "ad4b278adb62d185bbcb6864dc24959ab0627bf6" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.0.3" - -[[Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[Showoff]] -deps = ["Dates", "Grisu"] -git-tree-sha1 = "ee010d8f103468309b8afac4abb9be2e18ff1182" -uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" -version = "0.3.2" - -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[SortingAlgorithms]] -deps = ["DataStructures", "Random", "Test"] -git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" -uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "0.3.1" - -[[SparseArrays]] -deps = ["LinearAlgebra", "Random"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - -[[SpecialFunctions]] -deps = ["ChainRulesCore", "OpenSpecFun_jll"] -git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "1.3.0" - -[[StaticArrays]] -deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "9da72ed50e94dbff92036da395275ed114e04d49" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.0.1" - -[[Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] -git-tree-sha1 = "400aa43f7de43aeccc5b2e39a76a79d262202b76" -uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.33.3" - -[[StatsFuns]] -deps = ["Rmath", "SpecialFunctions"] -git-tree-sha1 = "3b9f665c70712af3264b61c27a7e1d62055dafd1" -uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "0.9.6" - -[[StructArrays]] -deps = ["Adapt", "DataAPI", "Tables"] -git-tree-sha1 = "26ea43b4be7e919a2390c3c0f824e7eb4fc19a0a" -uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" -version = "0.5.0" - -[[SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[TableTraits]] -deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" -uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.0" - -[[Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] -git-tree-sha1 = "a716dde43d57fa537a19058d044b495301ba6565" -uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.3.2" - -[[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[VersionParsing]] -git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f" -uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" -version = "1.2.0" - -[[Wayland_jll]] -deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "dc643a9b774da1c2781413fd7b6dcd2c56bb8056" -uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" -version = "1.17.0+4" - -[[Wayland_protocols_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll"] -git-tree-sha1 = "2839f1c1296940218e35df0bbb220f2a79686670" -uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" -version = "1.18.0+4" - -[[XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "be0db24f70aae7e2b89f2f3092e93b8606d659a6" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.9.10+3" - -[[XSLT_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "2b3eac39df218762d2d005702d601cd44c997497" -uuid = "aed1982a-8fda-507f-9586-7b0439959a61" -version = "1.1.33+4" - -[[Xorg_libX11_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] -git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" -uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" -version = "1.6.9+4" - -[[Xorg_libXau_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" -uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" -version = "1.0.9+4" - -[[Xorg_libXcursor_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] -git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" -uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" -version = "1.2.0+4" - -[[Xorg_libXdmcp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" -uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" -version = "1.1.3+4" - -[[Xorg_libXext_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" -uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" -version = "1.3.4+4" - -[[Xorg_libXfixes_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" -uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" -version = "5.0.3+4" - -[[Xorg_libXi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] -git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" -uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" -version = "1.7.10+4" - -[[Xorg_libXinerama_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] -git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" -uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" -version = "1.1.4+4" - -[[Xorg_libXrandr_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] -git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" -uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" -version = "1.5.2+4" - -[[Xorg_libXrender_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" -uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" -version = "0.9.10+4" - -[[Xorg_libpthread_stubs_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" -uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" -version = "0.1.0+3" - -[[Xorg_libxcb_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] -git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" -uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" -version = "1.13.0+3" - -[[Xorg_libxkbfile_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2" -uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" -version = "1.1.0+4" - -[[Xorg_xcb_util_image_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "0fab0a40349ba1cba2c1da699243396ff8e94b97" -uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" -version = "0.4.0+1" - -[[Xorg_xcb_util_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] -git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" -uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" -version = "0.4.0+1" - -[[Xorg_xcb_util_keysyms_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" -uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" -version = "0.4.0+1" - -[[Xorg_xcb_util_renderutil_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" -uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" -version = "0.3.9+1" - -[[Xorg_xcb_util_wm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" -uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" -version = "0.4.1+1" - -[[Xorg_xkbcomp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"] -git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b" -uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" -version = "1.4.2+4" - -[[Xorg_xkeyboard_config_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"] -git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d" -uuid = "33bec58e-1273-512f-9401-5d533626f822" -version = "2.27.0+4" - -[[Xorg_xtrans_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" -uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" -version = "1.4.0+3" - -[[Zlib_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6" -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.11+18" - -[[Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "2c1332c54931e83f8f94d310fa447fd743e8d600" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.4.8+0" - -[[libass_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "acc685bcf777b2202a904cdcb49ad34c2fa1880c" -uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" -version = "0.14.0+4" - -[[libfdk_aac_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "7a5780a0d9c6864184b3a2eeeb833a0c871f00ab" -uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" -version = "0.1.6+4" - -[[libpng_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee" -uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.37+6" - -[[libvorbis_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] -git-tree-sha1 = "fa14ac25af7a4b8a7f61b287a124df7aab601bcd" -uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" -version = "1.3.6+6" - -[[x264_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f" -uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" -version = "2020.7.14+2" - -[[x265_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "487da2f8f2f0c8ee0e83f39d13037d6bbf0a45ab" -uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" -version = "3.0.0+3" - -[[xkbcommon_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] -git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6" -uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" -version = "0.9.1+5" diff --git a/examples/GaussianProcessEmulator/learn_noise.jl b/examples/GaussianProcessEmulator/learn_noise.jl deleted file mode 100644 index a5fbaf2e4..000000000 --- a/examples/GaussianProcessEmulator/learn_noise.jl +++ /dev/null @@ -1,141 +0,0 @@ -# Reference the in-tree version of CalibrateEmulateSample on Julias load path -prepend!(LOAD_PATH, [joinpath(@__DIR__, "..", "..")]) - -# Import modules -using Random -using Distributions -using Statistics -using LinearAlgebra -using CalibrateEmulateSample.GaussianProcessEmulator -using CalibrateEmulateSample.DataStorage - -############################################################################### -# # -# This examples shows how to fit a Gaussian Process (GP) regression model # -# using GaussianProcessEmulator and demonstrates how the GaussianProcess's built-in Singular # -# Value Decomposition (SVD) decorrelates the training data and maps into # -# a space where the covariance of the observational noise is the identity. # -# # -# When training a GP, the hyperparameters of its kernel (or covariance # -# function) are optimized with respect to the given input-output pairs. # -# When training a separate GP for each output component (as is usually # -# done for multidimensional output, rather than fitting one multi-output # -# model), one assumes that their covariance functions are independent. # -# The SVD transformation ensures that this is a valid assumption. # -# # -# The decorrelation by the SVD is done automatically when instantiating # -# a `GaussianProcess`, but the user can choose to have the `predict` function # -# return its predictions in the original space (by setting # -# transform_to_real=true) # -# # -# Training points: {(x_i, y_i)} (i=1,...,n), where x_i ∈ ℝ ² and y_i ∈ ℝ ² # -# The y_i are assumed to be related to the x_i by: # -# y_i = G(x_i) + η, where G is a map from ℝ ² to ℝ ², and η is noise drawn # -# from a 2D normal distribution with known mean μ and covariance Σ # -# Two Gaussian Process models are fit, one that predicts y_i[1] from x_i # -# and one that predicts y_i[2] from x_i. # -# # -# The GaussianProcessEmulator module can be used as a standalone module to fit # -# Gaussian Process regression models, but it was originally designed as # -# the "Emulate" step of the "Calibrate-Emulate-Sample" framework # -# developed at CliMA. # -# Further reading on Calibrate-Emulate-Sample: # -# Cleary et al., 2020 # -# https://arxiv.org/abs/2001.03689 # -# # -############################################################################### - -rng_seed = 41 -Random.seed!(rng_seed) - -gppackage = GPJL() -pred_type = YType() - -# Generate training data (x-y pairs, where x ∈ ℝ ᵖ, y ∈ ℝ ᵈ) -# x = [x1, x2]: inputs/predictors/features/parameters -# y = [y1, y2]: outputs/predictands/targets/observables -# The observables y are related to the parameters x by: -# y = G(x1, x2) + η, -# where G(x1, x2) := [sin(x1) + cos(x2), sin(x1) - cos(x2)], and η ~ N(0, Σ) -n = 200 # number of training points -p = 2 # input dim -d = 2 # output dim - -X = 2.0 * π * rand(p, n) - -# G(x1, x2) -g1x = sin.(X[1, :]) .+ cos.(X[2, :]) -g2x = sin.(X[1, :]) .- cos.(X[2, :]) -gx = zeros(2,n) -gx[1,:] = g1x -gx[2,:] = g2x -# Add noise η -μ = zeros(d) -Σ = 0.1 * [[0.8, 0.2] [0.2, 0.5]] # d x d -noise_samples = rand(MvNormal(μ, Σ), n) - -# y = G(x) + η -Y = gx .+ noise_samples - -# Fit 2D Gaussian Process regression model -# (To be precise: We fit two models, one that predicts y1 from x1 and x2, and -# one that predicts y2 from x1 and x2) -# Setting GPkernel=nothing leads to the creation of a default squared -# exponential kernel. -# Setting noise_learn=true leads to the addition of white noise to the kernel, -# whose hyperparameter -- the signal variance, or "noise" -- will be learned -# in the training phase via an optimization procedure. -# Because of the SVD transformation applied to the output, we expect the -# learned noise to be close to 1. -iopairs = PairedDataContainer(X,Y,data_are_columns=true) -@assert get_inputs(iopairs) == X -@assert get_outputs(iopairs) == Y - -gpobj1 = GaussianProcess(iopairs, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=true, prediction_type=pred_type) - -println("\n-----------") -println("Results of training Gaussian Process models with noise_learn=true") -println("-----------") - -println("\nKernel of the GP trained to predict y1 from x=(x1, x2):") -println(gpobj1.models[1].kernel) -println("Learned noise parameter, σ_1:") -learned_σ_1 = sqrt(gpobj1.models[1].kernel.kright.σ2) -println("σ_1 = $learned_σ_1") -# Check if the learned noise is approximately 1 -@assert(isapprox(learned_σ_1, 1.0; atol=0.1)) - -println("\nKernel of the GP trained to predict y2 from x=(x1, x2):") -println(gpobj1.models[2].kernel) -println("Learned noise parameter, σ_2:") -learned_σ_2 = sqrt(gpobj1.models[2].kernel.kright.σ2) -println("σ_2 = $learned_σ_2") -# Check if the learned noise is approximately 1 -@assert(isapprox(learned_σ_2, 1.0; atol=0.1)) -println("------------------------------------------------------------------\n") - -# For comparison: When noise_learn is set to false, the observational noise -# is set to 1.0 and is not learned/optimized during the training. But thanks -# to the SVD, 1.0 is the correct value to use. -gpobj2 = GaussianProcess(iopairs, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=false, prediction_type=pred_type) - -println("\n-----------") -println("Results of training Gaussian Process models with noise_learn=false") -println("-----------") - -println("\nKernel of the GP trained to predict y1 from x=(x1, x2):") -# Note: In contrast to the kernels of the gpobj1 models, these ones do not -# have a white noise ("Noise") kernel component -println(gpobj2.models[1].kernel) -# logNoise is given as log(sqrt(noise)) -obs_noise_1 = exp(gpobj2.models[1].logNoise.value^2) -println("Observational noise: $obs_noise_1") - -println("\nKernel of the GP trained to predict y1 from x=(x1, x2):") -println(gpobj2.models[2].kernel) -# logNoise is given as log(sqrt(noise)) -obs_noise_2 = exp(gpobj2.models[2].logNoise.value^2) -println("Observational noise: $obs_noise_2") -println("------------------------------------------------------------------") diff --git a/src/CalibrateEmulateSample.jl b/src/CalibrateEmulateSample.jl index dd7e014dc..3bda3f7c1 100644 --- a/src/CalibrateEmulateSample.jl +++ b/src/CalibrateEmulateSample.jl @@ -14,7 +14,8 @@ export EnsembleKalmanProcessModule, DataStorage # No internal deps, heavy external deps -include("GaussianProcessEmulator.jl") +#include("GaussianProcessEmulator.jl") +include("Emulator.jl") # Internal deps, light external deps include("Utilities.jl") diff --git a/src/Emulator.jl b/src/Emulator.jl new file mode 100644 index 000000000..fd82462b4 --- /dev/null +++ b/src/Emulator.jl @@ -0,0 +1,413 @@ +module Emulators + +using ..DataStorage +using Statistics +using Distributions +using LinearAlgebra +using DocStringExtensions + +export Emulator +export Decomposition + +export optimize_hyperparameters! +export predict + +# SVD decomposition structure +""" + Decomposition{<:AbstractFloat, <:Int} + +Struct of SVD decomposition, containing (V,S,Vt), and the size of S, N. +""" +struct Decomposition{FT<:AbstractFloat, IT<:Int} + V::Array{FT,2} + Vt::Array{FT,2} + S::Array{FT} + N::IT +end + +# SVD decomposition constructor +function Decomposition(svd::SVD) + # svd.V is of type adjoint, transformed to Array with [:,:] + return Decomposition(svd.V[:,:], svd.Vt, svd.S, size(svd.S)[1]) +end + +""" + MachineLearningTool + +Type to dispatch different emulators: + + - GaussianProcess <: MachineLearningTool +""" +abstract type MachineLearningTool end +# defaults in error, all MachineLearningTools require these functions. +function throw_define_mlt() + throw(ErrorException("Unknown MachineLearningTool defined, please use a known implementation")) +end +function build_models!(mlt,iopairs) throw_define_mlt() end +function optimize_hyperparameters!(mlt) throw_define_mlt() end +function predict(mlt,new_inputs) throw_define_mlt() end + +# include the different <: ML models +include("GaussianProcess.jl") #for GaussianProcess +# include("RandomFeature.jl") +# include("NeuralNetwork.jl") +# etc. + + +# We will define the different emulator types after the general statements + +""" + Emulator + +Structure used to represent a general emulator: +""" +struct Emulator{FT} + "Machine learning tool, defined as a struct of type MachineLearningTool" + machine_learning_tool::MachineLearningTool + "normalized, standardized, transformed pairs given the Boolean's normalize_inputs, standardize_outputs, truncate_svd " + training_pairs::PairedDataContainer{FT} + "mean of input; 1 × input_dim" + input_mean::Array{FT} + "square root of the inverse of the input covariance matrix; input_dim × input_dim" + normalize_inputs::Bool + "whether to fit models on normalized outputs outputs / standardize_outputs_factor" + sqrt_inv_input_cov::Union{Nothing, Array{FT, 2}} + " if normalizing: whether to fit models on normalized inputs ((inputs - input_mean) * sqrt_inv_input_cov)" + standardize_outputs::Bool + "if standardizing: Standardization factors (characteristic values of the problem)" + standardize_outputs_factors + "the singular value decomposition of obs_noise_cov, such that obs_noise_cov = decomposition.U * Diagonal(decomposition.S) * decomposition.Vt. NB: the svd may be reduced in dimensions" + decomposition::Union{Decomposition, Nothing} +end + +# Constructor for the Emulator Object +function Emulator( + machine_learning_tool::MachineLearningTool, + input_output_pairs::PairedDataContainer{FT}; + obs_noise_cov=nothing, + normalize_inputs::Bool = true, + standardize_outputs::Bool = false, + standardize_outputs_factors::Union{Array{FT,1}, Nothing}=nothing, + truncate_svd::FT=1.0 + ) where {FT<:AbstractFloat} + + # For Consistency checks + input_dim, output_dim = size(input_output_pairs, 1) + if obs_noise_cov != nothing + err2 = "obs_noise_cov must be of size ($output_dim, $output_dim), got $(size(obs_noise_cov))" + size(obs_noise_cov) == (output_dim, output_dim) || throw(ArgumentError(err2)) + end + + + # [1.] Normalize the inputs? + input_mean = reshape(mean(get_inputs(input_output_pairs), dims=2), :, 1) #column vector + sqrt_inv_input_cov = nothing + if normalize_inputs + # Normalize (NB the inputs have to be of) size [input_dim × N_samples] to pass to GPE()) + sqrt_inv_input_cov = sqrt(inv(Symmetric(cov(get_inputs(input_output_pairs), dims=2)))) + training_inputs = normalize( + get_inputs(input_output_pairs), + input_mean, + sqrt_inv_input_cov + ) + else + training_inputs = get_inputs(input_output_pairs) + end + + # [2.] Standardize the outputs? + if standardize_outputs + training_outputs, obs_noise_cov = standardize( + get_outputs(input_output_pairs), + obs_noise_cov, + standardize_outputs_factors + ) + else + training_outputs = get_outputs(input_output_pairs) + end + + # [3.] Decorrelating the outputs [always performed] + + #Transform data if obs_noise_cov available + # (if obs_noise_cov==nothing, transformed_data is equal to data) + decorrelated_training_outputs, decomposition = svd_transform(training_outputs, obs_noise_cov, truncate_svd=truncate_svd) + + # write new pairs structure + if truncate_svd<1.0 + #note this changes the dimension of the outputs + training_pairs = PairedDataContainer(training_inputs, decorrelated_training_outputs) + input_dim, output_dim = size(training_pairs, 1) + else + training_pairs = PairedDataContainer(training_inputs, decorrelated_training_outputs) + end + + # [4.] build an emulator + build_models!(machine_learning_tool,training_pairs) + + return Emulator{FT}(machine_learning_tool, + training_pairs, + input_mean, + normalize_inputs, + sqrt_inv_input_cov, + standardize_outputs, + standardize_outputs_factors, + decomposition) +end + +""" + function optimize_hyperparameters!(emulator::Emulator) + +optimize the hyperparameters in the machine learning tool +""" +function optimize_hyperparameters!(emulator::Emulator{FT}) where {FT} + optimize_hyperparameters!(emulator.machine_learning_tool) +end + + +""" + function predict(emulator::Emulator, new_inputs; transform_to_real=false) + +makes a prediction using the emulator on new inputs (each new inputs given as data columns), default is to predict in the decorrelated space +""" +function predict(emulator::Emulator{FT}, new_inputs; transform_to_real=false) where {FT} + + # Check if the size of new_inputs is consistent with the GP model's input + # dimension. + input_dim, output_dim = size(emulator.training_pairs, 1) + + N_samples = size(new_inputs, 2) + size(new_inputs, 1) == input_dim || throw(ArgumentError("GP object and input observations do not have consistent dimensions")) + + # [1.] normalize + normalized_new_inputs = normalize(emulator,new_inputs) + + # [2.] predict. Note: ds = decorrelated, standard + ds_outputs, ds_output_var = predict(emulator.machine_learning_tool, normalized_new_inputs) + + # [3.] transform back to real coordinates or remain in decorrelated coordinates + if transform_to_real && emulator.decomposition == nothing + throw(ArgumentError("""Need SVD decomposition to transform back to original space, + but GaussianProcess.decomposition == nothing. + Try setting transform_to_real=false""")) + elseif transform_to_real && emulator.decomposition != nothing + #transform back to real coords - cov becomes dense + s_outputs, s_output_cov = svd_reverse_transform_mean_cov( + ds_outputs, ds_output_var, emulator.decomposition) + + if output_dim == 1 + s_output_cov = [s_output_cov[i][1] for i in 1:N_samples] + end + # [4.] unstandardize + return reverse_standardize(emulator, s_outputs, s_output_cov) + + else + # remain in decorrelated, standardized coordinates (cov remains diagonal) + # Convert to vector of matrices to match the format + # when transform_to_real=true + ds_output_diagvar = vec([Diagonal(ds_output_var[:, j]) for j in 1:N_samples]) + if output_dim == 1 + ds_output_diagvar = [ds_output_diagvar[i][1] for i in 1:N_samples] + end + + return ds_outputs, ds_output_diagvar + + end + +end + + + + +# Normalization, Standardization, and Decorrelation +""" + function normalize(emulator::Emulator, inputs) + +normalize the input data, with a normalizing function +""" +function normalize(emulator::Emulator{FT}, inputs) where {FT} + if emulator.normalize_inputs + return normalize(inputs, emulator.input_mean, emulator.sqrt_inv_input_cov) + else + return inputs + end +end + +""" + function normalize(inputs, input_mean, sqrt_inv_input_cov) + +normalize with the empirical Gaussian distribution of points +""" +function normalize(inputs, input_mean, sqrt_inv_input_cov) + training_inputs = sqrt_inv_input_cov * (inputs .- input_mean) + return training_inputs +end + +""" + function standardize(outputs, output_cov, factors) + +standardize with a vector of factors (size equal to output dimension) +""" +function standardize(outputs, output_cov, factors) + standardized_outputs = outputs ./ factors + standardized_cov = output_cov ./ (factors .* factors') + return standardized_outputs, standardized_cov +end + +""" + function reverse_standardize(emulator::Emulator, outputs, output_cov) + +reverse a previous standardization with the stored vector of factors (size equal to output dimension) +""" +function reverse_standardize(emulator::Emulator{FT}, outputs, output_cov) where {FT} + if emulator.standardize_outputs + return standardize(outputs, output_cov, 1. / emulator.standardize_output_factors) + else + return outputs, output_cov + end +end + + + +""" +svd_transform(data::Array{FT, 2}, obs_noise_cov::Union{Array{FT, 2}, Nothing}) where {FT} + +Apply a singular value decomposition (SVD) to the data + - `data` - GP training data/targets; output_dim × N_samples + - `obs_noise_cov` - covariance of observational noise + +Returns the transformed data and the decomposition, which is a matrix +factorization of type LinearAlgebra.SVD. + +Note: If F::SVD is the factorization object, U, S, V and Vt can be obtained via +F.U, F.S, F.V and F.Vt, such that A = U * Diagonal(S) * Vt. The singular values +in S are sorted in descending order. +""" +function svd_transform( + data::Array{FT, 2}, + obs_noise_cov; + truncate_svd::FT=1.0) where {FT} + + if obs_noise_cov != nothing + @assert ndims(obs_noise_cov) == 2 + end + if obs_noise_cov != nothing + # Truncate the SVD as a form of regularization + if truncate_svd<1.0 # this variable needs to be provided to this function + # Perform SVD + decomposition = svd(obs_noise_cov) + # Find cutoff + σ = decomposition.S + σ_cumsum = cumsum(σ) / sum(σ); + P_cutoff = truncate_svd; + ind = findall(x->x>P_cutoff, σ_cumsum); k = ind[1] + println("SVD truncated at k:") + println(k) + # Apply truncated SVD + n = size(obs_noise_cov)[1] + sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) + transformed_data = sqrt_singular_values_inv[1:k,1:k] * decomposition.Vt[1:k,:] * data + transformed_data = transformed_data; + decomposition = Decomposition(decomposition.V[:,1:k], decomposition.Vt[1:k,:], + decomposition.S[1:k], n) + else + decomposition = svd(obs_noise_cov) + sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) + transformed_data = sqrt_singular_values_inv * decomposition.Vt * data + decomposition = Decomposition(svd(obs_noise_cov)) + end + else + decomposition = nothing + transformed_data = data + end + + return transformed_data, decomposition +end + + +""" +function svd_transform( + data::Vector{FT}, + obs_noise_cov::Union{Array{FT, 2}, Nothing}; + truncate_svd::FT=1.0) where {FT} + +""" +function svd_transform( + data::Vector{FT}, + obs_noise_cov; + truncate_svd::FT=1.0) where {FT} + + + if obs_noise_cov != nothing + @assert ndims(obs_noise_cov) == 2 + end + if obs_noise_cov != nothing + # Truncate the SVD as a form of regularization + if truncate_svd<1.0 # this variable needs to be provided to this function + # Perform SVD + decomposition = svd(obs_noise_cov) + # Find cutoff + σ = decomposition.S + σ_cumsum = cumsum(σ) / sum(σ); + P_cutoff = truncate_svd; + ind = findall(x->x>P_cutoff, σ_cumsum); k = ind[1] + println("SVD truncated at k:") + println(k) + # Apply truncated SVD + n = size(obs_noise_cov)[1] + sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) + transformed_data = sqrt_singular_values_inv[1:k,1:k] * decomposition.Vt[1:k,:] * data + transformed_data = transformed_data; + decomposition = Decomposition(decomposition.V[:,1:k], decomposition.Vt[1:k,:], + decomposition.S[1:k], n) + else + decomposition = svd(obs_noise_cov) + sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) + transformed_data = sqrt_singular_values_inv * decomposition.Vt * data + decomposition = Decomposition(svd(obs_noise_cov)) + end + else + decomposition = nothing + transformed_data = data + end + + return transformed_data, decomposition +end + +""" +svd_reverse_transform_mean_cov(μ::Array{FT, 2}, σ2::{Array{FT, 2}, decomposition::SVD) where {FT} + +Transform the mean and covariance back to the original (correlated) coordinate system + - `μ` - predicted mean; output_dim × N_predicted_points + - `σ2` - predicted variance; output_dim × N_predicted_points + +Returns the transformed mean (output_dim × N_predicted_points) and variance. +Note that transforming the variance back to the original coordinate system +results in non-zero off-diagonal elements, so instead of just returning the +elements on the main diagonal (i.e., the variances), we return the full +covariance at each point, as a vector of length N_predicted_points, where +each element is a matrix of size output_dim × output_dim +""" +function svd_reverse_transform_mean_cov(μ, σ2, + decomposition::Union{SVD, Decomposition}; + truncate_svd::FT=1.0) where {FT} + @assert ndims(μ) == 2 + @assert ndims(σ2) == 2 + + output_dim, N_predicted_points = size(σ2) + # We created meanvGP = D_inv * Vt * mean_v so meanv = V * D * meanvGP + sqrt_singular_values= Diagonal(sqrt.(decomposition.S)) + transformed_μ = decomposition.V * sqrt_singular_values * μ + + transformed_σ2 = [zeros(output_dim, output_dim) for i in 1:N_predicted_points] + # Back transformation + + for j in 1:N_predicted_points + σ2_j = decomposition.V * sqrt_singular_values * Diagonal(σ2[:,j]) * sqrt_singular_values * decomposition.Vt + transformed_σ2[j] = σ2_j + end + + return transformed_μ, transformed_σ2 +end + + + +end diff --git a/src/GaussianProcess.jl b/src/GaussianProcess.jl new file mode 100644 index 000000000..3f5d7cdce --- /dev/null +++ b/src/GaussianProcess.jl @@ -0,0 +1,319 @@ + +using GaussianProcesses + +using PyCall +using ScikitLearn +const pykernels = PyNULL() +const pyGP = PyNULL() +function __init__() + copy!(pykernels, pyimport("sklearn.gaussian_process.kernels")) + copy!(pyGP, pyimport("sklearn.gaussian_process")) +end + +#exports (from Emulator) +export GaussianProcess + +export GPJL, SKLJL +export YType, FType + +""" + GaussianProcessesPackage + +Type to dispatch which GP package to use + + - `GPJL` for GaussianProcesses.jl, + - `SKLJL` for the ScikitLearn GaussianProcessRegressor +""" +abstract type GaussianProcessesPackage end +struct GPJL <: GaussianProcessesPackage end +struct SKLJL <: GaussianProcessesPackage end + +""" + PredictionType + +Predict type for `GPJL` in GaussianProcesses.jl + - `YType` + - `FType` latent function +""" +abstract type PredictionType end +struct YType <: PredictionType end +struct FType <: PredictionType end + +""" + GaussianProcess{FT<:AbstractFloat} <: MachineLearningTool + + Structure holding training input and the fitted Gaussian Process Regression +models. + +# Fields +$(DocStringExtensions.FIELDS) + +""" +struct GaussianProcess{GPPackage} <: MachineLearningTool + "the Gaussian Process (GP) Regression model(s) that are fitted to the given input-data pairs" + models::Vector + "Kernel object" + kernel + "learn the noise with the White Noise kernel explicitly?" + noise_learn + "prediction type (`y` to predict the data, `f` to predict the latent function)" + prediction_type::Union{Nothing, PredictionType} +end + + +""" + function GaussianProcess( + package; + kernel::Union{K, KPy, Nothing}=nothing, + noise_learn=true, + prediction_type::PredictionType=YType(), + ) where {K<:Kernel, KPy<:PyObject} + + - `package` - GaussianProcessPackage object + - `kernel` - GaussianProcesses kernel object. default is a Squared Exponential kernel. + - `noise_learn` - boolean to additionally learn white noise in decorrelated space. default is true. + - `prediction_type` - PredictionType object. default predicts data, not latent function (FType()). +""" +function GaussianProcess( + package; + kernel::Union{K, KPy, Nothing}=nothing, + noise_learn=true, + prediction_type::PredictionType=YType(), + ) where {K<:Kernel, KPy<:PyObject} + + # Initialize vector for GP models + models = Any[] + + return GaussianProcess{typeof(package)}(models, kernel, noise_learn, prediction_type) + +end + +# First we create the GPJL implementation +""" + function build_models!( + gp::GaussianProcess{package}, + input_output_pairs) + +method to build gaussian process models based on the package +""" +function build_models!( + gp::GaussianProcess{GPJL}, + input_output_pairs) + + # get inputs and outputs + input_values = get_inputs(input_output_pairs) + output_values = get_outputs(input_output_pairs) + + # Number of models (We are fitting one model per output dimension, as data is decorrelated) + models = gp.models + N_models = size(output_values,1); #size(transformed_data)[1] + + + # Use a default kernel unless a kernel was supplied to GaussianProcess + if gp.kernel==nothing + println("Using default squared exponential kernel, learning length scale and variance parameters") + # Construct kernel: + # Note that the kernels take the signal standard deviations on a + # log scale as input. + rbf_len = log.(ones(size(input_values, 1))) + rbf_logstd = log(1.0) + rbf = SEArd(rbf_len, rbf_logstd) + kern = rbf + println("Using default squared exponential kernel: ", kern) + else + kern = deepcopy(gp.kernel) + println("Using user-defined kernel", kern) + end + + if gp.noise_learn + # Add white noise to kernel + white_logstd = log(1.0) + white = Noise(white_logstd) + kern = kern + white + println("Learning additive white noise") + + # Make the regularization small. We actually learn + # total_noise = white_logstd + logstd_regularization_noise + magic_number = 1e-3 # magic_number << 1 + logstd_regularization_noise = log(sqrt(magic_number)) + + else + # When not learning noise, our SVD transformation implies the + # observational noise is the identity. + logstd_regularization_noise = log(sqrt(1.0)) + end + + for i in 1:N_models + # Make a copy of the kernel (because it gets altered in every + # iteration) + kernel_i = deepcopy(kern) + println("kernel in GaussianProcess:") + println(kernel_i) + data_i = output_values[i,:] + # GPE() arguments: + # input_values: (input_dim × N_samples) + # GPdata_i: (N_samples,) + + # Zero mean function + kmean = MeanZero() + + # Instantiate GP model + m = GPE(input_values, + output_values[i,:], + kmean, + kernel_i, + logstd_regularization_noise) + + println("created GP: ", i) + push!(models, m) + + end + +end + +""" + function optimize_hyperparameters!(gp::GaussianProcess{package}) + +optimize Gaussian Process hyperparameters using in-build package method +""" +function optimize_hyperparameters!(gp::GaussianProcess{GPJL}) + N_models = length(gp.models) + for i = 1:N_models + #noise_learn == true means we do it explicitly (thus don't need it here) + optimize!(gp.models[i], noise=!gp.noise_learn) + println("optimized hyperparameters of GP: ", i) + println(gp.models[i].kernel) + end +end + +""" + function predict(gp::GaussianProcess{package}, new_inputs::Array{FT, 2}) + +predict means and covariances in decorrelated output space using gaussian process models +""" +predict(gp::GaussianProcess{GPJL}, new_inputs::Array{FT, 2}) where {FT} = predict(gp, new_inputs, gp.prediction_type) + +function predict(gp::GaussianProcess{GPJL}, new_inputs::Array{FT, 2}, ::YType) where {FT} + + + M = length(gp.models) + N_samples = size(new_inputs,2) + # Predicts columns of inputs: input_dim × N_samples + μ = zeros(M, N_samples) + σ2 = zeros(M, N_samples) + for i in 1:M + μ[i,:],σ2[i,:] = predict_y(gp.models[i], new_inputs) + end + + return μ, σ2 +end + + + +function predict(gp::GaussianProcess{GPJL}, new_inputs::Array{FT, 2}, ::FType) where {FT} + + M = length(gp.models) + N_samples = size(new_inputs,2) + # Predicts columns of inputs: input_dim × N_samples + μ = zeros(M, N_samples) + σ2 = zeros(M, N_samples) + for i in 1:M + μ[i,:],σ2[i,:] = predict_f(gp.models[i], new_inputs) + end + + return μ, σ2 +end + + + + +#now we build the SKLJL implementation +function build_models!( + gp::GaussianProcess{SKLJL}, + input_output_pairs) + + # get inputs and outputs + input_values = permutedims(get_inputs(input_output_pairs), (2,1)) + output_values = get_outputs(input_output_pairs) + + # Number of models (We are fitting one model per output dimension, as data is decorrelated) + models = gp.models + N_models = size(output_values,1); #size(transformed_data)[1] + + if gp.kernel==nothing + println("Using default squared exponential kernel, learning length scale and variance parameters") + # Create default squared exponential kernel + const_value = 1.0 + var_kern = pykernels.ConstantKernel(constant_value=const_value, + constant_value_bounds=(1e-5, 1e4)) + rbf_len = ones(size(input_values, 2)) + rbf = pykernels.RBF(length_scale=rbf_len, + length_scale_bounds=(1e-5, 1e4)) + kern = var_kern * rbf + println("Using default squared exponential kernel:", kern) + else + kern = deepcopy(gp.kernel) + println("Using user-defined kernel", kern) + end + + if gp.noise_learn + # Add white noise to kernel + white_noise_level = 1.0 + white = pykernels.WhiteKernel(noise_level=white_noise_level, + noise_level_bounds=(1e-05, 10.0)) + kern = kern + white + println("Learning additive white noise") + + # Make the regularization small. We actually learn + # total_noise = white_noise_level + regularization_noise + magic_number = 1e-3 # magic_number << 1 + regularization_noise = 1e-3 + else + # When not learning noise, our SVD transformation implies the + # observational noise is the identity. + regularization_noise = 1.0 + end + + for i in 1:N_models + kernel_i = deepcopy(kern) + data_i = output_values[i, :] + m = pyGP.GaussianProcessRegressor(kernel=kernel_i, + n_restarts_optimizer=10, + alpha=regularization_noise) + + # ScikitLearn.fit! arguments: + # input_values: (N_samples × input_dim) + # data_i: (N_samples,) + ScikitLearn.fit!(m, input_values, data_i) + if i==1 + println(m.kernel.hyperparameters) + print("Completed training of: ") + end + println(i, ", ") + push!(models, m) + println(m.kernel) + end +end + + +function optimize_hyperparameters!(gp::GaussianProcess{SKLJL}) + println("SKlearn, already trained. continuing...") +end + + +function predict(gp::GaussianProcess{SKLJL}, new_inputs::Array{FT, 2}) where {FT} + + M = length(gp.models) + N_samples = size(new_inputs,2) + + # SKJL based on rows not columns; need to transpose inputs + μ = zeros(M, N_samples) + σ = zeros(M, N_samples) + for i in 1:M + μ[i,:],σ[i,:] = gp.models[i].predict(new_inputs', return_std=true) + end + σ2 = σ .* σ + + return μ, σ2 +end + diff --git a/src/GaussianProcessEmulator.jl b/src/GaussianProcessEmulator.jl deleted file mode 100644 index ab567b1b9..000000000 --- a/src/GaussianProcessEmulator.jl +++ /dev/null @@ -1,622 +0,0 @@ -module GaussianProcessEmulator - -using Statistics -using Distributions -using LinearAlgebra -using GaussianProcesses -using DocStringExtensions -using ..DataStorage - -using PyCall -using ScikitLearn -const pykernels = PyNULL() -const pyGP = PyNULL() -function __init__() - copy!(pykernels, pyimport("sklearn.gaussian_process.kernels")) - copy!(pyGP, pyimport("sklearn.gaussian_process")) -end - -export GaussianProcess -export predict - -export GPJL, SKLJL -export YType, FType -export svd_transform, svd_reverse_transform_mean_cov -export decomp_struct - -""" - GaussianProcessesPackage - -Type to dispatch which GP package to use - - - `GPJL` for GaussianProcesses.jl, - - `SKLJL` for the ScikitLearn GaussianProcessRegressor -""" -abstract type GaussianProcessesPackage end -struct GPJL <: GaussianProcessesPackage end -struct SKLJL <: GaussianProcessesPackage end - -""" - PredictionType - -Predict type for `GPJL` in GaussianProcesses.jl - - `YType` - - `FType` latent function -""" -abstract type PredictionType end -struct YType <: PredictionType end -struct FType <: PredictionType end - - -# SVD decomposition structure -struct decomp_struct{FT<:AbstractFloat, IT<:Int} - V::Array{FT,2} - Vt::Array{FT,2} - S::Array{FT} - N::IT -end -# SVD decomposition constructor -function decomp_struct(svd::SVD) - # svd.V is of type adjoint, transformed to Array with [:,:] - return decomp_struct(svd.V[:,:], svd.Vt, svd.S, size(svd.S)[1]) -end - -""" - GaussianProcess{FT<:AbstractFloat} - - Structure holding training input and the fitted Gaussian Process Regression -models. - -# Fields -$(DocStringExtensions.FIELDS) - -""" -struct GaussianProcess{FT<:AbstractFloat, GPM} - "training inputs and outputs, data stored in columns" - input_output_pairs::PairedDataContainer{FT} - "mean of input; 1 × input_dim" - input_mean::Array{FT} - "square root of the inverse of the input covariance matrix; input_dim × input_dim" - sqrt_inv_input_cov::Union{Nothing, Array{FT, 2}} - "the Gaussian Process (GP) Regression model(s) that are fitted to the given input-data pairs" - models::Vector - "the singular value decomposition of obs_noise_cov, such that obs_noise_cov = decomposition.U * Diagonal(decomposition.S) * decomposition.Vt." - decomposition::Union{decomp_struct, Nothing} - "whether to fit GP models on normalized inputs ((inputs - input_mean) * sqrt_inv_input_cov)" - normalized::Bool - "prediction type (`y` to predict the data, `f` to predict the latent function)" - prediction_type::Union{Nothing, PredictionType} - "Standardization factors (characteristic values of the problem)" - norm_factors::Union{Array{FT}, Nothing} -end - - -""" - GaussianProcess(input_output_pairs::PairedDataContainer{FT}, package::GPJL; GPkernel::Union{K, KPy, Nothing}=nothing, obs_noise_cov::Union{Array{FT, 2}, Nothing}=nothing, normalized::Bool=true, noise_learn::Bool=true, prediction_type::PredictionType=YType()) where {K<:Kernel, KPy<:PyObject} - -Input-output pairs in paired data storage, storing in/out_dim × N_samples - - - `GPkernel` - GaussianProcesses kernel object. If not supplied, a default Squared Exponential kernel is used. -""" - -function GaussianProcess( - input_output_pairs::PairedDataContainer{FT}, - package::GPJL; - GPkernel::Union{K, KPy, Nothing}=nothing, - obs_noise_cov::Union{Array{FT, 2}, Nothing}=nothing, - normalized::Bool=true, - noise_learn::Bool=true, - truncate_svd::FT=1.0, - standardize::Bool=false, - prediction_type::PredictionType=YType(), - norm_factor::Union{Array{FT,1}, Nothing}=nothing) where {FT<:AbstractFloat, K<:Kernel, KPy<:PyObject} - - # Consistency checks - input_dim, output_dim = size(input_output_pairs, 1) - - if obs_noise_cov != nothing - err2 = "obs_noise_cov must be of size ($output_dim, $output_dim), got $(size(obs_noise_cov))" - size(obs_noise_cov) == (output_dim, output_dim) || throw(ArgumentError(err2)) - end - - # Initialize vector of GP models - models = Any[] - - - # Can use the full time median or some user define function - if standardize - output_values = get_outputs(input_output_pairs) ./ norm_factor - obs_noise_cov = obs_noise_cov ./ (norm_factor .* norm_factor') - else - output_values = get_outputs(input_output_pairs) - end - - # Normalize the inputs if normalized==true - input_mean = reshape(mean(get_inputs(input_output_pairs), dims=2), :, 1) #column vector - sqrt_inv_input_cov = nothing - if normalized - # Normalize (NB the inputs have to be of) size [input_dim × N_samples] to pass to GPE()) - sqrt_inv_input_cov = sqrt(inv(Symmetric(cov(get_inputs(input_output_pairs), dims=2)))) - GPinputs = sqrt_inv_input_cov * (get_inputs(input_output_pairs).-input_mean) - else - GPinputs = get_inputs(input_output_pairs) - end - - - # Transform data if obs_noise_cov available - # (if obs_noise_cov==nothing, transformed_data is equal to data) - transformed_data, decomposition = svd_transform(output_values, - obs_noise_cov, truncate_svd=truncate_svd) - - # Overwrite the input-output pairs because of the size discrepency - if truncate_svd<1.0 - # Overwrite the input_output_pairs structure - input_output_pairs_old = deepcopy(input_output_pairs) - input_output_pairs = PairedDataContainer(get_inputs(input_output_pairs_old), - transformed_data, data_are_columns=true) - input_dim, output_dim = size(input_output_pairs, 1) - end - - # Number of models (We are fitting one model per output dimension) - N_models = output_dim; #size(transformed_data)[1] - - # Use a default kernel unless a kernel was supplied to GaussianProcess - if GPkernel==nothing - println("Using default squared exponential kernel, learning length scale and variance parameters") - # Construct kernel: - # Note that the kernels take the signal standard deviations on a - # log scale as input. - rbf_len = log.(ones(size(GPinputs, 1))) - rbf_logstd = log(1.0) - rbf = SEArd(rbf_len, rbf_logstd) - kern = rbf - println("Using default squared exponential kernel: ", kern) - else - kern = deepcopy(GPkernel) - println("Using user-defined kernel", kern) - end - - if noise_learn - # Add white noise to kernel - white_logstd = log(1.0) - white = Noise(white_logstd) - kern = kern + white - println("Learning additive white noise") - - # Make the regularization small. We actually learn - # total_noise = white_logstd + logstd_regularization_noise - magic_number = 1e-3 # magic_number << 1 - logstd_regularization_noise = log(sqrt(magic_number)) - - else - # When not learning noise, our SVD transformation implies the - # observational noise is the identity. - logstd_regularization_noise = log(sqrt(1.0)) - end - - for i in 1:N_models - # Make a copy of the kernel (because it gets altered in every - # iteration) - println("kernel in GaussianProcess") - GPkernel_i = deepcopy(kern) - println(GPkernel_i) - GPdata_i = transformed_data[i,:] - # GPE() arguments: - # GPinputs: (input_dim × N_samples) - # GPdata_i: (N_samples,) - - # Zero mean function - kmean = MeanZero() - - # Instantiate GP model - m = GPE(GPinputs, - GPdata_i, - kmean, - GPkernel_i, - logstd_regularization_noise) - - # We choose above to explicitly learn the WhiteKernel as opposed to - # using the in built noise=true functionality. - println("created GP", i) - optimize!(m, noise=false) - println("optimized GP", i) - push!(models, m) - println(m.kernel) - end - - return GaussianProcess{FT,typeof(package)}(input_output_pairs, - input_mean, - sqrt_inv_input_cov, - models, - decomposition, - normalized, - prediction_type, - norm_factor) -end - - -""" - GaussianProcess(input_output_pairs::PairedDataContainer, package::SKLJL; GPkernel::Union{K, KPy, Nothing}=nothing, obs_noise_cov::Union{Array{FT, 2}, Nothing}=nothing, normalized::Bool=true, noise_learn::Bool=true, prediction_type::PredictionType=YType()) where {K<:Kernel, KPy<:PyObject} - -Input-output pairs in paired data storage, storing in/out_dim × N_samples - - - `GPkernel` - ScikitLearn kernel object. If not supplied, a default Squared Exponential kernel is used. -""" -function GaussianProcess( - input_output_pairs::PairedDataContainer{FT}, - package::SKLJL; - GPkernel::Union{K, KPy, Nothing}=nothing, - obs_noise_cov::Union{Array{FT, 2}, Nothing}=nothing, - normalized::Bool=true, - noise_learn::Bool=true, - truncate_svd::FT=1.0, - standardize::Bool=false, - prediction_type::PredictionType=YType(), - norm_factor::Union{Array{FT,1}, Nothing}=nothing) where {FT<:AbstractFloat, K<:Kernel, KPy<:PyObject} - - # Consistency checks - input_dim, output_dim = size(input_output_pairs, 1) - - if obs_noise_cov != nothing - err2 = "obs_noise_cov must be of size ($output_dim, $output_dim), got $(size(obs_noise_cov))" - size(obs_noise_cov) == (output_dim, output_dim) || throw(ArgumentError(err2)) - end - - # Initialize vector of GP models - models = Any[] - # Number of models (We are fitting one model per output dimension) - N_models = output_dim - - # Can use the full time median or some user define function - if standardize - #norm_factors = get_standarizing_factors() - output_values = get_outputs(input_output_pairs) ./ norm_factor - obs_noise_cov = obs_noise_cov ./ (norm_factor .* norm_factor') - else - output_values = get_outputs(input_output_pairs) - end - - - # Normalize the inputs if normalized==true - # Note that contrary to the GaussianProcesses.jl (GPJL) GPE, the - # ScikitLearn (SKLJL) GaussianProcessRegressor requires inputs to be of - # size N_samples × input_dim, so one needs to transpose - input_mean = reshape(mean(get_inputs(input_output_pairs), dims=2), :, 1) - sqrt_inv_input_cov = nothing - if normalized - sqrt_inv_input_cov = sqrt(inv(Symmetric(cov(get_inputs(input_output_pairs), dims=2)))) - GPinputs = permutedims(sqrt_inv_input_cov*(get_inputs(input_output_pairs) .- input_mean), (2,1)) - else - GPinputs = permutedims(get_inputs(input_output_pairs), (2,1)) - end - - # Transform data if obs_noise_cov available (if obs_noise_cov==nothing, - # transformed_data is equal to data) - transformed_data, decomposition = svd_transform(output_values, - obs_noise_cov, truncate_svd=truncate_svd) - - if GPkernel==nothing - println("Using default squared exponential kernel, learning length scale and variance parameters") - # Create default squared exponential kernel - const_value = 1.0 - var_kern = pykernels.ConstantKernel(constant_value=const_value, - constant_value_bounds=(1e-5, 1e4)) - rbf_len = ones(size(GPinputs, 2)) - rbf = pykernels.RBF(length_scale=rbf_len, - length_scale_bounds=(1e-5, 1e4)) - kern = var_kern * rbf - println("Using default squared exponential kernel:", kern) - else - kern = deepcopy(GPkernel) - println("Using user-defined kernel", kern) - end - - if noise_learn - # Add white noise to kernel - white_noise_level = 1.0 - white = pykernels.WhiteKernel(noise_level=white_noise_level, - noise_level_bounds=(1e-05, 10.0)) - kern = kern + white - println("Learning additive white noise") - - # Make the regularization small. We actually learn - # total_noise = white_noise_level + regularization_noise - magic_number = 1e-3 # magic_number << 1 - regularization_noise = 1e-3 - else - # When not learning noise, our SVD transformation implies the - # observational noise is the identity. - regularization_noise = 1.0 - end - - for i in 1:N_models - GPkernel_i = deepcopy(kern) - GPdata_i = transformed_data[i, :] - m = pyGP.GaussianProcessRegressor(kernel=GPkernel_i, - n_restarts_optimizer=10, - alpha=regularization_noise) - - # ScikitLearn.fit! arguments: - # GPinputs: (N_samples × input_dim) - # GPdata_i: (N_samples,) - ScikitLearn.fit!(m, GPinputs, GPdata_i) - if i==1 - println(m.kernel.hyperparameters) - print("Completed training of: ") - end - println(i, ", ") - push!(models, m) - println(m.kernel) - end - return GaussianProcess{FT, typeof(package)}(input_output_pairs, - input_mean, - sqrt_inv_input_cov, - models, - decomposition, - normalized, - YType(), - norm_factor) -end - - -""" - predict(gp::GaussianProcess{FT, GPJL}, new_inputs::Array{FT, 2}, transform_to_real::Bool=false) where {FT} = predict(gp, new_inputs, gp.prediction_type) - -Evaluate the GP model(s) at new inputs. - - `gp` - a GaussianProcess - - `new_inputs` - inputs for which GP model(s) is/are evaluated; input_dim × N_samples - -Returns the predicted mean(s) and covariance(s) at the input points. -Means: matrix of size output_dim × N_samples -Covariances: vector of length N_samples, each element is a matrix of size output_dim × output_dim. If the output is 1-dimensional, a 1 × N_samples array of scalar variances is returned rather than a vector of 1x1 matrices. - -Note: If gp.normalized == true, the new inputs are normalized prior to the prediction -""" -predict(gp::GaussianProcess{FT, GPJL}, new_inputs::Array{FT, 2}; transform_to_real::Bool=false) where {FT} = predict(gp, new_inputs, transform_to_real, gp.prediction_type) - -function predict(gp::GaussianProcess{FT, GPJL}, new_inputs::Array{FT, 2}, transform_to_real, ::FType) where {FT} - - # Check if the size of new_inputs is consistent with the GP model's input - # dimension. - input_dim, output_dim = size(gp.input_output_pairs, 1) - N_samples = size(new_inputs, 2) - size(new_inputs, 1) == input_dim || throw(ArgumentError("GP object and input observations do not have consistent dimensions")) - - if gp.normalized - new_inputs = gp.sqrt_inv_input_cov * (new_inputs .- gp.input_mean) - end - - M = length(gp.models) - # Predicts columns of inputs: input_dim × N_samples - μ = zeros(output_dim,N_samples) - σ2 = zeros(output_dim,N_samples) - for i in 1:M - μ[i,:],σ2[i,:] = predict_f(gp.models[i], new_inputs) - end - - if transform_to_real && gp.decomposition != nothing - μ_pred, σ2_pred = svd_reverse_transform_mean_cov(μ, σ2, - gp.decomposition) - elseif transform_to_real && gp.decomposition == nothing - throw(ArgumentError("""Need SVD decomposition to transform back to original space, - but GaussianProcess.decomposition == nothing. - Try setting transform_to_real=false""")) - else - μ_pred = μ - # Convert to vector of (diagonal) matrices to match the format of - # σ2_pred when transform_to_real=true - σ2_pred = vec([Diagonal(σ2[:, j]) for j in 1:N_samples]) - end - - if output_dim == 1 - σ2_pred = [σ2_pred[i][1] for i in 1:N_samples] - end - - return μ_pred, σ2_pred -end - -function predict(gp::GaussianProcess{FT, GPJL}, new_inputs::Array{FT, 2}, transform_to_real, ::YType) where {FT} - - # Check if the size of new_inputs is consistent with the GP model's input - # dimension. - input_dim, output_dim = size(gp.input_output_pairs, 1) - - N_samples = size(new_inputs, 2) - size(new_inputs, 1) == input_dim || throw(ArgumentError("GP object and input observations do not have consistent dimensions")) - - if gp.normalized - new_inputs = gp.sqrt_inv_input_cov * (new_inputs .- gp.input_mean) - end - - M = length(gp.models) - # Predicts columns of inputs: input_dim × N_samples - μ = zeros(output_dim,N_samples) - σ2 = zeros(output_dim,N_samples) - for i in 1:M - μ[i,:],σ2[i,:] = predict_f(gp.models[i], new_inputs) - end - if transform_to_real && gp.decomposition != nothing - μ_pred, σ2_pred = svd_reverse_transform_mean_cov(μ, σ2, - gp.decomposition) - elseif transform_to_real && gp.decomposition == nothing - throw(ArgumentError("""Need SVD decomposition to transform back to original space, - but GaussianProcess.decomposition == nothing. - Try setting transform_to_real=false""")) - else - μ_pred = μ - # Convert to vector of (diagonal) matrices to match the format of - # σ2_pred when transform_to_real=true - σ2_pred = vec([Diagonal(σ2[:, j]) for j in 1:N_samples]) - end - - if output_dim == 1 - σ2_pred = [σ2_pred[i][1] for i in 1:N_samples] - end - - return μ_pred, σ2_pred -end - -function predict(gp::GaussianProcess{FT, SKLJL}, new_inputs::Array{FT, 2}, transform_to_real::Bool=false) where {FT} - - # Check if the size of new_inputs is consistent with the GP model's input - # dimension. - input_dim, output_dim = size(gp.input_output_pairs, 1) - - N_samples = size(new_inputs, 2) - size(new_inputs, 1) == input_dim || throw(ArgumentError("GP object and input observations do not have consistent dimensions")) - - if gp.normalized - new_inputs = gp.sqrt_inv_input_cov * (new_inputs .- gp.input_mean) - end - - M = length(gp.models) - - # SKJL based on rows not columns; need to transpose inputs - μ = zeros(output_dim,N_samples) - σ = zeros(output_dim,N_samples) - for i in 1:M - μ[i,:],σ[i,:] = gp.models[i].predict(new_inputs', return_std=true) - end - σ2 = σ .* σ - - if transform_to_real && gp.decomposition != nothing - μ_pred, σ2_pred = svd_reverse_transform_mean_cov(μ, σ2, - gp.decomposition) - elseif transform_to_real && gp.decomposition == nothing - throw(ArgumentError("""Need SVD decomposition to transform back to original space, - but GaussianProcess.decomposition == nothing. - Try setting transform_to_real=false""")) - else - μ_pred = μ - # Convert to vector of (diagonal) matrices to match the format of - # σ2_pred when transform_to_real=true - σ2_pred = vec([Diagonal(σ2[:, j]) for j in 1:N_samples]) - end - - if output_dim == 1 - σ2_pred = reshape([σ2_pred[i][1] for i in 1:N_samples], 1,N_samples) - end - - return μ_pred, σ2_pred -end - -""" -svd_transform(data::Array{FT, 2}, obs_noise_cov::Union{Array{FT, 2}, Nothing}) where {FT} - -Apply a singular value decomposition (SVD) to the data - - `data` - GP training data/targets; output_dim × N_samples - - `obs_noise_cov` - covariance of observational noise - -Returns the transformed data and the decomposition, which is a matrix -factorization of type LinearAlgebra.SVD. - -Note: If F::SVD is the factorization object, U, S, V and Vt can be obtained via -F.U, F.S, F.V and F.Vt, such that A = U * Diagonal(S) * Vt. The singular values -in S are sorted in descending order. -""" -function svd_transform(data::Array{FT, 2}, obs_noise_cov::Union{Array{FT, 2}, Nothing}; - truncate_svd::FT=1.0) where {FT} - if obs_noise_cov != nothing - # Truncate the SVD as a form of regularization - if truncate_svd<1.0 # this variable needs to be provided to this function - # Perform SVD - decomposition = svd(obs_noise_cov) - # Find cutoff - σ = decomposition.S - σ_cumsum = cumsum(σ) / sum(σ); - P_cutoff = truncate_svd; - ind = findall(x->x>P_cutoff, σ_cumsum); k = ind[1] - println("SVD truncated at k:") - println(k) - # Apply truncated SVD - n = size(obs_noise_cov)[1] - sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) - transformed_data = sqrt_singular_values_inv[1:k,1:k] * decomposition.Vt[1:k,:] * data - transformed_data = transformed_data; - decomposition = decomp_struct(decomposition.V[:,1:k], decomposition.Vt[1:k,:], - decomposition.S[1:k], n) - else - decomposition = svd(obs_noise_cov) - sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) - transformed_data = sqrt_singular_values_inv * decomposition.Vt * data - decomposition = decomp_struct(svd(obs_noise_cov)) - end - else - decomposition = nothing - transformed_data = data - end - - return transformed_data, decomposition -end - -function svd_transform(data::Vector{FT}, - obs_noise_cov::Union{Array{FT, 2}, Nothing}; - truncate_svd::FT=1.0) where {FT} - if obs_noise_cov != nothing - # Truncate the SVD as a form of regularization - if truncate_svd<1.0 # this variable needs to be provided to this function - # Perform SVD - decomposition = svd(obs_noise_cov) - # Find cutoff - σ = decomposition.S - σ_cumsum = cumsum(σ) / sum(σ); - P_cutoff = truncate_svd; - ind = findall(x->x>P_cutoff, σ_cumsum); k = ind[1] - println("SVD truncated at k:") - println(k) - # Apply truncated SVD - n = size(obs_noise_cov)[1] - sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) - transformed_data = sqrt_singular_values_inv[1:k,1:k] * decomposition.Vt[1:k,:] * data - transformed_data = transformed_data; - decomposition = decomp_struct(decomposition.V[:,1:k], decomposition.Vt[1:k,:], - decomposition.S[1:k], n) - else - decomposition = svd(obs_noise_cov) - sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(decomposition.S)) - transformed_data = sqrt_singular_values_inv * decomposition.Vt * data - decomposition = decomp_struct(svd(obs_noise_cov)) - end - else - decomposition = nothing - transformed_data = data - end - - return transformed_data, decomposition -end - -""" -svd_reverse_transform_mean_cov(μ::Array{FT, 2}, σ2::{Array{FT, 2}, decomposition::SVD) where {FT} - -Transform the mean and covariance back to the original (correlated) coordinate system - - `μ` - predicted mean; output_dim × N_predicted_points - - `σ2` - predicted variance; output_dim × N_predicted_points - -Returns the transformed mean (output_dim × N_predicted_points) and variance. -Note that transforming the variance back to the original coordinate system -results in non-zero off-diagonal elements, so instead of just returning the -elements on the main diagonal (i.e., the variances), we return the full -covariance at each point, as a vector of length N_predicted_points, where -each element is a matrix of size output_dim × output_dim -""" -function svd_reverse_transform_mean_cov(μ::Array{FT, 2}, σ2::Array{FT, 2}, - decomposition::Union{SVD, decomp_struct}; - truncate_svd::FT=1.0) where {FT} - output_dim, N_predicted_points = size(σ2) - # We created meanvGP = D_inv * Vt * mean_v so meanv = V * D * meanvGP - sqrt_singular_values= Diagonal(sqrt.(decomposition.S)) - transformed_μ = decomposition.V * sqrt_singular_values * μ - - transformed_σ2 = [zeros(output_dim, output_dim) for i in 1:N_predicted_points] - # Back transformation - - for j in 1:N_predicted_points - σ2_j = decomposition.V * sqrt_singular_values * Diagonal(σ2[:,j]) * sqrt_singular_values * decomposition.Vt - transformed_σ2[j] = σ2_j - end - - return transformed_μ, transformed_σ2 -end - - -end diff --git a/src/MarkovChainMonteCarlo.jl b/src/MarkovChainMonteCarlo.jl index 64c54f7d1..6996a36f3 100644 --- a/src/MarkovChainMonteCarlo.jl +++ b/src/MarkovChainMonteCarlo.jl @@ -1,6 +1,6 @@ module MarkovChainMonteCarlo -using ..GaussianProcessEmulator +using ..Emulators using ..ParameterDistributionStorage using Statistics @@ -97,7 +97,7 @@ function MCMC( # We need to transform obs_sample into the correct space if svdflag println("Applying SVD to decorrelating outputs, if not required set svdflag=false") - obs_sample, unused = svd_transform(obs_sample, obs_noise_cov; truncate_svd=truncate_svd) + obs_sample, unused = Emulators.svd_transform(obs_sample, obs_noise_cov; truncate_svd=truncate_svd) else println("Assuming independent outputs.") end @@ -200,7 +200,7 @@ function log_likelihood(mcmc::MCMC{FT}, #full_cov = Diagonal(gvar) eigs = eigvals(gcov) log_gpfidelity = -FT(0.5) * sum(log.(eigs)) - # Combine got log_rho + # Combine got log_rho diff = g - mcmc.obs_sample log_rho[1] = -FT(0.5) * diff' * (gcov \ diff) + log_gpfidelity #end @@ -226,7 +226,7 @@ function proposal(mcmc::MCMC) end -function find_mcmc_step!(mcmc_test::MCMC{FT}, gp::GaussianProcess{FT}; max_iter=2000) where {FT} +function find_mcmc_step!(mcmc_test::MCMC{FT}, em::Emulator{FT}; max_iter=2000) where {FT} step = mcmc_test.step[1] mcmc_accept = false doubled = false @@ -241,11 +241,11 @@ function find_mcmc_step!(mcmc_test::MCMC{FT}, gp::GaussianProcess{FT}; max_iter= while mcmc_accept == false param = reshape(mcmc_test.param, :, 1) - gp_pred, gp_predvar = predict(gp, param ) - if ndims(gp_predvar[1]) != 0 - mcmc_sample!(mcmc_test, vec(gp_pred), diag(gp_predvar[1])) + em_pred, em_predvar = predict(em, param ) + if ndims(em_predvar[1]) != 0 + mcmc_sample!(mcmc_test, vec(em_pred), diag(em_predvar[1])) else - mcmc_sample!(mcmc_test, vec(gp_pred), vec(gp_predvar)) + mcmc_sample!(mcmc_test, vec(em_pred), vec(em_predvar)) end it += 1 if it % max_iter == 0 @@ -289,18 +289,18 @@ end function sample_posterior!(mcmc::MCMC{FT,IT}, - gp::GaussianProcess{FT}, + em::Emulator{FT}, max_iter::IT) where {FT,IT<:Int} for mcmcit in 1:max_iter param = reshape(mcmc.param, :, 1) # test predictions (param is 1 x N_parameters) - gp_pred, gp_predvar = predict(gp, param) + em_pred, em_predvar = predict(em, param) - if ndims(gp_predvar[1]) != 0 - mcmc_sample!(mcmc, vec(gp_pred), diag(gp_predvar[1])) + if ndims(em_predvar[1]) != 0 + mcmc_sample!(mcmc, vec(em_pred), diag(em_predvar[1])) else - mcmc_sample!(mcmc, vec(gp_pred), vec(gp_predvar)) + mcmc_sample!(mcmc, vec(em_pred), vec(em_predvar)) end end diff --git a/test/Emulator/runtests.jl b/test/Emulator/runtests.jl new file mode 100644 index 000000000..3d754cb73 --- /dev/null +++ b/test/Emulator/runtests.jl @@ -0,0 +1,156 @@ +# Import modules +using Random +using Test +using Statistics +using Distributions +using LinearAlgebra + +using CalibrateEmulateSample.Emulators +using CalibrateEmulateSample.DataStorage + +@testset "Emulators" begin + + + #build some quick data + noise + m=50 + d=6 + x = rand(3, m) #R^3 + y = rand(d, m) #R^5 + + # "noise" + μ = zeros(d) + Σ = rand(d,d) + Σ = Σ'*Σ + noise_samples = rand(MvNormal(μ, Σ), m) + y += noise_samples + + iopairs = PairedDataContainer(x,y,data_are_columns=true) + @test get_inputs(iopairs) == x + @test get_outputs(iopairs) == y + + + + # [1.] test SVD (2D y version) + test_SVD = svd(Σ) + transformed_y, decomposition = Emulators.svd_transform(y, Σ, truncate_svd=1.0) + @test_throws AssertionError Emulators.svd_transform(y, Σ[:,1], truncate_svd=1.0) + @test test_SVD.V[:,:] == decomposition.V #(use [:,:] to make it an array) + @test test_SVD.Vt == decomposition.Vt + @test test_SVD.S == decomposition.S + @test size(test_SVD.S)[1] == decomposition.N + @test size(transformed_y) == size(y) + + # 1D y version + transformed_y, decomposition2 = Emulators.svd_transform(y[:, 1], Σ, truncate_svd=1.0) + @test_throws AssertionError Emulators.svd_transform(y[:,1], Σ[:,1], truncate_svd=1.0) + @test size(transformed_y) == size(y[:, 1]) + + # Reverse SVD + y_new, y_cov_new = Emulators.svd_reverse_transform_mean_cov(reshape(transformed_y,(d,1)),ones(d,1),decomposition2, truncate_svd=1.0) + @test_throws AssertionError Emulators.svd_reverse_transform_mean_cov(transformed_y,ones(d,1),decomposition2, truncate_svd=1.0) + @test_throws AssertionError Emulators.svd_reverse_transform_mean_cov(reshape(transformed_y,(d,1)),ones(d),decomposition2, truncate_svd=1.0) + @test size(y_new)[1] == size(y[:, 1])[1] + @test y_new ≈ y[:,1] + @test y_cov_new[1] ≈ Σ + + # Truncation + transformed_y, trunc_decomposition = Emulators.svd_transform(y[:, 1], Σ, truncate_svd=0.95) + trunc_size = size(trunc_decomposition.S)[1] + @test test_SVD.S[1:trunc_size] == trunc_decomposition.S + @test size(transformed_y)[1] == trunc_size + + # [2.] test Normalization + input_mean = reshape(mean(get_inputs(iopairs), dims=2), :, 1) #column vector + sqrt_inv_input_cov = sqrt(inv(Symmetric(cov(get_inputs(iopairs), dims=2)))) + + norm_inputs = Emulators.normalize(get_inputs(iopairs),input_mean,sqrt_inv_input_cov) + @test norm_inputs == sqrt_inv_input_cov * (get_inputs(iopairs) .- input_mean) + + # [3.] test Standardization + norm_factors = 10.0 + norm_factors = fill(norm_factors, size(y[:,1])) # must be size of output dim + + s_y, s_y_cov = Emulators.standardize(get_outputs(iopairs),Σ,norm_factors) + @test s_y == get_outputs(iopairs)./norm_factors + @test s_y_cov == Σ ./ (norm_factors.*norm_factors') + + + + # [4.] test emulator preserves the structures + + #build an unknown type + struct MLTester <: Emulators.MachineLearningTool end + + mlt = MLTester() + + @test_throws ErrorException emulator = Emulator( + mlt, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=true, + standardize_outputs=false, + truncate_svd=1.0) + + #build a known type, with defaults + gp = GaussianProcess(GPJL()) + + emulator = Emulator( + gp, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=1.0) + + # compare SVD/norm/stand with stored emulator version + test_decomp = emulator.decomposition + @test test_decomp.V == decomposition.V #(use [:,:] to make it an array) + @test test_decomp.Vt == decomposition.Vt + @test test_decomp.S == decomposition.S + @test test_decomp.N == decomposition.N + + emulator2 = Emulator( + gp, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=true, + standardize_outputs=false, + truncate_svd=1.0) + train_inputs = get_inputs(emulator2.training_pairs) + @test norm_inputs == train_inputs + + train_inputs2 = Emulators.normalize(emulator2,get_inputs(iopairs)) + @test norm_inputs == train_inputs + + # reverse standardise + + emulator3 = Emulator( + gp, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=false, + standardize_outputs=true, + standardize_outputs_factors=norm_factors, + truncate_svd=1.0) + + #standardized and decorrelated (sd) data + sd_train_outputs = get_outputs(emulator3.training_pairs) + sqrt_singular_values_inv = Diagonal(1.0 ./ sqrt.(emulator3.decomposition.S)) + decorrelated_s_y = sqrt_singular_values_inv * emulator3.decomposition.Vt * s_y + @test decorrelated_s_y == sd_train_outputs + + + # truncation + emulator4 = Emulator( + gp, + iopairs, + obs_noise_cov=Σ, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=0.9) + trunc_size = size(emulator4.decomposition.S)[1] + @test test_SVD.S[1:trunc_size] == emulator4.decomposition.S + + + +end diff --git a/test/GaussianProcess/runtests.jl b/test/GaussianProcess/runtests.jl new file mode 100644 index 000000000..5db2c1ab8 --- /dev/null +++ b/test/GaussianProcess/runtests.jl @@ -0,0 +1,199 @@ +# Import modules +using Random +using Test +using GaussianProcesses +using Statistics +using Distributions +using ScikitLearn +using LinearAlgebra +@sk_import gaussian_process : GaussianProcessRegressor +@sk_import gaussian_process.kernels : (RBF, WhiteKernel, ConstantKernel) + +using CalibrateEmulateSample.Emulators +using CalibrateEmulateSample.DataStorage + +@testset "GaussianProcess" begin + + # Seed for pseudo-random number generator + rng_seed = 41 + Random.seed!(rng_seed) + + # ------------------------------------------------------------------------- + # Test case 1: 1D input, 1D output + # ------------------------------------------------------------------------- + + # Training data + n = 20 # number of training points + x = reshape(2.0 * π * rand(n), 1, n) # predictors/features: 1 x n + y = reshape(sin.(x) + 0.05 * randn(n)', 1, n) # predictands/targets: 1 x n + + iopairs = PairedDataContainer(x,y,data_are_columns=true) + # Construct kernel: + # Squared exponential kernel (note that hyperparameters are on log scale) + # with observational noise + GPkernel = SE(log(1.0), log(1.0)) + + # These will be the test inputs at which predictions are made + new_inputs = reshape([0.0, π/2, π, 3*π/2, 2*π], 1, 5) + + # Fit Gaussian Process Regression models. + # GaussianProcesses.jl (GPJL) provides two predict functions, predict_y + # (which predicts the random variable y(θ)) and predict_y (which predicts + # the latent random variable f(θ)). + # ScikitLearn's Gaussian process regression (SKLJL) only offers one + # predict function, which predicts y. + + ## GaussianProcess 1: GPJL, predict_y unnormalized + gppackage = GPJL() + pred_type = YType() + + gp1 = GaussianProcess( + gppackage; + kernel=GPkernel, + noise_learn=true, + prediction_type=pred_type) + + @test gp1.kernel == GPkernel + @test gp1.noise_learn == true + @test gp1.prediction_type == pred_type + + em1 = Emulator( + gp1, + iopairs, + obs_noise_cov=nothing, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=1.0) + + Emulators.optimize_hyperparameters!(em1) + + μ1, σ1² = Emulators.predict(em1, new_inputs) + + @test vec(μ1) ≈ [0.0, 1.0, 0.0, -1.0, 0.0] atol=0.3 + @test size(μ1)==(1,5) + @test vec(σ1²) ≈ [0.017, 0.003, 0.004, 0.004, 0.009] atol=1e-2 + + # GaussianProcess 2: GPJL, predict_f + pred_type = FType() + + gp2 = GaussianProcess( + gppackage; + kernel=GPkernel, + noise_learn=true, + prediction_type=pred_type) + + em2 = Emulator( + gp2, + iopairs, + obs_noise_cov=nothing, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=1.0) + + Emulators.optimize_hyperparameters!(em2) + + μ2, σ2² = Emulators.predict(em2, new_inputs) + # predict_y and predict_f should give the same mean + @test μ2 ≈ μ1 atol=1e-6 + + + # GaussianProcess 3: SKLJL + + gppackage = SKLJL() + pred_type = YType() + var = ConstantKernel(constant_value=1.0) + se = RBF(1.0) + GPkernel = var * se + + + gp3 = GaussianProcess( + gppackage; + kernel=GPkernel, + noise_learn=true, + prediction_type=pred_type) + + em3 = Emulator( + gp3, + iopairs, + obs_noise_cov=nothing, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=1.0) + + Emulators.optimize_hyperparameters!(em3) + + + #gp3 = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=nothing, + # normalized=false, noise_learn=true, + # truncate_svd=1.0, standardize=false, + # prediction_type=pred_type, norm_factor=nothing) + + μ3, σ3² = Emulators.predict(em3, new_inputs) + @test vec(μ3) ≈ [0.0, 1.0, 0.0, -1.0, 0.0] atol=0.3 + @test vec(σ3²) ≈ [0.016, 0.002, 0.003, 0.004, 0.003] atol=1e-2 + + + # ------------------------------------------------------------------------- + # Test case 2: 2D input, 2D output + # ------------------------------------------------------------------------- + + gppackage = GPJL() + pred_type = YType() + + # Generate training data + m = 80 # number of training points + + p = 2 # input dim + d = 2 # output dim + X = 2.0 * π * rand(p, m) + + # G(x1, x2) + g1x = sin.(X[1, :]) .+ cos.(X[2, :]) + g2x = sin.(X[1, :]) .- cos.(X[2, :]) + gx = zeros(2,m) + gx[1,:] = g1x + gx[2,:] = g2x + + # Add noise η + μ = zeros(d) + Σ = 0.1 * [[0.8, 0.2] [0.2, 0.5]] # d x d + noise_samples = rand(MvNormal(μ, Σ), m) + + # y = G(x) + η + Y = gx .+ noise_samples + + iopairs2 = PairedDataContainer(X,Y,data_are_columns=true) + @test get_inputs(iopairs2) == X + @test get_outputs(iopairs2) == Y + + gp4 = GaussianProcess( + gppackage; + kernel=nothing, + noise_learn=true, + prediction_type=pred_type) + + em4 = Emulator( + gp4, + iopairs2, + obs_noise_cov=Σ, + normalize_inputs=true, + standardize_outputs=false, + truncate_svd=1.0) + + Emulators.optimize_hyperparameters!(em4) + + new_inputs = zeros(2, 4) + new_inputs[:, 2] = [π/2, π] + new_inputs[:, 3] = [π, π/2] + new_inputs[:, 4] = [3*π/2, 2*π] + + μ4, σ4² = Emulators.predict(em4, new_inputs, transform_to_real=true) + + @test μ4[:, 1] ≈ [1.0, -1.0] atol=0.25 + @test μ4[:, 2] ≈ [0.0, 2.0] atol=0.25 + @test μ4[:, 3] ≈ [0.0, 0.0] atol=0.25 + @test μ4[:, 4] ≈ [0.0, -2.0] atol=0.25 + @test length(σ4²) == size(new_inputs,2) + @test size(σ4²[1]) == (d, d) + +end diff --git a/test/GaussianProcessEmulator/runtests.jl b/test/GaussianProcessEmulator/runtests.jl deleted file mode 100644 index 9b2bf4390..000000000 --- a/test/GaussianProcessEmulator/runtests.jl +++ /dev/null @@ -1,190 +0,0 @@ -# Import modules -using Random -using Test -using GaussianProcesses -using Statistics -using Distributions -using ScikitLearn -using LinearAlgebra -@sk_import gaussian_process : GaussianProcessRegressor -@sk_import gaussian_process.kernels : (RBF, WhiteKernel, ConstantKernel) - -using CalibrateEmulateSample.GaussianProcessEmulator -using CalibrateEmulateSample.DataStorage - -@testset "GaussianProcessEmulator" begin - - # Seed for pseudo-random number generator - rng_seed = 41 - Random.seed!(rng_seed) - - # ------------------------------------------------------------------------- - # Test case 1: 1D input, 1D output - # ------------------------------------------------------------------------- - - # Training data - n = 20 # number of training points - x = reshape(2.0 * π * rand(n), 1, n) # predictors/features: 1 x n - y = reshape(sin.(x) + 0.05 * randn(n)', 1, n) # predictands/targets: 1 x n - - iopairs = PairedDataContainer(x,y,data_are_columns=true) - # Construct kernel: - # Squared exponential kernel (note that hyperparameters are on log scale) - # with observational noise - GPkernel = SE(log(1.0), log(1.0)) - - # These will be the test inputs at which predictions are made - new_inputs = reshape([0.0, π/2, π, 3*π/2, 2*π], 1, 5) - - # Fit Gaussian Process Regression models. - # GaussianProcesses.jl (GPJL) provides two predict functions, predict_y - # (which predicts the random variable y(θ)) and predict_y (which predicts - # the latent random variable f(θ)). - # ScikitLearn's Gaussian process regression (SKLJL) only offers one - # predict function, which predicts y. - - # GaussianProcess 1: GPJL, predict_y - gppackage = GPJL() - pred_type = YType() - - - gp1 = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=nothing, - normalized=false, noise_learn=true, - truncate_svd=1.0, standardize=false, - prediction_type=pred_type, norm_factor=nothing) - μ1, σ1² = GaussianProcessEmulator.predict(gp1, new_inputs) - - @test gp1.input_output_pairs == iopairs - @test gp1.input_mean[1] ≈ mean(x) atol=1e-2 - @test gp1.sqrt_inv_input_cov == nothing - @test gp1.prediction_type == pred_type - @test vec(μ1) ≈ [0.0, 1.0, 0.0, -1.0, 0.0] atol=0.3 - @test size(μ1)==(1,5) - @test vec(σ1²) ≈ [0.017, 0.003, 0.004, 0.004, 0.009] atol=1e-2 - - # Check if normalization works - gp1_norm = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, - obs_noise_cov=nothing, normalized=true, - noise_learn=true, truncate_svd=1.0, - standardize=false, prediction_type=pred_type, - norm_factor=nothing) - @test gp1_norm.sqrt_inv_input_cov ≈ [sqrt(1.0 / Statistics.var(x))] atol=1e-4 - - - - - # GaussianProcess 2: GPJL, predict_f - pred_type = FType() - gp2 = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=nothing, - normalized=false, noise_learn=true, - truncate_svd=1.0, standardize=false, - prediction_type=pred_type, norm_factor=nothing) - μ2, σ2² = GaussianProcessEmulator.predict(gp2, new_inputs) - # predict_y and predict_f should give the same mean - @test μ2 ≈ μ1 atol=1e-6 - - - # GaussianProcess 3: SKLJL - - gppackage = SKLJL() - pred_type = YType() - var = ConstantKernel(constant_value=1.0) - se = RBF(1.0) - GPkernel = var * se - - gp3 = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=nothing, - normalized=false, noise_learn=true, - truncate_svd=1.0, standardize=false, - prediction_type=pred_type, norm_factor=nothing) - - μ3, σ3² = GaussianProcessEmulator.predict(gp3, new_inputs) - @test vec(μ3) ≈ [0.0, 1.0, 0.0, -1.0, 0.0] atol=0.3 - @test vec(σ3²) ≈ [0.016, 0.002, 0.003, 0.004, 0.003] atol=1e-2 - - - # ------------------------------------------------------------------------- - # Test case 2: 2D input, 2D output - # ------------------------------------------------------------------------- - - gppackage = GPJL() - pred_type = YType() - - # Generate training data - m = 80 # number of training points - - p = 2 # input dim - d = 2 # output dim - X = 2.0 * π * rand(p, m) - - # G(x1, x2) - g1x = sin.(X[1, :]) .+ cos.(X[2, :]) - g2x = sin.(X[1, :]) .- cos.(X[2, :]) - gx = zeros(2,m) - gx[1,:] = g1x - gx[2,:] = g2x - - # Add noise η - μ = zeros(d) - Σ = 0.1 * [[0.8, 0.2] [0.2, 0.5]] # d x d - noise_samples = rand(MvNormal(μ, Σ), m) - - # y = G(x) + η - Y = gx .+ noise_samples - - iopairs2 = PairedDataContainer(X,Y,data_are_columns=true) - @test get_inputs(iopairs2) == X - @test get_outputs(iopairs2) == Y - - transformed_Y, decomposition = svd_transform(Y, Σ, truncate_svd=1.0) - @test size(transformed_Y) == size(Y) - transformed_Y, decomposition = svd_transform(Y[:, 1], Σ, truncate_svd=1.0) - @test size(transformed_Y) == size(Y[:, 1]) - - - gp4 = GaussianProcess(iopairs2, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=true, - truncate_svd=1.0, standardize=false, - prediction_type=pred_type, norm_factor=nothing) - - new_inputs = zeros(2, 4) - new_inputs[:, 2] = [π/2, π] - new_inputs[:, 3] = [π, π/2] - new_inputs[:, 4] = [3*π/2, 2*π] - - μ4, σ4² = GaussianProcessEmulator.predict(gp4, new_inputs, transform_to_real=true) - - @test μ4[:, 1] ≈ [1.0, -1.0] atol=0.25 - @test μ4[:, 2] ≈ [0.0, 2.0] atol=0.25 - @test μ4[:, 3] ≈ [0.0, 0.0] atol=0.25 - @test μ4[:, 4] ≈ [0.0, -2.0] atol=0.25 - @test length(σ4²) == size(new_inputs,2) - @test size(σ4²[1]) == (d, d) - - # Check if standardization works - norm_factor = 10.0 - norm_factor = fill(norm_factor, size(Y[:,1])) # must be size of output dim - println(norm_factor) - gp4_standardized = GaussianProcess(iopairs2, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=true, - truncate_svd=1.0, standardize=true, - prediction_type=pred_type, norm_factor=norm_factor) - cov_est = gp4_standardized.decomposition.V * diagm(gp4_standardized.decomposition.S) * - gp4_standardized.decomposition.Vt - @test cov_est ≈ Σ ./ (norm_factor .* norm_factor') atol=1e-2 - @test cov_est ≈ Σ ./ 100.0 atol=1e-2 - - # Check if truncation works - norm_factor = 10.0 - norm_factor = fill(norm_factor, size(Y[:,1])) # must be size of output dim - println(norm_factor) - gp4_trunc = GaussianProcess(iopairs2, gppackage, GPkernel=nothing, obs_noise_cov=Σ, - normalized=true, noise_learn=true, - truncate_svd=0.1, standardize=true, - prediction_type=pred_type, norm_factor=norm_factor) - μ4_trunc, σ4_trunc = GaussianProcessEmulator.predict(gp4_trunc, new_inputs, transform_to_real=false) - μ4_trunc_real, σ4_trunc_real = GaussianProcessEmulator.predict(gp4_trunc, new_inputs, transform_to_real=true) - @test size(μ4_trunc,1) == 1 - @test size(μ4_trunc_real,1) == 2 - - -end diff --git a/test/MarkovChainMonteCarlo/runtests.jl b/test/MarkovChainMonteCarlo/runtests.jl index dbd0e8b67..cfbfd1700 100644 --- a/test/MarkovChainMonteCarlo/runtests.jl +++ b/test/MarkovChainMonteCarlo/runtests.jl @@ -6,7 +6,7 @@ using Test using CalibrateEmulateSample.MarkovChainMonteCarlo using CalibrateEmulateSample.ParameterDistributionStorage -using CalibrateEmulateSample.GaussianProcessEmulator +using CalibrateEmulateSample.Emulators using CalibrateEmulateSample.DataStorage @testset "MarkovChainMonteCarlo" begin @@ -17,7 +17,7 @@ using CalibrateEmulateSample.DataStorage # We need a GaussianProcess to run MarkovChainMonteCarlo, so let's reconstruct the one that's tested # in test/GaussianProcesses/runtests.jl - n = 20 # number of training points + n = 40 # number of training points x = reshape(2.0 * π * rand(n), 1, n) # predictors/features: 1 × n σ2_y = reshape([0.05],1,1) y = sin.(x) + rand(Normal(0, σ2_y[1]), (1, n)) # predictands/targets: 1 × n @@ -34,10 +34,21 @@ using CalibrateEmulateSample.DataStorage # Squared exponential kernel (note that hyperparameters are on log scale) # with observational noise GPkernel = SE(log(1.0), log(1.0)) + gp = GaussianProcess( + gppackage; + kernel=GPkernel, + noise_learn=true, + prediction_type=pred_type) + + em = Emulator( + gp, + iopairs, + obs_noise_cov=σ2_y, + normalize_inputs=false, + standardize_outputs=false, + truncate_svd=1.0) - gp = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=σ2_y, - normalized=false, noise_learn=true, - prediction_type=pred_type) + Emulators.optimize_hyperparameters!(em) ### Define prior umin = -1.0 @@ -62,7 +73,7 @@ using CalibrateEmulateSample.DataStorage mcmc_test = MCMC(obs_sample, σ2_y, prior, step, param_init, max_iter, mcmc_alg, burnin; svdflag=true, standardize=false, truncate_svd=1.0, norm_factor=norm_factors) - new_step = find_mcmc_step!(mcmc_test, gp) + new_step = find_mcmc_step!(mcmc_test, em) # reset parameters burnin = 1000 @@ -72,7 +83,7 @@ using CalibrateEmulateSample.DataStorage mcmc = MCMC(obs_sample, σ2_y, prior, step, param_init, max_iter, mcmc_alg, burnin; svdflag=true, standardize=false, truncate_svd=1.0, norm_factor=norm_factors) - sample_posterior!(mcmc, gp, max_iter) + sample_posterior!(mcmc, em, max_iter) posterior_distribution = get_posterior(mcmc) #post_mean = mean(posterior, dims=1)[1] posterior_mean = get_mean(posterior_distribution) @@ -89,24 +100,4 @@ using CalibrateEmulateSample.DataStorage max_iter, "gibbs", burnin) @test isapprox(posterior_mean[1] - π/2, 0.0; atol=4e-1) - # Standardization and truncation - norm_factor = 10.0 - norm_factor = fill(norm_factor, size(y[:,1])) # must be size of output dim - gp = GaussianProcess(iopairs, gppackage; GPkernel=GPkernel, obs_noise_cov=σ2_y, - normalized=false, noise_learn=true, standardize=true, truncate_svd=0.9, - prediction_type=pred_type, norm_factor=norm_factor) - mcmc_test = MCMC(obs_sample, σ2_y, prior, step, param_init, max_iter, - mcmc_alg, burnin; - svdflag=true, standardize=true, norm_factor=norm_factor, truncate_svd=0.9) - - # Now begin the actual MCMC - mcmc = MCMC(obs_sample, σ2_y, prior, step, param_init, max_iter, - mcmc_alg, burnin; svdflag=true, standardize=false, - truncate_svd=1.0, norm_factor=norm_factor) - sample_posterior!(mcmc, gp, max_iter) - posterior_distribution = get_posterior(mcmc) - #post_mean = mean(posterior, dims=1)[1] - posterior_mean2 = get_mean(posterior_distribution) - @test posterior_mean2 ≈ posterior_mean atol=0.1 - end diff --git a/test/runtests.jl b/test/runtests.jl index b1cd0e225..17dae84ab 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,7 +24,8 @@ end end end - for submodule in ["GaussianProcessEmulator", + for submodule in ["Emulator", + "GaussianProcess", "MarkovChainMonteCarlo", "Utilities"]