Metropolis-Hastings en Scala

Tengo la sensación de que un lenguaje funcional (como Scala) está particularmente bien adaptado al tipo de operaciones que exige MCMC.

Juzguen Vds.

Primero, genero datos en R:

  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
datos <- rnorm(500, 0.7, 1)
writeLines(as.character(datos), "/tmp/datos.txt")
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">35
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">36
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">37
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">38
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">39
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">40
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">41
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">42
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">43
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">44
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">45
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">46
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">47
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">48
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">49
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">50
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">51
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">52
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">53
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">54
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">55
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">56
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">57
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">58
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">59
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">60
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">61
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">62
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">63
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">64
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">65
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">66
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">67
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">68
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">69
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">70
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">71
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">72
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">73
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">74
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">75
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">76
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">77
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">78
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">79
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">80
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">81
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">82
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">83
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">84
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">85
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">86
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">87
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">88
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">89
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">90
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">91
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">92
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">93
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">94
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">95
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">96
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">97
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-R" data-lang="R">Son de una normal con media <span style="color:#ae81ff">0.7</span>. En el modelo que vamos a crear, suponemos <span style="color:#a6e22e">conocida </span>(e igual a <span style="color:#ae81ff">1</span>) la varianza de la normal y trataremos de estimar la media suponiéndole una distribución a priori normal estándar. Y con Scala, así<span style="color:#f92672">:</span>

<span style="color:#f92672">&lt;</span>div class<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;highlight&#34;</span><span style="color:#f92672">&gt;&lt;</span>div style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;</span><span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>table style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;&#34;</span><span style="color:#f92672">&gt;&lt;</span>tr<span style="color:#f92672">&gt;&lt;</span>td style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;vertical-align:top;padding:0;margin:0;border:0;&#34;</span><span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>pre tabindex<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0&#34;</span> style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;</span><span style="color:#f92672">&gt;&lt;</span>code<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">1</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">2</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">3</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">4</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">5</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">6</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">7</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">8</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">9</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">10</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">11</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">12</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">13</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">14</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">15</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">16</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">17</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">18</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">19</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">20</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">21</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">22</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">23</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">24</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">25</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">26</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">27</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">28</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">29</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">30</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">31</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">32</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">33</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">34</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">35</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">36</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">37</span>
<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;/</span>code<span style="color:#f92672">&gt;&lt;/</span>pre<span style="color:#f92672">&gt;&lt;/</span>td<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>td style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;vertical-align:top;padding:0;margin:0;border:0;;width:100%&#34;</span><span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>pre tabindex<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0&#34;</span> style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;</span><span style="color:#f92672">&gt;&lt;</span>code class<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;language-Scala&#34;</span> data<span style="color:#f92672">-</span>lang<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;Scala&#34;</span><span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>import<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> scala.io.Source
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>import<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> java.io.PrintWriter

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> read data <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>val<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> source <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#a6e22e&#34;</span><span style="color:#f92672">&gt;</span>Source<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>fromFile<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#e6db74&#34;</span><span style="color:#f92672">&gt;&amp;</span><span style="color:#75715e">#34;/tmp/datos.txt&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;UTF-8&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>val<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> data <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> source<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>mkString<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>split<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#e6db74&#34;</span><span style="color:#f92672">&gt;&amp;</span><span style="color:#75715e">#34;\\s+&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;).&lt;/span&gt;map&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;_&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;toDouble&lt;span style=&#34;color:#f92672&#34;&gt;).&lt;/span&gt;toList</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> we need random numbers <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>var<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> r <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> scala<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>util<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#a6e22e&#34;</span><span style="color:#f92672">&gt;</span>Random<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> <span style="color:#a6e22e">almost </span>(standard) dnorm <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>def<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> dnorm<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> math<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>exp<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">-&lt;/</span>span<span style="color:#f92672">&gt;</span>x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;*&lt;/</span>span<span style="color:#f92672">&gt;</span>x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;/&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">2</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> chain transitions <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>def<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> rg<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>y<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> y <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;+&lt;/</span>span<span style="color:#f92672">&gt;</span> r<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>nextGaussian

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> <span style="color:#a6e22e">prior </span>(standard normal) times likelihood <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>def<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> dpost<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> dnorm<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;*&lt;/</span>span<span style="color:#f92672">&gt;</span> data<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>map<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>y <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&amp;</span>gt;<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> dnorm<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>x <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;-&lt;/</span>span<span style="color:#f92672">&gt;</span> y<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)).&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>reduce<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>_<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;*&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>_<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> metropolis<span style="color:#f92672">-</span>hastings acceptance ratio <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>def<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> acceptanceRatio<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>from<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>,<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> to<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> dpost<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>to<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;/&lt;/</span>span<span style="color:#f92672">&gt;</span> dpost<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>from<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>def<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> posterior<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>a<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;:&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Stream<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>[<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>Double<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>]<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>{<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>
    <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>lazy<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>val<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> elegidos <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#a6e22e&#34;</span><span style="color:#f92672">&gt;</span>Stream<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>continually<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>a<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> map rg filter <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>x <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&amp;</span>gt;<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> r<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>nextDouble <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;&amp;</span>lt;<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> acceptanceRatio<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>a<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>,<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> x<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>))<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>
    a <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#75715e">#&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;posterior&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;elegidos.head&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>}<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> Get values and drop burning obs <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>val<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> res <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> posterior<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">0.4</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>).&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>take<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">10000</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>).&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>toList<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>drop<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">2000</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#75715e&#34;</span><span style="color:#f92672">&gt;/*</span> Thin <span style="color:#f92672">*/&lt;/</span>span<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>val<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> res_thin <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> res zip <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#a6e22e&#34;</span><span style="color:#f92672">&gt;</span>Stream<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> from <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">1</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span> filter <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>(<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#66d9ef&#34;</span><span style="color:#f92672">&gt;</span>_<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;</span>.&lt;<span style="color:#f92672">/</span>span<span style="color:#f92672">&gt;</span>_2 <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;%&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; map &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;_&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;_1&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;
</span><span style="color:#f92672">
</span><span style="color:#f92672">&lt;span style=&#34;color:#75715e&#34;&gt;/* Export */&lt;/span&gt;
</span><span style="color:#f92672">&lt;span style=&#34;color:#66d9ef&#34;&gt;val&lt;/span&gt; out &lt;span style=&#34;color:#66d9ef&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PrintWriter&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/tmp/posterior.txt&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;
</span><span style="color:#f92672">res map out&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;println
</span><span style="color:#f92672">out&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;close&lt;span style=&#34;color:#f92672&#34;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
</span><span style="color:#f92672">&lt;/div&gt;
</span><span style="color:#f92672">&lt;/div&gt;
</span><span style="color:#f92672">
</span><span style="color:#f92672">Leo los datos de la posteriori en R y los represento así:
</span><span style="color:#f92672">
</span><span style="color:#f92672">&lt;div class=&#34;highlight&#34;&gt;&lt;div style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;
</span><span style="color:#f92672">&lt;table style=&#34;border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;&#34;&gt;&lt;tr&gt;&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;&#34;&gt;
</span><span style="color:#f92672">&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code&gt;&lt;span style=&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;1
</span><span style="color:#f92672">&lt;/span&gt;&lt;span style=&#34;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;2
</span><span style="color:#f92672">&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
</span><span style="color:#f92672">&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;;width:100%</span><span style="color:#e6db74">&#34;&gt;
</span><span style="color:#e6db74">&lt;pre tabindex=&#34;</span><span style="color:#ae81ff">0</span><span style="color:#e6db74">&#34; style=&#34;</span>color<span style="color:#f92672">:</span><span style="color:#75715e">#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-R&#34; data-lang=&#34;R&#34;&gt;posterior &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;as.double&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;readLines&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/tmp/posterior.txt&amp;#34;&lt;/span&gt;))</span>
<span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#a6e22e&#34;</span><span style="color:#f92672">&gt;</span>hist<span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>(posterior, breaks <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#f92672&#34;</span><span style="color:#f92672">&gt;=&lt;/</span>span<span style="color:#f92672">&gt;</span> <span style="color:#f92672">&lt;</span>span style<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;color:#ae81ff&#34;</span><span style="color:#f92672">&gt;</span><span style="color:#ae81ff">50</span><span style="color:#f92672">&lt;/</span>span<span style="color:#f92672">&gt;</span>)<span style="color:#f92672">&lt;/</span>code<span style="color:#f92672">&gt;&lt;/</span>pre<span style="color:#f92672">&gt;&lt;/</span>td<span style="color:#f92672">&gt;&lt;/</span>tr<span style="color:#f92672">&gt;&lt;/</span>table<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;/</span>div<span style="color:#f92672">&gt;</span>
<span style="color:#f92672">&lt;/</span>div<span style="color:#f92672">&gt;</span>

<span style="color:#f92672">!</span>[posteriori_scala<span style="color:#a6e22e">]</span>(<span style="color:#f92672">/</span>wp<span style="color:#f92672">-</span>uploads<span style="color:#f92672">/</span><span style="color:#ae81ff">2016</span><span style="color:#f92672">/</span><span style="color:#ae81ff">06</span><span style="color:#f92672">/</span>posteriori_scala.png<span style="color:#75715e">#center)</span></code></pre></td></tr></table>
</div>
</div>