• finish pmc post from Tuesday (done).
  • Submit comment reply (done).


  • Finishing up parametric vs nonparametric Bayes comparison runs
  • Need to add parametric Bayesian mean to the state-space diagram, fig 1
  • Compare with uniform priors on inverse standard deviations (precision)
  • Sensitivity analysis
  • mcmc convergence analysis for both Bayesian approaches
  • See example scripts in BUGS/, adapted to post soon

Code tricks

Plotting tricks

  • Selecting the order in the simulation legend requires declaring the model types as an ordered factor instead of a character,
dt$method = factor(dt$method, ordered=TRUE, levels=names(OPT))

and then set custom colors and match colors to the desired factor labels with scale_colour_manual, and override alpha for legends,

ggplot(dt) + 
  geom_line(aes(time, fishstock, group=interaction(reps,method), color=method), alpha=.1) +
    scale_colour_manual(values=colorkey, guide = guide_legend(override.aes = list(alpha = 1)))
  • Avoid having density plots appear as crude polygons using stat_density instead of geom_density and set geom to path. Need a ymax (not clear why?) or set position="identity" as shown,:
ggplot(posteriors, aes(value)) + stat_density(geom="path", position="identity", alpha=0.7)