-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmonte_carlo.jl
1697 lines (1414 loc) · 61 KB
/
monte_carlo.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### A Pluto.jl notebook ###
# v0.19.6
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
end
# ╔═╡ 0a7ccbce-d228-11ec-34a3-1fc3ac51f1a8
begin
using Random
using RNGPool # For parallel random numbers
using Sobol # For Sobol only
using QuasiMonteCarlo # For lattice sampline
using HCubature, StaticArrays # For adaptive cubature
using Plots
using PlutoUI
end
# ╔═╡ 8c48f025-cd13-4c3a-9bcf-42775ffa783b
md"""
# Lab 10: Bayesian Computing & Integration
#### [Penn State Astroinformatics Summer School 2022](https://sites.psu.edu/astrostatistics/astroinfo-su22-program/)
#### [Eric Ford](https://www.personal.psu.edu/ebf11)
"""
# ╔═╡ 1c649b98-5abf-4054-abcc-73b8c9b45cf7
md"""
## Overview
In this lab, you'll compare different sampling strategies for evaluating integrals.
After buidling intuition visually in two dimensions, then you'll compare how different integration algorithms perform in higher dimensions.
"""
# ╔═╡ 16d063b3-09e3-4dbd-852f-e5e56c4d6c0b
md"""
## Sampling Patterns in 2-d
First, imagine that you want to evaluate an integral of a probability distribution whose log likelihood contours are shown below.
The Bayesian computing lesson discussed Monte Carlo sampling for approximating integrals numerically based on a sequence of random (or pseudo-random) numbers.
As you increase the number of samples, eventually the estimate of the integral converges to the true value. But the convergence can be slow.
We also show some alternative sampling strategies, such as using a quasi-random sequences (e.g., the Sobol sequence), using a lattice rule or a *lowdiscrepancy sequence*. It's easiest to compare them visually, by seeing how points are distributed as the number of sampling points increases.
"""
# ╔═╡ 4987b363-c8d0-4f99-b7e9-2a811d1b1956
function f_gaussian_at_origin(x; sigma::Real = 1.0)
result = exp(-sum(x.^2)./(2*sigma^2))
result /= 2π*sigma^2
return result
end
# ╔═╡ 8215ae2e-988f-4ed3-92d5-610d2bbc6056
md"Standard deviation of normal distribution: $(@bind sigma_sample confirm(NumberField(0.02:0.02:1, default=0.1)))"
# ╔═╡ 0fd920e1-209e-4456-9f3a-025537fe081d
md"""
**Question:** Based on the visualizations above, which of the sampling strategies above do you expect will provide the most accurate estimate of a Gaussian integral?
"""
# ╔═╡ ce930bb7-5e9d-4a62-87f0-7570e1680eeb
md"Below we compare the difference of the estimate from each method to our best approximation of the answer."
# ╔═╡ 647d29ed-0c0d-4640-ab96-28a33f4b9814
md"""
## Integration Error in 2-d
Next, we will explore how the error decreases as we increase the number of samples. We'll start with a the same 2-d example as above.
### Normal distribution at origin
"""
# ╔═╡ f570b0d7-36cc-456d-a056-f6f2ebc25b97
#log2_max_evals_2d = 14
md"log₂ maximum evaluations: $(@bind log2_max_evals_2d NumberField(8:16, default=15))"
# ╔═╡ d9760730-89a2-43b3-a076-8cc48ed4c286
md"""
**Question:** How does the convergence rate of standard Monte Carlo integration compare to using a quaesi-random sequence?
**Question:** Is the choice of integration method more likely to be important for a case cases where you can accept low accuracy estimate or where you need a high-accuracy estimate?
"""
# ╔═╡ b3cd3ea8-7acd-4695-8521-4a1939308ef5
md"""
### Alternative function in 2-d
In practice, our integrands are usually more complicated than a single Gaussian. Below, you can generate multi-modal distributions and compare how the different integration algorithms perform in more representative integrands.
"""
# ╔═╡ 5fb9905a-6562-4d6d-af30-e4c9aca17723
begin
md"Standard deviation of each Gaussian: $(@bind sigma_err confirm(NumberField(0.02:0.02:0.5, default=0.1)))"
end
# ╔═╡ d0f920e4-3448-494b-9620-3b39859a113f
md"Minimum of y-axis: $(@bind log10_y_axis_min_2d Slider(-16:-3, default=-6))"
# ╔═╡ 837fdc17-604b-4a48-8039-5a68e6a8a2df
md"""
**Question:** How does the integration error change as you vary the standard deviation of the Gaussians in the target distribution?
**Question:** What are the implications of your findings for analyzing datasets with a large number of observations?
"""
# ╔═╡ 440af812-7000-4f27-9276-94a23c80b735
md"""
# Integration Error in Higher Dimensions
Finally, we'll consider increasing the dimensionality of the integrand.
"""
# ╔═╡ 6bfb3b7c-5021-4910-93fb-0dc4325ce1ac
md"Redraw peak locations: $(@bind regen_multipeaks_highd Button())"
# ╔═╡ 6c776177-f29d-4fa8-83e2-6fcc1bbb542e
md"minimum y-axis: $(@bind log10_y_axis_min Slider(-16:-3, default=-6))"
# ╔═╡ 936c7b13-ae2a-432d-88b3-a7f504ffe9ba
md"""
**Question:** How does the error of standard Monte Carlo method change as you increase the number of dimensions?
**Question:** How does the error of integration using Sobol sampling change as you increase the number of dimensions?
**Question:** H-Cubature is a type of adaptive quadrature. How does it compare to integration via Sobol sampling for a few to several dimensions? What about for ∼10-12 dimensions?
**Question:** What are the implications of your findings for analyzing data sets with a large number of model parameters?
"""
# ╔═╡ fa7061f2-1126-4965-8915-60474759ff41
md"# Setup & Helper Code"
# ╔═╡ 822c11e1-c64a-4400-91ea-f78a51553216
use_threads = true
# ╔═╡ 59f92f75-04f0-4e1a-820e-d05a27104f25
md"## Integration routines"
# ╔═╡ c3855f10-c085-4c22-afab-20444f5c7e1e
function integrate_2d_grid_serial(f::Function, sqrt_n::Integer)
num_dim = 2
tmp = zeros(num_dim)
result = 0.0
for i in 1:sqrt_n
x = (i-0.5)/sqrt_n
for j in 1:sqrt_n
y = (j-0.5)/sqrt_n
result += f((x,y))
end
end
return result / sqrt_n^2
end
# ╔═╡ bb44e7b0-2da9-4622-8f50-0fb4870188bb
function integrate_monte_carlo_serial(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
#rng = Random.seed!(seed)
setRNGs(seed)
rng::RNG = getRNG()
result = 0.0
tmp = zeros(num_dim)
for i in 1:n
rand!(rng, tmp)
result += f(tmp)
end
return result / n
end
# ╔═╡ e7657f38-9fbc-4949-b9a4-638fba3549c7
function integrate_monte_carlo_parallel(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
setRNGs(seed)
num_threads = Threads.nthreads()
result_per_thread = zeros(num_threads)
n_per_thread = div(n, num_threads )
Threads.@threads for t in 1:num_threads
local rng::RNG = getRNG()
arg = zeros(num_dim)
for i in 1:n_per_thread
rand!(rng, arg)
result_per_thread[t] += f(arg)
end
end
result = sum(result_per_thread)
if true && ((num_threads * n_per_thread)<n)
# Add any extra itterations due to n/num_threads not being an integer
local rng::RNG = getRNG()
for i in (num_threads * n_per_thread):n
result += f(rand(rng))
end
result /= n
else
result = sum(result_per_thread) / (num_threads * n_per_thread)
end
return result
end
# ╔═╡ fede99f4-d0b8-469d-bbe9-4756606b6f7d
function integrate_sobol_serial(f::Function, n::Integer; num_dim::Integer = 2)
s = SobolSeq(num_dim)
result = 0.0
tmp = zeros(num_dim)
for i in 1:n
next!(s,tmp)
result += f(tmp)
end
return result / n
end
# ╔═╡ 46ce3e37-92bd-4e77-bc4a-dfb2434843b2
function integrate_sobol_parallel(f::Function, n::Integer; num_dim::Integer = 2)
num_threads = Threads.nthreads()
s_per_thread = [ SobolSeq(num_dim) for t in 1:num_threads ]
result_per_thread = zeros(num_threads)
n_per_thread = div(n, num_threads )
#arg = zeros(num_dim, num_threads)
Threads.@threads for t in 1:num_threads
local s = s_per_thread[t]
local num_to_skip = n_per_thread * (t-1)
local arg = arg = zeros(num_dim)
if num_to_skip >= 1
#println("Helo from ",t)
s = skip(s,num_to_skip, exact=true)
end
for i in 1:n_per_thread
#next!(s, view(arg,:,t))
next!(s, arg)
#println("i = ", i, " x = ", view(arg,:,t), " t = ", t)
result_per_thread[t] += f(arg)
end
end
result = sum(result_per_thread)
if ((num_threads * n_per_thread)<n)
# Add any extra itterations due to n/num_threads not being an integer
local s = SobolSeq(num_dim)
local num_to_skip = n_per_thread * num_threads
s = skip(s,num_to_skip, exact=true)
local arg = zeros(num_dim)
for i in (num_threads * n_per_thread+1):n
next!(s, arg)
result += f(arg)
end
result /= n
else
result /= (num_threads * n_per_thread)
end
return result
end
# ╔═╡ 2ff8b895-cc26-4c9a-97a4-84b4aa010cb1
md"### Plot of Sampling Pattern"
# ╔═╡ 4750c434-1d5b-48f8-bfe8-3fb087eb1127
max_evals_2d_error_plt = 2^16;
# ╔═╡ eaab2562-0081-426b-9087-524c57cd7c2c
begin # pre-compute 2-d sampling patterns for interactive graphic below
Random.seed!(42)
p_uniform = QuasiMonteCarlo.sample(max_evals_2d_error_plt,zeros(2),ones(2),UniformSample())
p_sobol = QuasiMonteCarlo.sample(max_evals_2d_error_plt,zeros(2),ones(2),SobolSample())
p_lattice = QuasiMonteCarlo.sample(max_evals_2d_error_plt,zeros(2),ones(2),LatticeRuleSample())
p_lds = QuasiMonteCarlo.sample(max_evals_2d_error_plt,zeros(2),ones(2),LowDiscrepancySample([10,3]))
end;
# ╔═╡ 97f6edce-3bfd-4c53-9662-8d3304b41b7c
function integrate_uniform(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
Random.seed!(seed)
pts =
(num_dim==2) && (n<=size(p_uniform,2)) ? p_uniform : # try to reuse 2-d samples
QuasiMonteCarlo.sample(n,zeros(num_dim),ones(num_dim),UniformSample())
mapreduce(i->f(view(pts,:,i)), +, 1:n)/n
end
# ╔═╡ 638a3cf6-82ba-4411-a702-d0cde64e567b
function integrate_sobol(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
Random.seed!(seed)
pts =
(num_dim==2) && (n<=size(p_sobol,2)) ? p_sobol : # try to reuse 2-d samples
QuasiMonteCarlo.sample(n,zeros(num_dim),ones(num_dim),SobolSample())
mapreduce(i->f(view(pts,:,i)), +, 1:n)/n
end
# ╔═╡ 96713364-ebb1-4b9b-bb5e-0ff9d14bc1cf
function integrate_lattice(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
Random.seed!(seed)
pts =
(num_dim==2) && (n<=size(p_lattice,2)) ? p_lattice : # try to reuse 2-d samples
QuasiMonteCarlo.sample(n,zeros(num_dim),ones(num_dim),LatticeRuleSample())
mapreduce(i->f(view(pts,:,i)), +, 1:n)/n
end
# ╔═╡ 4332698d-3357-405a-8ad9-3bef0ed5ebfd
function integrate_lds(f::Function, n::Integer; seed::Integer = 42, num_dim::Integer = 2)
@assert 1 <= num_dim <= 10
base = [10,3,7,11,13,17,19,23,31,37][1:num_dim]
Random.seed!(seed)
pts =
(num_dim==2) && (n<=size(p_lds,2)) ? p_lds : # try to reuse 2-d samples
QuasiMonteCarlo.sample(n,zeros(num_dim),ones(num_dim),LowDiscrepancySample(base))
mapreduce(i->f(view(pts,:,i)), +, 1:n)/n
end
# ╔═╡ 4b078935-4ae8-4645-a676-b4d93096a0e8
max_max_evals_2d_plt = 2000;
# ╔═╡ 1d6bbc7f-707f-43cf-a09c-b636f714ee35
md"Number of samples: $(@bind max_evals_2d_plt Slider(1:max_max_evals_2d_plt; default=1))"
# ╔═╡ e650a01a-de89-464f-886e-ffdda6ad26c3
let
ms = 1
pltsize = (800,800)
plt_x = plt_y = range(0, stop = 1, length = 100)
errstr = "" #"\n(Δ = " * string(round(Δ_uniform_2d,digits=5)) * ")"
plt1 = scatter(view(p_uniform,1,1:max_evals_2d_plt), view(p_uniform,2,1:max_evals_2d_plt), xlims=(0,1), ylims=(0,1), legend=:none, ms=ms, size=pltsize, title="Monte Carlo\n(Uniform sample)" * errstr )
contour!(plt_x, plt_y, (x,y) -> f_gaussian_at_origin([x,y],sigma=sigma_sample))
errstr = "" #"\n(Δ = " * string(round(Δ_sobol_2d,digits=5)) * ")"
plt2 = scatter(view(p_sobol,1,1:max_evals_2d_plt), view(p_sobol,2,1:max_evals_2d_plt), xlims=(0,1), ylims=(0,1), legend=:none, ms=ms, size=pltsize, title="Sobol sequence" * errstr )
contour!(plt_x, plt_y, (x,y) -> f_gaussian_at_origin([x,y],sigma=sigma_sample))
errstr = "" #"\n(Δ = " * string(round(Δ_lattice_2d,digits=5)) * ")"
plt3 = scatter(view(p_lattice,1,1:max_evals_2d_plt), view(p_lattice,2,1:max_evals_2d_plt), xlims=(0,1), ylims=(0,1), legend=:none, ms=ms, size=pltsize, title="Lattice rule\n" * errstr )
contour!(plt_x, plt_y, (x,y) -> f_gaussian_at_origin([x,y],sigma=sigma_sample))
errstr = "" #"\n(Δ = " * string(round(Δ_lds_2d,digits=5)) * ")"
plt4 = scatter(view(p_lds,1,1:max_evals_2d_plt), view(p_lds,2,1:max_evals_2d_plt), xlims=(0,1), ylims=(0,1), legend=:none, ms=ms, size=pltsize, title="Low discrepancy sequence"*errstr )
contour!(plt_x, plt_y, (x,y) -> f_gaussian_at_origin([x,y],sigma=sigma_sample))
plot(plt1, plt2, plt3, plt4)
end
# ╔═╡ 9c7848f8-1c8b-4c05-a859-a2e32dcf4e90
md"### Error plot: 2-d Normal distribution"
# ╔═╡ 4c7942f1-ef77-460b-a40d-24a0c8961cdb
best_estimate_2d = hcubature(x->f_gaussian_at_origin(x,sigma=sigma_sample), zeros(2), ones(2), rtol=eps(Float64), atol=0, maxevals=1_000_000)[1];
# ╔═╡ 6fcce823-2e56-488a-b9e3-bb40aadb11e0
begin
Δgauss_uniform_2d(n::Integer) = (integrate_uniform(x->f_gaussian_at_origin(x,sigma=sigma_sample), n) - best_estimate_2d) / best_estimate_2d
Δgauss_sobol_2d(n::Integer) = (integrate_sobol(x->f_gaussian_at_origin(x,sigma=sigma_sample), n) - best_estimate_2d) / best_estimate_2d
Δgauss_lattice_2d(n::Integer) = (integrate_lattice(x->f_gaussian_at_origin(x,sigma=sigma_sample), n) - best_estimate_2d) / best_estimate_2d
Δgauss_lds_2d(n::Integer) = (integrate_lds(x->f_gaussian_at_origin(x,sigma=sigma_sample), n) - best_estimate_2d) / best_estimate_2d
end;
# ╔═╡ be807633-68c7-4b9a-91f7-a8cdaee56814
(;Δ_uniform = Δgauss_uniform_2d(max_evals_2d_plt), Δ_sobol=Δgauss_sobol_2d(max_evals_2d_plt), Δ_lattice=Δgauss_lattice_2d(max_evals_2d_plt), Δ_lds = Δgauss_lds_2d(max_evals_2d_plt))
# ╔═╡ e89d3d18-b3a8-490b-96f1-6fdf792178ac
n_to_test_mc_2d = 2 .^(1:log2_max_evals_2d);
# ╔═╡ 05fd15ad-5082-4091-bdf6-1c492c18b09d
begin
y_plt_gauss_2d_uniform = abs.(Δgauss_uniform_2d.(n_to_test_mc_2d))
y_plt_gauss_2d_sobol = abs.(Δgauss_sobol_2d.(n_to_test_mc_2d))
y_plt_gauss_2d_lattice = abs.(Δgauss_lattice_2d.(n_to_test_mc_2d))
y_plt_gauss_2d_lds = abs.(Δgauss_lds_2d.(n_to_test_mc_2d))
end;
# ╔═╡ 98e1c267-f13e-4e43-92a7-5e3384ed7c53
let
plt = plot(yaxis=:log, legend=:bottomleft)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_gauss_2d_uniform, label="Monte Carlo", markershape=:circle, color=1)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_gauss_2d_sobol, label="Sobol", markershape=:circle, alpha=0.5, color=2)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_gauss_2d_lattice, label="Lattice", markershape=:circle, alpha=0.5, color=3)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_gauss_2d_lds, label="LDS", markershape=:circle, alpha=0.5, color=4)
#plot!(plt,log10.(n_to_test_mc), abs.(estimates_hcubature .- best_estimate)./best_estimate, label="H-Cubature", markershape=:circle, color=5)
ylims!(10.0 .^ log10_y_axis_min,2)
xlabel!("log₁₀(Number of Evaluations)")
ylabel!("abs(Error)/(best estimate)")
title!("Error versus Number of Evaluations: 2-d Gaussian")
plt
end
# ╔═╡ 346ebd04-987c-4692-b899-1e500f56975b
md"### Error plot: 2-d Multiple Peaks"
# ╔═╡ 210cc590-52bd-43c4-a4e5-6c064f5a895b
md"### Error plot: High-d"
# ╔═╡ 4df8579f-9757-488e-8103-44e2ed680cb2
md"### Apperances"
# ╔═╡ d5f5fbe6-b75b-4874-bb20-e562287ed51b
TableOfContents()
# ╔═╡ a0a1ca74-3c26-461b-8ae6-b0a4b8caa53e
nbsp = html" ";
# ╔═╡ 3da61e81-2619-4206-be08-38ed262cb517
md"Redraw peak locations: $(@bind regen_multipeaks_2d Button()) $nbsp $nbsp "
# ╔═╡ e28ebf18-a1a3-4449-94fb-0dea42093cff
begin
regen_multipeaks_2d
const num_peaks_2d = 4
const peak_centers_2d = rand(2, num_peaks_2d)
function f_multipeaks_2d(x; sigma::Real )
result = 0.0
for i in 1:num_peaks_2d
result += exp(-sum((x.-peak_centers_2d[:,i]).^2)/(2*sigma^2))
end
return result
end
func_to_integrate_2d = f_multipeaks_2d
end;
# ╔═╡ d8a19f6d-da16-486a-a705-b907c454b0e3
let
x = y = range(0, stop = 1, length = 100)
contour(x, y, (x,y) -> func_to_integrate_2d([x,y], sigma=sigma_err) , size=(400,400))
xlabel!("x")
ylabel!("y")
end
# ╔═╡ 87a5ee82-0287-4003-8d18-d626fd48c7dc
begin
best_estimate_alt_2d = hcubature(x->func_to_integrate_2d(x,sigma=sigma_err), zeros(2), ones(2), rtol=eps(Float64), atol=0, maxevals=1_000_000)[1]
Δuser_uniform_2d(n::Integer) = (integrate_uniform(x->func_to_integrate_2d(x,sigma=sigma_err), n) - best_estimate_alt_2d) / best_estimate_alt_2d
Δuser_sobol_2d(n::Integer) = (integrate_sobol(x->func_to_integrate_2d(x,sigma=sigma_err), n) - best_estimate_alt_2d) / best_estimate_alt_2d
Δuser_lattice_2d(n::Integer) = (integrate_lattice(x->func_to_integrate_2d(x,sigma=sigma_err), n) - best_estimate_alt_2d) / best_estimate_alt_2d
Δuser_lds_2d(n::Integer) = (integrate_lds(x->func_to_integrate_2d(x,sigma=sigma_err), n) - best_estimate_alt_2d) / best_estimate_alt_2d
#Δuser_hcubature_2d(n::Integer) = (hcubature(x->func_to_integrate_2d(x,sigma=sigma_err), zeros(2), ones(2), rtol=eps(Float64), atol=0, maxevals=n)[1] - best_estimate_alt_2d) / best_estimate_alt_2d
end;
# ╔═╡ 39b132ea-e49c-4641-8293-55f59ee649df
begin # Precompute values for next plot
y_plt_user_2d_uniform = abs.(Δuser_uniform_2d.(n_to_test_mc_2d))
y_plt_user_2d_sobol = abs.(Δuser_sobol_2d.(n_to_test_mc_2d))
y_plt_user_2d_lattice = abs.(Δuser_lattice_2d.(n_to_test_mc_2d))
y_plt_user_2d_lds = abs.(Δuser_lds_2d.(n_to_test_mc_2d))
end;
# ╔═╡ 44dc0410-eef2-4cba-b5d5-a1d849650d47
let
plt = plot(yaxis=:log, legend=:bottomleft)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_user_2d_uniform, label="Monte Carlo", markershape=:circle, color=1)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_user_2d_sobol, label="Sobol", markershape=:circle, alpha=0.5, color=2)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_user_2d_lattice, label="Lattice", markershape=:circle, alpha=0.5, color=3)
plot!(plt,log10.(n_to_test_mc_2d), y_plt_user_2d_lds, label="LDS", markershape=:circle, alpha=0.5, color=4)
#plot!(plt,log10.(n_to_test_mc_2d), abs.(Δuser_hcubature_2d.(n_to_test_mc_2d)), label="H-Cubature", markershape=:circle, color=5)
ylims!(10.0 .^ log10_y_axis_min_2d,2)
xlabel!("log₁₀(Number of Evaluations)")
ylabel!("abs(Error)/(best estimate)")
title!("Error versus Number of Evaluations:\n2-d Mixture of Gaussians")
plt
end
# ╔═╡ 82c1c073-d97a-41f5-98a1-4630fb41d095
@bind ndim_plt_param confirm(
PlutoUI.combine() do Child
md"""
Number of dimensions for integrand: $(Child("num_dim", NumberField(1:12, default=2)))
$nbsp $nbsp
σ: $(Child("sigma", NumberField(0.02:0.02:1.0, default=0.2)))
$nbsp $nbsp
log₂(Max evaluations):
$(Child("log2_max_evals", NumberField(8:17, default=14)))
"""
end
)
# ╔═╡ 3cc73fc1-bec4-4bfa-9094-3a114226468e
begin
num_dim = ndim_plt_param.num_dim
sigma_err_highd = ndim_plt_param.sigma
log2_max_evals = ndim_plt_param.log2_max_evals
n_to_test_mc = 2 .^(1:log2_max_evals)
end;
# ╔═╡ 58788411-f41e-45d7-a11c-88307d82dc57
begin
regen_multipeaks_highd
const num_peaks = 4
const peak_centers = rand(num_dim, num_peaks)
function f_multipeaks(x; sigma::Real)
result = 0.0
for i in 1:num_peaks
result += exp(-sum((x.-peak_centers[:,i]).^2)/(2*sigma^2))
end
return result
end
end;
# ╔═╡ 0ff55d52-b17e-42a3-83d0-6cbb1a812f29
if func_to_integrate_2d == f_multipeaks_2d
func_to_integrate = f_multipeaks
else
func_to_integrate = f_gaussian_at_origin
end
# ╔═╡ 1c0c9b4c-bf8e-4257-a839-e4a02542cdfd
begin
best_estimate = hcubature(x->func_to_integrate(x,sigma=sigma_err_highd), zeros(num_dim), ones(num_dim), rtol=1e-16, atol=0.0, maxevals=1_000_000)[1]
(;best_estimate )
end
# ╔═╡ d09876c9-7181-4d58-8fff-82453e43541c
if use_threads
estimates_mc = integrate_monte_carlo_parallel.(x->func_to_integrate(x,sigma=sigma_err_highd), n_to_test_mc,num_dim=num_dim)
else
estimates_mc = integrate_monte_carlo_serial.(x->func_to_integrate(x,sigma=sigma_err_highd), n_to_test_mc,num_dim=num_dim)
end;
# ╔═╡ 7859fa4f-3c5c-425f-9c15-ce0da7a85990
if use_threads
estimates_sobol = integrate_sobol_parallel.(x->func_to_integrate(x,sigma=sigma_err_highd), n_to_test_mc,num_dim=num_dim)
else
estimates_sobol = integrate_sobol_serial.(x->func_to_integrate(x,sigma=sigma_err_highd), n_to_test_mc,num_dim=num_dim)
end;
# ╔═╡ 00b690af-20f4-43ea-afae-28d655c8ea13
begin
estimates_hcubature_tmp = map(n->hcubature(x->func_to_integrate(x,sigma=sigma_err_highd), zeros(num_dim), ones(num_dim), rtol=eps(Float64), atol=0, maxevals=n), n_to_test_mc)
estimates_hcubature = map(x->x[1], estimates_hcubature_tmp)
estimates_hcubature_error = map(x->x[2], estimates_hcubature_tmp)
end;
# ╔═╡ 9e6e6850-7320-4cfb-9528-b3467be70a69
begin
plt = plot(yaxis=:log, legend=:bottomleft)
plot!(plt,log10.(n_to_test_mc), abs.(estimates_mc .- best_estimate)./best_estimate, label="Monte Carlo", markershape=:circle, color=1)
plot!(plt,log10.(n_to_test_mc), abs.(estimates_sobol .- best_estimate)./best_estimate, label="Sobol", markershape=:circle, alpha=0.5, color=2)
plot!(plt,log10.(n_to_test_mc), abs.(estimates_hcubature .- best_estimate)./best_estimate,
label="H-Cubature", markershape=:circle, color=3)
ylims!(10.0 .^ log10_y_axis_min,2)
xlabel!("log₁₀(Number of Evaluations)")
ylabel!("abs(Error)/(best estimate)")
title!("Error versus Number of Evaluations:\n" * string(num_dim) * "-d Mixture of Gaussians")
plt
end
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
RNGPool = "c7fc2d14-d53c-5e81-ac30-66aba9c03525"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Sobol = "ed01d8cd-4d21-5b2a-85b4-cc3bdc58bad4"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[compat]
HCubature = "~1.5.0"
Plots = "~1.29.0"
PlutoUI = "~0.7.38"
QuasiMonteCarlo = "~0.2.4"
RNGPool = "~2.0.0"
Sobol = "~1.5.0"
StaticArrays = "~1.4.4"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.7.0"
manifest_format = "2.0"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.1.4"
[[deps.Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "af92965fb30777147966f58acb05da51c5616b5f"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.3.3"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+0"
[[deps.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 = "4b859a208b2397a7a623a03449e4636bdb17bcf2"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.1+1"
[[deps.Calculus]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
version = "0.5.1"
[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "9950387274246d08af38f6eef8cb5480862a435f"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.14.0"
[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
git-tree-sha1 = "1e315e3f4b0b7ce40feded39c73049692126cf53"
uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
version = "0.1.3"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random"]
git-tree-sha1 = "7297381ccb5df764549818d9a7d57e45f1057d30"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.18.0"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "a985dc37e357a3b22b260a5def99f3530fb415d3"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.2"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"]
git-tree-sha1 = "3f1f500312161f1ae067abe07d13b40f78f32e07"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.9.8"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.8"
[[deps.Combinatorics]]
git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860"
uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
version = "1.0.2"
[[deps.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 = "b153278a25dd42c65abbf4e62344f9d22e59191b"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.43.0"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
[[deps.Contour]]
deps = ["StaticArrays"]
git-tree-sha1 = "9f02045d934dc030edad45944ea80dbd1f0ebea7"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.7"
[[deps.DataAPI]]
git-tree-sha1 = "fb5f5316dd3fd4c5e7c30a24d50643b73e37cd40"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.10.0"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "cc1a8e22627f33c789ab60b36a9132ac050bbf75"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.12"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[deps.DensityInterface]]
deps = ["InverseFunctions", "Test"]
git-tree-sha1 = "80c3e8639e3353e5d2912fb3a1916b8455e2494b"
uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
version = "0.4.0"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
git-tree-sha1 = "8a6b49396a4058771c5c072239b2e0a76e2e898c"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.58"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.6"
[[deps.Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
[[deps.DualNumbers]]
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
version = "0.6.8"
[[deps.EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "3f3a2501fa7236e9b911e0f7a588c657e822bb6d"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.2.3+0"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.4.8+0"
[[deps.FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.1"
[[deps.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"
[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "246621d23d1f43e3b9c368bf3b72b2331a27c286"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.13.2"
[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"
[[deps.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"
[[deps.Formatting]]
deps = ["Printf"]
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"
[[deps.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"
[[deps.FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.10+0"
[[deps.GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "51d2dfe8e590fbd74e7a842cf6d13d8a2f45dc01"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.6+0"
[[deps.GR]]
deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Printf", "Random", "RelocatableFolders", "Serialization", "Sockets", "Test", "UUIDs"]
git-tree-sha1 = "b316fd18f5bc025fedcb708332aecb3e13b9b453"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.64.3"
[[deps.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 = "1e5490a51b4e9d07e8b04836f6008f46b48aaa87"
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
version = "0.64.3+0"
[[deps.GeometryBasics]]
deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
git-tree-sha1 = "83ea630384a13fc4f002b77690bc0afeb4255ac9"
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
version = "0.4.2"
[[deps.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"
[[deps.Glib_jll]]
deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "a32d672ac2c967f3deb8a81d828afc739c838a06"
uuid = "7746bdde-850d-59dc-9ae8-88ece973131d"
version = "2.68.3+2"
[[deps.Graphite2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011"
uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472"
version = "1.3.14+0"
[[deps.Grisu]]
git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2"
uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.2"
[[deps.HCubature]]
deps = ["Combinatorics", "DataStructures", "LinearAlgebra", "QuadGK", "StaticArrays"]
git-tree-sha1 = "134af3b940d1ca25b19bc9740948157cee7ff8fa"
uuid = "19dc6840-f33b-545b-b366-655c7e3ffd49"
version = "1.5.0"
[[deps.HTTP]]
deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"]
git-tree-sha1 = "0fa77022fe4b511826b39c894c90daf5fce3334a"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.9.17"
[[deps.HarfBuzz_jll]]
deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"]
git-tree-sha1 = "129acf094d168394e80ee1dc4bc06ec835e510a3"
uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566"
version = "2.8.1+1"
[[deps.HypergeometricFunctions]]
deps = ["DualNumbers", "LinearAlgebra", "SpecialFunctions", "Test"]
git-tree-sha1 = "cb7099a0109939f16a4d3b572ba8396b1f6c7c31"
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
version = "0.3.10"
[[deps.Hyperscript]]
deps = ["Test"]
git-tree-sha1 = "8d511d5b81240fc8e6802386302675bdf47737b9"
uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91"
version = "0.0.4"
[[deps.HypertextLiteral]]
deps = ["Tricks"]
git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9"
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
version = "0.9.4"
[[deps.IOCapture]]
deps = ["Logging", "Random"]
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
version = "0.2.2"
[[deps.IniFile]]
git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.1"
[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[deps.InverseFunctions]]
deps = ["Test"]
git-tree-sha1 = "336cc738f03e069ef2cac55a104eb823455dca75"
uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.4"
[[deps.IrrationalConstants]]
git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
version = "0.1.1"
[[deps.IterTools]]
git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.4.0"
[[deps.IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"
[[deps.JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.4.1"
[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.3"
[[deps.JpegTurbo_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "b53380851c6e6664204efb2e62cd24fa5c47e4ba"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "2.1.2+0"
[[deps.LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c"
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
version = "3.100.1+0"
[[deps.LERC_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434"
uuid = "88015f11-f218-50d7-93a8-a6af411a945d"
version = "3.0.0+1"
[[deps.LZO_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6"
uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac"
version = "2.10.1+0"
[[deps.LaTeXStrings]]
git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.0"
[[deps.Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"]
git-tree-sha1 = "46a39b9c58749eefb5f2dc1178cb8fab5332b1ab"
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
version = "0.15.15"
[[deps.LatinHypercubeSampling]]
deps = ["Random", "StableRNGs", "StatsBase", "Test"]
git-tree-sha1 = "42938ab65e9ed3c3029a8d2c58382ca75bdab243"
uuid = "a5e1c1ea-c99a-51d3-a14d-a9a37257b02d"
version = "1.8.0"
[[deps.LatticeRules]]
deps = ["Random"]
git-tree-sha1 = "7f5b02258a3ca0221a6a9710b0a0a2e8fb4957fe"
uuid = "73f95e8e-ec14-4e6a-8b18-0d2e271c4e55"
version = "0.0.1"
[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
[[deps.LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[deps.Libffi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "0b4a5d71f3e5200a7dff793393e09dfc2d874290"
uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490"
version = "3.2.2+1"
[[deps.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"
[[deps.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"
[[deps.Libgpg_error_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c333716e46366857753e273ce6a69ee0945a6db9"
uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8"
version = "1.42.0+0"