102 |
103 |
104 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
126 |
127 |
128 |
Tests to check that the OU-prior implemented in BEAST2 is correct. In particular checking that sampling trajectories in BEAST2 with MCMC produces the correct theoretical distribution as well as the same distribution as simulating trajectories using the analytical solution (when drawing parameter values from prior distributions). Additionally, also test the ability of the BEAST2 implementation to estimate parameter values given a trajectory.
129 |
130 |
Test 1: ouprior_test1.xml
131 |
132 | - OU-process with all parameters fixed.
133 | - Sample x using MCMC in BEAST2 and compare to theoretical quantiles.
134 |
135 |
#####################
136 | # ouprior_test1.xml #
137 | #####################
138 |
139 | # Calculate density of OU-process and get percentiles (blue and red)
140 | t <- seq(0,9,by=1)
141 | x0 <- 10
142 | mu <- 3
143 | sigma <- 1
144 | nu <- 0.1
145 | X <- plotOUProcessHPD(x0, t, mu, sigma, nu, ylim = c(0,12), main='ouprior_test1.xml', xlab="", ylab="")
146 | sim_hpd <- getMatrixHPD(X)
147 |
148 | # Sample from posterior in BEAST2 and get HPD (orange and green)
149 | lf <- readLogfile("ouprior_test1.log")
150 |
151 | xsample <- getSkylineSubset(lf,"x")
152 | for (i in 1:nrow(xsample)) {
153 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
154 | }
155 | sample_hpd <- getMatrixHPD(xsample)
156 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
157 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
158 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
159 |

160 |
161 |
162 |
Test 2: ouprior_test2.xml
163 |
164 | - OU-process with all parameters fixed and x_0 sampled from an exponential prior.
165 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
166 |
167 |
#####################
168 | # ouprior_test2.xml #
169 | #####################
170 |
171 | # Simulate OU-trajectory and get HPD (blue and red)
172 | t <- seq(0,9,by=1)
173 | x0_p <- getPrior(rexp,1,rate=10)
174 | mu <- 3
175 | sigma <- 1
176 | nu <- 0.1
177 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu, sigma, nu, ylim = c(-4,6), main='ouprior_test2.xml')
178 | sim_hpd <- getMatrixHPD(X)
179 |
180 | # Sample from posterior in BEAST2 and get HPD (orange and green)
181 | lf <- readLogfile("ouprior_test2.log")
182 |
183 | xsample <- getSkylineSubset(lf,"x")
184 | for (i in 1:nrow(xsample)) {
185 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
186 | }
187 | sample_hpd <- getMatrixHPD(xsample)
188 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
189 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
190 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
191 |

192 |
193 |
194 |
Test 3: ouprior_test3.xml
195 |
196 | - OU-process with all parameters drawn from priors.
197 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
198 | - Compare posterior distributions for parameters to priors (without data posterior should equal prior).
199 |
200 |
#####################
201 | # ouprior_test3.xml #
202 | #####################
203 |
204 | layout(matrix(c(1,1,1,1,2,3,4,5), nrow=2, byrow=TRUE), heights = c(5,3))
205 |
206 | # Simulate OU-trajectory and get HPD (blue and red)
207 | t <- seq(0,0.9,by=0.1)
208 | x0_p <- getPrior(runif, 1, min=1.5, max=2.5)
209 | mu_p <- getPrior(rlnorm, 1, meanlog=0, sdlog=0.5)
210 | sigma_p <- getPrior(rnorm, 1, mean=0.5, sd=0.1)
211 | nu_p <- getPrior(rgamma, 1, shape=1, scale=5)
212 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu_p, sigma_p, nu_p, ylim = c(0,4), main='ouprior_test3.xml')
213 | sim_hpd <- getMatrixHPD(X)
214 |
215 | # Sample from posterior in BEAST2 and get HPD (orange and green)
216 | lf <- readLogfile("ouprior_test3.log")
217 |
218 | xsample <- getSkylineSubset(lf,"x")
219 | for (i in 1:nrow(xsample)) {
220 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
221 | }
222 | sample_hpd <- getMatrixHPD(xsample)
223 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
224 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
225 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
226 |
227 | # mu
228 | mu_density <- density(lf$mu)
229 | plotPrior('lnorm',list(meanlog=0, sdlog=0.5), main='mu')
230 | lines(mu_density$x, mu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
231 | polygon(c(0, mu_density$x, 0), c(0, mu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
232 |
233 | # Sigma
234 | sigma_density <- density(lf$sigma)
235 | plotPrior('norm',list(mean=0.5, sd=0.1), main='sigma')
236 | lines(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
237 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
238 |
239 | # nu
240 | nu_density <- density(lf$nu, bw=0.3)
241 | plotPrior('gamma',list(shape=1, scale=5), main='nu')
242 | lines(nu_density$x, nu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
243 | polygon(c(0, nu_density$x, 0), c(0, nu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
244 |
245 | #x0
246 | x0_density <- density(lf$x1, bw=0.05)
247 | plotPrior('unif',list(min=1.5, max=2.5), main=expression(x[0]))
248 | lines(x0_density$x, x0_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
249 | polygon(c(0, x0_density$x, 0), c(0, x0_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
250 |

251 |
252 |
253 |
Test 4: ouprior_test4.xml
254 |
255 | - OU-process with all parameters drawn from priors, except for the mean.
256 | - Run for 51 time points instead of just 10 as above.
257 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
258 | - Compare posterior distributions for parameters to priors (without data posterior should equal prior).
259 |
260 |
#####################
261 | # ouprior_test4.xml #
262 | #####################
263 |
264 | layout(matrix(c(1,1,1,2,3,4), nrow=2, byrow=TRUE), heights=c(5,3))
265 |
266 | # Simulate OU-trajectory and get HPD (blue and red)
267 | t <- seq(0,1,length.out=51)
268 | x0_p <- getPrior(rexp, 1, rate=1)
269 | mu <- 1
270 | sigma_p <- getPrior(rnorm, 1, mean=0.3, sd=0.1)
271 | nu_p <- getPrior(rgamma, 1, shape=1, scale=50)
272 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu, sigma_p, nu_p, ylim = c(0.5,2.5), main='ouprior_test4.xml')
273 | sim_hpd <- getMatrixHPD(X)
274 |
275 | # Sample from posterior in BEAST2 and get HPD (orange and green)
276 | lf <- readLogfile("ouprior_test4.log")
277 |
278 | xsample <- getSkylineSubset(lf,"x")
279 | for (i in 1:nrow(xsample)) {
280 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
281 | }
282 | sample_hpd <- getMatrixHPD(xsample)
283 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
284 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
285 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
286 |
287 | # Sigma
288 | sigma_density <- density(lf$sigma)
289 | plotPrior('norm',list(mean=0.3, sd=0.1), main='sigma')
290 | lines(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
291 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
292 |
293 | # nu
294 | nu_density <- density(lf$nu, bw=5)
295 | plotPrior('gamma',list(shape=1, scale=50), main='nu')
296 | lines(nu_density$x, nu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
297 | polygon(c(0, nu_density$x, 0), c(0, nu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
298 |
299 | #x0
300 | x0_density <- density(lf$x1)
301 | plotPrior('exp',list(rate=1), main=expression(x[0]))
302 | lines(x0_density$x, x0_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
303 | polygon(c(0, x0_density$x, 0), c(0, x0_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
304 |

305 |
306 |
307 |
Test 5: ouprior_test5.xml
308 |
309 | - OU-process with fixed parameters, simulate a single trajectory with 101 time points.
310 | - Fix trajectory in BEAST2 and attempt to estimate mean and variance (mean-reversion fixed to true value).
311 |
312 |
#####################
313 | # ouprior_test5.xml #
314 | #####################
315 |
316 | set.seed(10)
317 |
318 | t <- seq(0,10,by=0.1)
319 | x0 <- 6
320 | mu <- 5
321 | sigma <- 0.1
322 | nu <- 1
323 | x <- simulateOU(x0, t, mu, sigma, nu)
324 |
325 | #plot(t,x,type='l',col=pal.dark(cblue))
326 | print(paste(x,collapse = " "))
327 |
328 | # Posterior estimates in BEAST2 and get HPD (orange and green)
329 | lf <- readLogfile("ouprior_test5.log")
330 |
331 | par(mfrow=c(1,2))
332 |
333 | # mu
334 | mu_density <- density(lf$mu)
335 | plot(mu_density$x, mu_density$y, lwd=2, lty=2, col=pal.dark(cgreen), type='l',ylab="",xlab="mu estimate")
336 | polygon(c(0, mu_density$x, 0), c(0, mu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
337 | abline(v=mu,lty=2,lwd=2,col=pal.dark(cred))
338 | title("ouprior_test5.xml")
339 |
340 | # sigma
341 | sigma_density <- density(lf$sigma)
342 | plot(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen), type='l',ylab="",xlab="sigma estimate")
343 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
344 | abline(v=sigma,lty=2,lwd=2,col=pal.dark(cred))
345 |

346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
365 |
366 |
367 |
375 |
376 |
377 |
378 |
--------------------------------------------------------------------------------
/examples/smoothingpriors/OUPriorTests.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Ornstein-Uhlenbeck smoothing prior tests"
3 | author: "Louis du Plessis"
4 | date: "7/19/2018"
5 | output:
6 | html_document:
7 | keep_md: true
8 | theme: cosmo
9 | self_contained: false
10 | ---
11 |
12 | Tests to check that the OU-prior implemented in BEAST2 is correct. In particular checking that sampling trajectories in BEAST2 with MCMC produces the correct theoretical distribution as well as the same distribution as simulating trajectories using the analytical solution (when drawing parameter values from prior distributions). Additionally, also test the ability of the BEAST2 implementation to estimate parameter values given a trajectory.
13 |
14 |
15 |
16 |
17 |
18 |
19 | ### Test 1: `ouprior_test1.xml`
20 |
21 | - OU-process with all parameters fixed.
22 | - Sample x using MCMC in BEAST2 and compare to theoretical quantiles.
23 |
24 |
25 |
26 | ```r
27 | #####################
28 | # ouprior_test1.xml #
29 | #####################
30 |
31 | # Calculate density of OU-process and get percentiles (blue and red)
32 | t <- seq(0,9,by=1)
33 | x0 <- 10
34 | mu <- 3
35 | sigma <- 1
36 | nu <- 0.1
37 | X <- plotOUProcessHPD(x0, t, mu, sigma, nu, ylim = c(0,12), main='ouprior_test1.xml', xlab="", ylab="")
38 | sim_hpd <- getMatrixHPD(X)
39 |
40 | # Sample from posterior in BEAST2 and get HPD (orange and green)
41 | lf <- readLogfile("ouprior_test1.log")
42 |
43 | xsample <- getSkylineSubset(lf,"x")
44 | for (i in 1:nrow(xsample)) {
45 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
46 | }
47 | sample_hpd <- getMatrixHPD(xsample)
48 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
49 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
50 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
51 | ```
52 |
53 | 
54 |
55 |
56 |
57 | ### Test 2: `ouprior_test2.xml`
58 |
59 | - OU-process with all parameters fixed and x_0 sampled from an exponential prior.
60 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
61 |
62 |
63 |
64 | ```r
65 | #####################
66 | # ouprior_test2.xml #
67 | #####################
68 |
69 | # Simulate OU-trajectory and get HPD (blue and red)
70 | t <- seq(0,9,by=1)
71 | x0_p <- getPrior(rexp,1,rate=10)
72 | mu <- 3
73 | sigma <- 1
74 | nu <- 0.1
75 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu, sigma, nu, ylim = c(-4,6), main='ouprior_test2.xml')
76 | sim_hpd <- getMatrixHPD(X)
77 |
78 | # Sample from posterior in BEAST2 and get HPD (orange and green)
79 | lf <- readLogfile("ouprior_test2.log")
80 |
81 | xsample <- getSkylineSubset(lf,"x")
82 | for (i in 1:nrow(xsample)) {
83 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
84 | }
85 | sample_hpd <- getMatrixHPD(xsample)
86 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
87 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
88 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
89 | ```
90 |
91 | 
92 |
93 |
94 | ### Test 3: `ouprior_test3.xml`
95 |
96 | - OU-process with all parameters drawn from priors.
97 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
98 | - Compare posterior distributions for parameters to priors (without data posterior should equal prior).
99 |
100 |
101 | ```r
102 | #####################
103 | # ouprior_test3.xml #
104 | #####################
105 |
106 | layout(matrix(c(1,1,1,1,2,3,4,5), nrow=2, byrow=TRUE), heights = c(5,3))
107 |
108 | # Simulate OU-trajectory and get HPD (blue and red)
109 | t <- seq(0,0.9,by=0.1)
110 | x0_p <- getPrior(runif, 1, min=1.5, max=2.5)
111 | mu_p <- getPrior(rlnorm, 1, meanlog=0, sdlog=0.5)
112 | sigma_p <- getPrior(rnorm, 1, mean=0.5, sd=0.1)
113 | nu_p <- getPrior(rgamma, 1, shape=1, scale=5)
114 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu_p, sigma_p, nu_p, ylim = c(0,4), main='ouprior_test3.xml')
115 | sim_hpd <- getMatrixHPD(X)
116 |
117 | # Sample from posterior in BEAST2 and get HPD (orange and green)
118 | lf <- readLogfile("ouprior_test3.log")
119 |
120 | xsample <- getSkylineSubset(lf,"x")
121 | for (i in 1:nrow(xsample)) {
122 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
123 | }
124 | sample_hpd <- getMatrixHPD(xsample)
125 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
126 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
127 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
128 |
129 | # mu
130 | mu_density <- density(lf$mu)
131 | plotPrior('lnorm',list(meanlog=0, sdlog=0.5), main='mu')
132 | lines(mu_density$x, mu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
133 | polygon(c(0, mu_density$x, 0), c(0, mu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
134 |
135 | # Sigma
136 | sigma_density <- density(lf$sigma)
137 | plotPrior('norm',list(mean=0.5, sd=0.1), main='sigma')
138 | lines(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
139 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
140 |
141 | # nu
142 | nu_density <- density(lf$nu, bw=0.3)
143 | plotPrior('gamma',list(shape=1, scale=5), main='nu')
144 | lines(nu_density$x, nu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
145 | polygon(c(0, nu_density$x, 0), c(0, nu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
146 |
147 | #x0
148 | x0_density <- density(lf$x1, bw=0.05)
149 | plotPrior('unif',list(min=1.5, max=2.5), main=expression(x[0]))
150 | lines(x0_density$x, x0_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
151 | polygon(c(0, x0_density$x, 0), c(0, x0_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
152 | ```
153 |
154 | 
155 |
156 |
157 |
158 | ### Test 4: `ouprior_test4.xml`
159 |
160 | - OU-process with all parameters drawn from priors, except for the mean.
161 | - Run for 51 time points instead of just 10 as above.
162 | - Sample x using MCMC in BEAST2 and compare HPDs of x to 1000 simulated trajectories (using analytical solution from time-transformed Wiener process).
163 | - Compare posterior distributions for parameters to priors (without data posterior should equal prior).
164 |
165 |
166 |
167 | ```r
168 | #####################
169 | # ouprior_test4.xml #
170 | #####################
171 |
172 | layout(matrix(c(1,1,1,2,3,4), nrow=2, byrow=TRUE), heights=c(5,3))
173 |
174 | # Simulate OU-trajectory and get HPD (blue and red)
175 | t <- seq(0,1,length.out=51)
176 | x0_p <- getPrior(rexp, 1, rate=1)
177 | mu <- 1
178 | sigma_p <- getPrior(rnorm, 1, mean=0.3, sd=0.1)
179 | nu_p <- getPrior(rgamma, 1, shape=1, scale=50)
180 | X <- plotOUProcessHPDEmpirical(x0_p, t, mu, sigma_p, nu_p, ylim = c(0.5,2.5), main='ouprior_test4.xml')
181 | sim_hpd <- getMatrixHPD(X)
182 |
183 | # Sample from posterior in BEAST2 and get HPD (orange and green)
184 | lf <- readLogfile("ouprior_test4.log")
185 |
186 | xsample <- getSkylineSubset(lf,"x")
187 | for (i in 1:nrow(xsample)) {
188 | lines(t,xsample[i,],col=pal.dark(corange,0.1),lwd=0.5)
189 | }
190 | sample_hpd <- getMatrixHPD(xsample)
191 | lines(t,sample_hpd[1,],col=pal.dark(cgreen),lty=2,lwd=2)
192 | lines(t,sample_hpd[2,],col=pal.dark(cgreen),lty=2,lwd=2)
193 | lines(t,sample_hpd[3,],col=pal.dark(cgreen),lty=2,lwd=2)
194 |
195 | # Sigma
196 | sigma_density <- density(lf$sigma)
197 | plotPrior('norm',list(mean=0.3, sd=0.1), main='sigma')
198 | lines(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
199 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
200 |
201 | # nu
202 | nu_density <- density(lf$nu, bw=5)
203 | plotPrior('gamma',list(shape=1, scale=50), main='nu')
204 | lines(nu_density$x, nu_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
205 | polygon(c(0, nu_density$x, 0), c(0, nu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
206 |
207 | #x0
208 | x0_density <- density(lf$x1)
209 | plotPrior('exp',list(rate=1), main=expression(x[0]))
210 | lines(x0_density$x, x0_density$y, lwd=2, lty=2, col=pal.dark(cgreen))
211 | polygon(c(0, x0_density$x, 0), c(0, x0_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
212 | ```
213 |
214 | 
215 |
216 |
217 | ### Test 5: `ouprior_test5.xml`
218 |
219 | - OU-process with fixed parameters, simulate a single trajectory with 101 time points.
220 | - Fix trajectory in BEAST2 and attempt to estimate mean and variance (mean-reversion fixed to true value).
221 |
222 |
223 | ```r
224 | #####################
225 | # ouprior_test5.xml #
226 | #####################
227 |
228 | set.seed(10)
229 |
230 | t <- seq(0,10,by=0.1)
231 | x0 <- 6
232 | mu <- 5
233 | sigma <- 0.1
234 | nu <- 1
235 | x <- simulateOU(x0, t, mu, sigma, nu)
236 |
237 | #plot(t,x,type='l',col=pal.dark(cblue))
238 | print(paste(x,collapse = " "))
239 |
240 | # Posterior estimates in BEAST2 and get HPD (orange and green)
241 | lf <- readLogfile("ouprior_test5.log")
242 |
243 | par(mfrow=c(1,2))
244 |
245 | # mu
246 | mu_density <- density(lf$mu)
247 | plot(mu_density$x, mu_density$y, lwd=2, lty=2, col=pal.dark(cgreen), type='l',ylab="",xlab="mu estimate")
248 | polygon(c(0, mu_density$x, 0), c(0, mu_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
249 | abline(v=mu,lty=2,lwd=2,col=pal.dark(cred))
250 | title("ouprior_test5.xml")
251 |
252 | # sigma
253 | sigma_density <- density(lf$sigma)
254 | plot(sigma_density$x, sigma_density$y, lwd=2, lty=2, col=pal.dark(cgreen), type='l',ylab="",xlab="sigma estimate")
255 | polygon(c(0, sigma_density$x, 0), c(0, sigma_density$y, 0), col=pal.dark(cgreen,0.5), border=NA)
256 | abline(v=sigma,lty=2,lwd=2,col=pal.dark(cred))
257 | ```
258 |
259 | 
260 |
--------------------------------------------------------------------------------
/examples/smoothingpriors/figs/ouprior_test1-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laduplessis/skylinetools/7993f64ca5699ad0da053af2f2a6d8e8a4c45fa8/examples/smoothingpriors/figs/ouprior_test1-1.png
--------------------------------------------------------------------------------
/examples/smoothingpriors/figs/ouprior_test2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laduplessis/skylinetools/7993f64ca5699ad0da053af2f2a6d8e8a4c45fa8/examples/smoothingpriors/figs/ouprior_test2-1.png
--------------------------------------------------------------------------------
/examples/smoothingpriors/figs/ouprior_test3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laduplessis/skylinetools/7993f64ca5699ad0da053af2f2a6d8e8a4c45fa8/examples/smoothingpriors/figs/ouprior_test3-1.png
--------------------------------------------------------------------------------
/examples/smoothingpriors/figs/ouprior_test4-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laduplessis/skylinetools/7993f64ca5699ad0da053af2f2a6d8e8a4c45fa8/examples/smoothingpriors/figs/ouprior_test4-1.png
--------------------------------------------------------------------------------
/examples/smoothingpriors/figs/ouprior_test5-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laduplessis/skylinetools/7993f64ca5699ad0da053af2f2a6d8e8a4c45fa8/examples/smoothingpriors/figs/ouprior_test5-1.png
--------------------------------------------------------------------------------
/examples/smoothingpriors/ouprior_test1.xml:
--------------------------------------------------------------------------------
1 |