thin_dt.Rd
post-hoc thinning of MCMC chains which have been converted to a data.table
thin_dt(dt, thin = 1)
dt | an object of class "data.table" returned from `mcmc_to_dt` |
---|---|
thin | thinning interval |
a data.table dataframe
#> iteration chain parameter value #> 1: 1 1 alpha 7.173130 #> 2: 11 1 alpha 3.065240 #> 3: 21 1 alpha 2.876460 #> 4: 31 1 alpha 2.943310 #> 5: 41 1 alpha 3.087570 #> --- #> 116: 151 2 sigma 0.764629 #> 117: 161 2 sigma 1.315890 #> 118: 171 2 sigma 1.034110 #> 119: 181 2 sigma 2.362830 #> 120: 191 2 sigma 1.009290thin_dt(mcmc_dt, thin = 2)#> iteration chain parameter value #> 1: 1 1 alpha 7.173130 #> 2: 3 1 alpha 3.669890 #> 3: 5 1 alpha 3.705440 #> 4: 7 1 alpha 2.702060 #> 5: 9 1 alpha 3.534060 #> --- #> 596: 191 2 sigma 1.009290 #> 597: 193 2 sigma 2.249060 #> 598: 195 2 sigma 0.606293 #> 599: 197 2 sigma 0.846828 #> 600: 199 2 sigma 0.672417thin_dt(mcmc_dt, thin = 20)#> iteration chain parameter value #> 1: 1 1 alpha 7.173130 #> 2: 21 1 alpha 2.876460 #> 3: 41 1 alpha 3.087570 #> 4: 61 1 alpha 2.994820 #> 5: 81 1 alpha 2.212900 #> 6: 101 1 alpha 3.524700 #> 7: 121 1 alpha 3.338330 #> 8: 141 1 alpha 2.807910 #> 9: 161 1 alpha 3.169770 #> 10: 181 1 alpha 3.233470 #> 11: 1 1 beta -1.566200 #> 12: 21 1 beta 1.028060 #> 13: 41 1 beta 0.674701 #> 14: 61 1 beta 0.876193 #> 15: 81 1 beta 0.770004 #> 16: 101 1 beta 0.753859 #> 17: 121 1 beta 0.659257 #> 18: 141 1 beta 1.154520 #> 19: 161 1 beta 0.858167 #> 20: 181 1 beta 0.934646 #> 21: 1 1 sigma 11.233100 #> 22: 21 1 sigma 0.582580 #> 23: 41 1 sigma 0.840521 #> 24: 61 1 sigma 0.493587 #> 25: 81 1 sigma 1.387510 #> 26: 101 1 sigma 0.734966 #> 27: 121 1 sigma 1.260040 #> 28: 141 1 sigma 0.637226 #> 29: 161 1 sigma 0.806075 #> 30: 181 1 sigma 0.618407 #> 31: 1 2 alpha 2.066500 #> 32: 21 2 alpha 3.348630 #> 33: 41 2 alpha 3.110930 #> 34: 61 2 alpha 3.571770 #> 35: 81 2 alpha 3.158990 #> 36: 101 2 alpha 3.074090 #> 37: 121 2 alpha 1.698710 #> 38: 141 2 alpha 3.060500 #> 39: 161 2 alpha 2.732490 #> 40: 181 2 alpha 3.103140 #> 41: 1 2 beta 0.949830 #> 42: 21 2 beta 0.466017 #> 43: 41 2 beta 0.951993 #> 44: 61 2 beta 0.414160 #> 45: 81 2 beta 0.526451 #> 46: 101 2 beta 0.863503 #> 47: 121 2 beta 0.429794 #> 48: 141 2 beta 1.083460 #> 49: 161 2 beta 1.469440 #> 50: 181 2 beta -0.423911 #> 51: 1 2 sigma 2.853790 #> 52: 21 2 sigma 0.697648 #> 53: 41 2 sigma 1.157920 #> 54: 61 2 sigma 0.880437 #> 55: 81 2 sigma 0.661277 #> 56: 101 2 sigma 0.642839 #> 57: 121 2 sigma 1.288570 #> 58: 141 2 sigma 1.417590 #> 59: 161 2 sigma 1.315890 #> 60: 181 2 sigma 2.362830 #> iteration chain parameter value