Skip to content

Commit c50978f

Browse files
committed
Deploy preview for PR 595
1 parent 0956a42 commit c50978f

File tree

31 files changed

+62991
-62997
lines changed

31 files changed

+62991
-62997
lines changed

pr-previews/595/core-functionality/index.html

Lines changed: 253 additions & 253 deletions
Large diffs are not rendered by default.

pr-previews/595/developers/compiler/minituring-compiler/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -790,16 +790,16 @@ <h1>Consider a probabilistic model defined by</h1>
790790
parameters mean std mcse ess_bulk ess_tail rh ⋯
791791
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯
792792

793-
a 0.9747 0.9007 0.0031 82026.3634 122309.9731 1.00 ⋯
794-
b 2.8816 0.4886 0.0012 171062.4932 209650.4952 1.00 ⋯
793+
a 0.9760 0.9007 0.0032 80731.7675 120488.2200 1.00 ⋯
794+
b 2.8800 0.4888 0.0012 172720.7916 212226.5059 1.00 ⋯
795795
2 columns omitted
796796

797797
Quantiles
798798
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
799799
Symbol Float64 Float64 Float64 Float64 Float64
800800

801-
a -0.7897 0.3659 0.9743 1.5850 2.7383
802-
b 1.9234 2.5516 2.8814 3.2114 3.8358</code></pre>
801+
a -0.7805 0.3673 0.9745 1.5822 2.7469
802+
b 1.9180 2.5521 2.8813 3.2079 3.8368</code></pre>
803803
</div>
804804
</div>
805805
<p>We compare these results with Turing.</p>
@@ -821,25 +821,25 @@ <h1>Consider a probabilistic model defined by</h1>
821821
Iterations = 1:1:1000000
822822
Number of chains = 1
823823
Samples per chain = 1000000
824-
Wall duration = 25.22 seconds
825-
Compute duration = 25.22 seconds
824+
Wall duration = 26.2 seconds
825+
Compute duration = 26.2 seconds
826826
parameters = a, b
827827
internals = lp
828828

829829
Summary Statistics
830830
parameters mean std mcse ess_bulk ess_tail rh ⋯
831831
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯
832832

833-
a 0.9780 0.8965 0.0031 81331.2466 121632.3894 1.00 ⋯
834-
b 2.8800 0.4869 0.0012 174940.8942 217255.1359 1.00 ⋯
833+
a 0.9737 0.8976 0.0032 79648.3368 118541.8850 1.00 ⋯
834+
b 2.8793 0.4878 0.0012 173338.5201 213218.2005 1.00 ⋯
835835
2 columns omitted
836836

837837
Quantiles
838838
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
839839
Symbol Float64 Float64 Float64 Float64 Float64
840840

841-
a -0.7744 0.3730 0.9754 1.5834 2.7378
842-
b 1.9250 2.5516 2.8805 3.2078 3.8340</code></pre>
841+
a -0.7822 0.3700 0.9735 1.5802 2.7348
842+
b 1.9239 2.5496 2.8799 3.2067 3.8349</code></pre>
843843
</div>
844844
</div>
845845
<p>As you can see, with our simple probabilistic programming language and custom samplers we get similar results as Turing.</p>

pr-previews/595/developers/compiler/minituring-contexts/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -806,16 +806,16 @@ <h2 class="anchored" data-anchor-id="contexts-within-contexts">Contexts within c
806806
parameters mean std mcse ess_bulk ess_tail rh ⋯
807807
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯
808808

809-
a 0.9700 0.8992 0.0032 79773.3681 121136.1320 1.00 ⋯
810-
b 2.8801 0.4893 0.0012 174324.9084 214680.7161 1.00 ⋯
809+
a 0.9813 0.8978 0.0031 81468.0769 121907.3012 1.00 ⋯
810+
b 2.8795 0.4869 0.0012 170892.5183 213367.5156 1.00 ⋯
811811
2 columns omitted
812812

813813
Quantiles
814814
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
815815
Symbol Float64 Float64 Float64 Float64 Float64
816816

817-
a -0.7926 0.3629 0.9700 1.5776 2.7335
818-
b 1.9240 2.5503 2.8786 3.2103 3.8371</code></pre>
817+
a -0.7718 0.3765 0.9798 1.5852 2.7413
818+
b 1.9261 2.5514 2.8784 3.2081 3.8332</code></pre>
819819
</div>
820820
</div>
821821
<p>or we can choose to sample from the prior instead</p>
@@ -833,16 +833,16 @@ <h2 class="anchored" data-anchor-id="contexts-within-contexts">Contexts within c
833833
parameters mean std mcse ess_bulk ess_tail rha ⋯
834834
Symbol Float64 Float64 Float64 Float64 Float64 Float6 ⋯
835835

836-
a 0.5081 1.0009 0.0040 63848.5093 126084.8877 1.000 ⋯
837-
b 0.5345 2.2354 0.0137 26554.2368 52304.1094 1.000 ⋯
836+
a 0.5059 0.9985 0.0039 64079.3287 125487.8541 1.000 ⋯
837+
b 0.5248 2.2249 0.0135 27223.2601 51705.1529 1.000 ⋯
838838
2 columns omitted
839839

840840
Quantiles
841841
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
842842
Symbol Float64 Float64 Float64 Float64 Float64
843843

844-
a -1.4502 -0.1670 0.5090 1.1807 2.4749
845-
b -3.8499 -0.9714 0.5319 2.0427 4.9190</code></pre>
844+
a -1.4535 -0.1669 0.5047 1.1803 2.4631
845+
b -3.8238 -0.9768 0.5233 2.0247 4.8845</code></pre>
846846
</div>
847847
</div>
848848
<p>Of course, using an MCMC algorithm to sample from the prior is unnecessary and silly (<code>PriorSampler</code> exists, after all), but the point is to illustrate the flexibility of the context system. We could, for instance, use the same setup to implement an <em>Approximate Bayesian Computation</em> (ABC) algorithm.</p>

pr-previews/595/developers/compiler/model-manual/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,33 +592,33 @@ <h1 class="title">Manually Defining a Model</h1>
592592
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>chain <span class="op">=</span> <span class="fu">sample</span>(model2, <span class="fu">NUTS</span>(), <span class="fl">1000</span>; progress<span class="op">=</span><span class="cn">false</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
593593
<div class="cell-output cell-output-stdout">
594594
<pre><code>┌ Info: Found initial step size
595-
└ ϵ = 1.6</code></pre>
595+
└ ϵ = 0.40156250000000004</code></pre>
596596
</div>
597597
<div class="cell-output cell-output-display" data-execution_count="1">
598598
<pre><code>Chains MCMC chain (1000×14×1 Array{Float64, 3}):
599599

600600
Iterations = 501:1:1500
601601
Number of chains = 1
602602
Samples per chain = 1000
603-
Wall duration = 7.0 seconds
604-
Compute duration = 7.0 seconds
603+
Wall duration = 7.06 seconds
604+
Compute duration = 7.06 seconds
605605
parameters = s², m
606606
internals = lp, n_steps, is_accept, acceptance_rate, log_density, hamiltonian_energy, hamiltonian_energy_error, max_hamiltonian_energy_error, tree_depth, numerical_error, step_size, nom_step_size
607607

608608
Summary Statistics
609609
parameters mean std mcse ess_bulk ess_tail rhat e ⋯
610610
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯
611611

612-
1.9601 1.3328 0.0540 600.8646 546.4442 1.0012
613-
m 1.1683 0.7848 0.0340 562.4482 437.9750 1.0032
612+
2.2007 2.5247 0.1137 544.5446 508.3799 1.0006
613+
m 1.1473 0.9383 0.0507 378.6155 250.9748 1.0025
614614
1 column omitted
615615

616616
Quantiles
617617
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
618618
Symbol Float64 Float64 Float64 Float64 Float64
619619

620-
s² 0.6118 1.1023 1.5378 2.3657 5.3941
621-
m -0.3938 0.6944 1.1383 1.6570 2.8230</code></pre>
620+
s² 0.5767 1.0471 1.5693 2.4678 7.1462
621+
m -0.6157 0.6261 1.1423 1.6506 2.9996</code></pre>
622622
</div>
623623
</div>
624624
<p>The subsequent pages in this section will show how the <code>@model</code> macro does this behind-the-scenes.</p>

pr-previews/595/developers/inference/abstractmcmc-turing/index.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -602,29 +602,29 @@ <h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
602602
<div class="cell-output cell-output-display" data-execution_count="1">
603603
<pre><code>Chains MCMC chain (1000×3×1 Array{Float64, 3}):
604604

605-
Log evidence = -3.6925442899273504
605+
Log evidence = -3.7375070329283036
606606
Iterations = 1:1:1000
607607
Number of chains = 1
608608
Samples per chain = 1000
609-
Wall duration = 2.33 seconds
610-
Compute duration = 2.33 seconds
609+
Wall duration = 2.43 seconds
610+
Compute duration = 2.43 seconds
611611
parameters = s², m
612612
internals = lp
613613

614614
Summary Statistics
615615
parameters mean std mcse ess_bulk ess_tail rhat e ⋯
616616
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯
617617

618-
2.9843 4.9682 0.1749 867.1844 848.7930 0.9998
619-
m 0.0293 1.6744 0.0534 980.5331 935.0420 1.0033
618+
3.3008 7.8367 0.2521 961.8998 909.1658 1.0015
619+
m -0.0104 1.8637 0.0646 850.3747 907.7013 1.0024
620620
1 column omitted
621621

622622
Quantiles
623623
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
624624
Symbol Float64 Float64 Float64 Float64 Float64
625625

626-
s² 0.5675 1.1544 1.7931 3.1137 13.0915
627-
m -3.2633 -0.8992 -0.0174 0.9746 3.2300</code></pre>
626+
s² 0.4883 1.0740 1.8273 3.0697 12.9955
627+
m -3.4519 -0.8861 0.0061 0.9276 3.2017</code></pre>
628628
</div>
629629
</div>
630630
<p>The function <code>sample</code> is part of the AbstractMCMC interface. As explained in the <a href="../../../developers/inference/abstractmcmc-interface">interface guide</a>, building a sampling method that can be used by <code>sample</code> consists in overloading the structs and functions in <code>AbstractMCMC</code>. The interface guide also gives a standalone example of their implementation, <a href=""><code>AdvancedMH.jl</code></a>.</p>
@@ -657,29 +657,29 @@ <h2 class="anchored" data-anchor-id="define-a-sampler">1. Define a Sampler</h2>
657657
<div class="cell-output cell-output-display" data-execution_count="1">
658658
<pre><code>Chains MCMC chain (1000×3×1 Array{Float64, 3}):
659659

660-
Log evidence = -3.7397789033288222
660+
Log evidence = -3.7392719878389404
661661
Iterations = 1:1:1000
662662
Number of chains = 1
663663
Samples per chain = 1000
664-
Wall duration = 0.05 seconds
665-
Compute duration = 0.05 seconds
664+
Wall duration = 0.08 seconds
665+
Compute duration = 0.08 seconds
666666
parameters = s², m
667667
internals = lp
668668

669669
Summary Statistics
670-
parameters mean std mcse ess_bulk ess_tail rhat e
671-
Symbol Float64 Float64 Float64 Float64 Float64 Float64
670+
parameters mean std mcse ess_bulk ess_tail rhat ⋯
671+
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯
672672

673-
2.8472 5.6368 0.1790 954.4790 936.1210 0.9991
674-
m -0.0300 1.5565 0.0493 994.3769 939.1381 1.0008
673+
3.1085 4.2442 0.1290 1098.8349 811.7211 0.9996
674+
m 0.0993 1.7371 0.0544 1027.5554 1001.3049 1.0014
675675
1 column omitted
676676

677677
Quantiles
678678
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
679679
Symbol Float64 Float64 Float64 Float64 Float64
680680

681-
s² 0.5293 1.0280 1.7247 2.9269 10.5748
682-
m -3.2598 -0.8469 -0.0246 0.8405 2.9648</code></pre>
681+
s² 0.5256 1.1410 1.9238 3.4616 13.6082
682+
m -3.4214 -0.8741 0.0767 0.9377 3.6845</code></pre>
683683
</div>
684684
</div>
685685
<p>Here <code>sample</code> takes as arguments a <strong>model</strong> <code>mod</code>, an <strong>algorithm</strong> <code>alg</code>, and a <strong>number of samples</strong> <code>n_samples</code>, and returns an instance <code>chn</code> of <code>Chains</code> which can be analysed using the functions in <code>MCMCChains</code>.</p>

0 commit comments

Comments
 (0)