bnp

Some older Bayesian nonparametrics research.
git clone git://git.jtobin.io/bnp.git
Log | Files | Refs | README | LICENSE

sim_fmm_1d.r (281B)


      1 require(ggplot2)
      2 require(reshape2)
      3 
      4 source('fmm_generative.r')
      5 
      6 config = list(
      7     k = 4
      8   , n = 10000
      9   )
     10 
     11 set.seed(42)
     12 
     13 d      = model(config$k, config$n)
     14 melted = melt(d)
     15 
     16 p = ggplot(melted, aes(value, colour = factor(L1), fill = factor(L1))) +
     17       geom_density(alpha = 0.5)
     18