diff --git a/10_BayesianDiffEq.ipynb b/10_BayesianDiffEq.ipynb index 198e59b31..109d8ce7f 100644 --- a/10_BayesianDiffEq.ipynb +++ b/10_BayesianDiffEq.ipynb @@ -13,7 +13,24 @@ "cell_type": "code", "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "┌ Info: Precompiling DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0]\n", + "└ @ Base loading.jl:1260\n", + "┌ Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]\n", + "└ @ Base loading.jl:1260\n", + "┌ Info: Precompiling DiffEqSensitivity [41bf760c-e81c-5289-8e54-58b1f1f8abe2]\n", + "└ @ Base loading.jl:1260\n", + "┌ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]\n", + "└ @ Base loading.jl:1260\n", + "┌ Info: Precompiling StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]\n", + "└ @ Base loading.jl:1260\n" + ] + } + ], "source": [ "using Turing, Distributions, DataFrames, DifferentialEquations, DiffEqSensitivity\n", "\n", @@ -49,111 +66,111 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" + "\n" ] }, "execution_count": 2, @@ -436,75 +453,18 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", "┌ Info: Found initial step size\n", - "│ ϵ = 0.0125\n", + "│ ϵ = 0.025\n", "└ @ Turing.Inference /Users/vaibhav/.julia/packages/Turing/GMBTf/src/inference/hmc.jl:629\n", "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", - "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n", - "┌ Warning: The current proposal will be rejected due to numerical error(s).\n", - "│ isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)\n", "└ @ AdvancedHMC /Users/vaibhav/.julia/packages/AdvancedHMC/WJCQA/src/hamiltonian.jl:47\n" ] }, @@ -525,23 +485,23 @@ "Summary Statistics\n", " parameters mean std naive_se mcse ess r_hat\n", " ────────── ────── ────── ──────── ────── ───────── ──────\n", - " theta[1] 2.4051 0.0657 0.0007 0.0011 4124.2708 1.0001\n", - " theta[2] 1.3384 0.0720 0.0008 0.0011 4704.0990 1.0004\n", - " theta[3] 2.7012 0.1862 0.0020 0.0024 5266.9500 0.9999\n", - " theta[4] 1.9285 0.0492 0.0005 0.0008 3959.7446 0.9999\n", - " σ[1] 1.2781 0.0649 0.0007 0.0008 5694.3945 1.0001\n", + " theta[1] 2.1999 0.0061 0.0001 0.0001 2932.9824 1.0000\n", + " theta[2] 1.0000 0.0025 0.0000 0.0000 2976.0464 1.0001\n", + " theta[3] 2.0001 0.0028 0.0000 0.0000 4960.5915 1.0002\n", + " theta[4] 0.4000 0.0007 0.0000 0.0000 2917.9182 0.9999\n", + " σ[1] 0.0151 0.0011 0.0000 0.0000 4999.8943 1.0003\n", "\n", "Quantiles\n", " parameters 2.5% 25.0% 50.0% 75.0% 97.5%\n", " ────────── ────── ────── ────── ────── ──────\n", - " theta[1] 2.2589 2.3635 2.4142 2.4588 2.4956\n", - " theta[2] 1.2078 1.2893 1.3352 1.3837 1.4937\n", - " theta[3] 2.3634 2.5713 2.6925 2.8212 3.0914\n", - " theta[4] 1.8186 1.8960 1.9360 1.9685 1.9965\n", - " σ[1] 1.1600 1.2329 1.2743 1.3204 1.4144\n" + " theta[1] 2.1878 2.1957 2.1999 2.2040 2.2119\n", + " theta[2] 0.9951 0.9983 1.0000 1.0017 1.0048\n", + " theta[3] 1.9948 1.9982 2.0001 2.0019 2.0057\n", + " theta[4] 0.3987 0.3996 0.4000 0.4004 0.4013\n", + " σ[1] 0.0131 0.0143 0.0150 0.0158 0.0174\n" ] }, - "execution_count": 4, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -562,7 +522,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -571,5434 +531,5410 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", - "\n", "\n", - " \n", - " \n", + " \n", + " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", "\n" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -7681,13 +7617,6 @@ "model = fitlv(averagedata)\n", "chain = sample(model, NUTS(.65),500)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {