Skip to contents

Returns the accumulated log-posterior, the average Metropolis acceptance rate, divergent transitions, treedepth rather than terminated its evolution normally.

Usage

diagnostic_draws(posterior, ...)

Arguments

posterior

A stanreg, stanfit, brmsfit, or blavaan object.

...

Currently not used.

Examples

# \donttest{
set.seed(333)

if (require("brms", quietly = TRUE)) {
  model <- suppressWarnings(brm(mpg ~ wt * cyl * vs,
    data = mtcars,
    iter = 100, control = list(adapt_delta = 0.80),
    refresh = 0
  ))
  diagnostic_draws(model)
}
#> Compiling Stan program...
#> Start sampling
#>     Chain Iteration Acceptance_Rate  Step_Size Tree_Depth n_Leapfrog Divergent
#> 1       1         1       0.8635300 0.03468417          6         63         0
#> 2       1         2       0.9136471 0.03468417          7        255         0
#> 3       1         3       0.9863575 0.03468417         10       1023         0
#> 4       1         4       0.9662903 0.03468417          6        127         0
#> 5       1         5       0.9900292 0.03468417          6         63         0
#> 6       1         6       0.9289357 0.03468417          9        639         0
#> 7       1         7       0.9969973 0.03468417          6         63         0
#> 8       1         8       0.9937014 0.03468417         10       1023         0
#> 9       1         9       0.9797568 0.03468417          8        383         0
#> 10      1        10       0.9855480 0.03468417          9        639         0
#> 11      1        11       0.8617986 0.03468417          8        447         0
#> 12      1        12       0.9949926 0.03468417          9        639         0
#> 13      1        13       0.9937324 0.03468417         10       1023         0
#> 14      1        14       0.9770628 0.03468417          7        191         0
#> 15      1        15       0.9194509 0.03468417         10       1023         0
#> 16      1        16       0.9568499 0.03468417          6        127         0
#> 17      1        17       0.9861167 0.03468417          6         63         0
#> 18      1        18       0.9507910 0.03468417          9        895         0
#> 19      1        19       0.9887289 0.03468417         10       1023         0
#> 20      1        20       0.9993835 0.03468417          5         31         0
#> 21      1        21       0.9843024 0.03468417         10       1023         0
#> 22      1        22       0.9797890 0.03468417          8        383         0
#> 23      1        23       0.9944690 0.03468417          8        511         0
#> 24      1        24       0.9767860 0.03468417          8        383         0
#> 25      1        25       0.9383421 0.03468417          9        959         0
#> 26      1        26       0.9570864 0.03468417          9        655         0
#> 27      1        27       0.9778837 0.03468417         10       1023         0
#> 28      1        28       0.9799058 0.03468417          7        255         0
#> 29      1        29       0.9462549 0.03468417          6         63         0
#> 30      1        30       0.8323784 0.03468417          7        127         0
#> 31      1        31       0.9895450 0.03468417         10       1023         0
#> 32      1        32       0.9926231 0.03468417          8        335         0
#> 33      1        33       0.9927103 0.03468417          5         31         0
#> 34      1        34       0.9987344 0.03468417          6         63         0
#> 35      1        35       0.9830424 0.03468417          6         63         0
#> 36      1        36       0.9682450 0.03468417          7        127         0
#> 37      1        37       0.9933061 0.03468417         10       1023         0
#> 38      1        38       0.9403289 0.03468417         10       1023         0
#> 39      1        39       0.9995874 0.03468417         10       1023         0
#> 40      1        40       0.8767612 0.03468417          9       1023         0
#> 41      1        41       0.9725447 0.03468417         10       1023         0
#> 42      1        42       0.9861283 0.03468417          8        383         0
#> 43      1        43       0.8548139 0.03468417         10       1023         0
#> 44      1        44       0.8389647 0.03468417         10       1023         0
#> 45      1        45       0.9554398 0.03468417          5         63         0
#> 46      1        46       0.9761778 0.03468417         10       1023         0
#> 47      1        47       0.9701103 0.03468417          7        127         0
#> 48      1        48       0.9922098 0.03468417          7        191         0
#> 49      1        49       0.9621097 0.03468417          8        511         0
#> 50      1        50       0.9994729 0.03468417          9        639         0
#> 51      2         1       0.9977753 0.03332572         10       1023         0
#> 52      2         2       0.8687279 0.03332572          7        191         0
#> 53      2         3       0.9933227 0.03332572          9        767         0
#> 54      2         4       0.9684332 0.03332572          6         63         0
#> 55      2         5       0.7551614 0.03332572         10       1023         0
#> 56      2         6       0.9266202 0.03332572          7        127         0
#> 57      2         7       0.9960281 0.03332572         10       1023         0
#> 58      2         8       0.9963768 0.03332572          6         63         0
#> 59      2         9       0.9775107 0.03332572          8        447         0
#> 60      2        10       0.7663591 0.03332572          5         63         0
#> 61      2        11       0.9954953 0.03332572          6         63         0
#> 62      2        12       0.9986424 0.03332572          6        127         0
#> 63      2        13       0.9925190 0.03332572         10       1023         0
#> 64      2        14       0.9999734 0.03332572         10       1023         0
#> 65      2        15       0.8988157 0.03332572          3          7         0
#> 66      2        16       0.9068830 0.03332572         10       1023         0
#> 67      2        17       0.9299921 0.03332572         10       1023         0
#> 68      2        18       0.9866188 0.03332572         10       1023         0
#> 69      2        19       0.9163855 0.03332572         10       1023         0
#> 70      2        20       0.9925532 0.03332572          7        255         0
#> 71      2        21       0.9876059 0.03332572          7        191         0
#> 72      2        22       0.9880354 0.03332572          9       1023         0
#> 73      2        23       0.8505949 0.03332572         10       1023         0
#> 74      2        24       0.9905202 0.03332572          6         63         0
#> 75      2        25       0.7128606 0.03332572          6        127         0
#> 76      2        26       0.9990718 0.03332572         10       1023         0
#> 77      2        27       0.9784712 0.03332572          7        127         0
#> 78      2        28       0.9965097 0.03332572          8        383         0
#> 79      2        29       0.9942409 0.03332572          6         63         0
#> 80      2        30       0.8183472 0.03332572          9        655         0
#> 81      2        31       0.9680243 0.03332572          7        255         0
#> 82      2        32       0.9890766 0.03332572          5         31         0
#> 83      2        33       0.8715178 0.03332572         10       1023         0
#> 84      2        34       0.9362153 0.03332572         10       1023         0
#> 85      2        35       0.9997559 0.03332572          8        511         0
#> 86      2        36       0.8987255 0.03332572          3         15         0
#> 87      2        37       0.9880821 0.03332572          9        831         0
#> 88      2        38       0.9293936 0.03332572         10       1023         0
#> 89      2        39       0.9527558 0.03332572         10       1023         0
#> 90      2        40       0.8142194 0.03332572         10       1023         0
#> 91      2        41       0.9874643 0.03332572         10       1023         0
#> 92      2        42       0.9770989 0.03332572          9       1023         0
#> 93      2        43       0.8866260 0.03332572          9        895         0
#> 94      2        44       0.8828927 0.03332572         10       1023         0
#> 95      2        45       0.9949399 0.03332572          7        255         0
#> 96      2        46       0.9146691 0.03332572          7        191         0
#> 97      2        47       0.9659167 0.03332572         10       1023         0
#> 98      2        48       0.9957213 0.03332572         10       1023         0
#> 99      2        49       0.9404257 0.03332572          7        191         0
#> 100     2        50       0.9803275 0.03332572          8        319         0
#> 101     3         1       0.8155798 0.03742549          7        191         0
#> 102     3         2       0.9565482 0.03742549         10       1023         0
#> 103     3         3       0.9060364 0.03742549          7        127         0
#> 104     3         4       0.9684992 0.03742549          9        575         0
#> 105     3         5       0.9600335 0.03742549         10       1023         0
#> 106     3         6       0.9894624 0.03742549          6         63         0
#> 107     3         7       0.8202755 0.03742549          6        127         0
#> 108     3         8       0.9680231 0.03742549         10       1023         0
#> 109     3         9       0.8682610 0.03742549         10       1023         0
#> 110     3        10       0.9976172 0.03742549          7        191         0
#> 111     3        11       0.9476391 0.03742549         10       1023         0
#> 112     3        12       0.9262045 0.03742549          8        383         0
#> 113     3        13       0.9867719 0.03742549          7        127         0
#> 114     3        14       0.9935106 0.03742549          5         31         0
#> 115     3        15       0.8351069 0.03742549         10       1023         0
#> 116     3        16       0.9793729 0.03742549          6         63         0
#> 117     3        17       0.9247268 0.03742549         10       1023         0
#> 118     3        18       0.9983438 0.03742549         10       1023         0
#> 119     3        19       0.9405665 0.03742549          6        127         0
#> 120     3        20       0.9904495 0.03742549          8        511         0
#> 121     3        21       0.9905696 0.03742549          9        639         0
#> 122     3        22       0.8409423 0.03742549          8        319         0
#> 123     3        23       0.9956203 0.03742549          7        159         0
#> 124     3        24       0.8021489 0.03742549          8        447         0
#> 125     3        25       0.9744307 0.03742549         10       1023         0
#> 126     3        26       0.9732865 0.03742549         10       1023         0
#> 127     3        27       0.9197724 0.03742549          6        127         0
#> 128     3        28       0.9771663 0.03742549          7        255         0
#> 129     3        29       0.8528693 0.03742549         10       1023         0
#> 130     3        30       0.9857750 0.03742549          9        575         0
#> 131     3        31       0.9776708 0.03742549          6        127         0
#> 132     3        32       0.9103742 0.03742549         10       1023         0
#> 133     3        33       0.8127369 0.03742549          9        975         0
#> 134     3        34       0.9979473 0.03742549         10       1023         0
#> 135     3        35       0.9930098 0.03742549         10       1023         0
#> 136     3        36       0.9739349 0.03742549         10       1023         0
#> 137     3        37       0.9803240 0.03742549         10       1023         0
#> 138     3        38       0.9944887 0.03742549         10       1023         0
#> 139     3        39       0.9891067 0.03742549         10       1023         0
#> 140     3        40       0.9473967 0.03742549          9        607         0
#> 141     3        41       0.9985215 0.03742549          8        447         0
#> 142     3        42       0.9952529 0.03742549          9        671         0
#> 143     3        43       0.8960930 0.03742549          7        175         0
#> 144     3        44       0.9864406 0.03742549          9        895         0
#> 145     3        45       0.9969098 0.03742549          7        191         0
#> 146     3        46       0.7906908 0.03742549          9        911         0
#> 147     3        47       0.8782428 0.03742549          6        127         0
#> 148     3        48       0.9951144 0.03742549          6         63         0
#> 149     3        49       0.9446957 0.03742549         10       1023         0
#> 150     3        50       0.9983473 0.03742549         10       1023         0
#> 151     4         1       0.7601993 0.03204934         10       1023         0
#> 152     4         2       0.9471750 0.03204934         10       1023         0
#> 153     4         3       0.9960623 0.03204934         10       1023         0
#> 154     4         4       0.9909054 0.03204934          9       1023         0
#> 155     4         5       0.6559207 0.03204934          8        255         0
#> 156     4         6       0.9831670 0.03204934          8        407         0
#> 157     4         7       0.9634444 0.03204934          8        255         0
#> 158     4         8       0.9564323 0.03204934         10       1023         0
#> 159     4         9       0.9956201 0.03204934          7        159         0
#> 160     4        10       0.9656818 0.03204934          7        127         0
#> 161     4        11       0.9472236 0.03204934          8        511         0
#> 162     4        12       0.9997053 0.03204934         10       1023         0
#> 163     4        13       0.9977500 0.03204934         10       1023         0
#> 164     4        14       0.9206532 0.03204934         10       1023         0
#> 165     4        15       0.9921322 0.03204934          8        383         0
#> 166     4        16       0.9503797 0.03204934         10       1023         0
#> 167     4        17       0.9978729 0.03204934         10       1023         0
#> 168     4        18       0.5197365 0.03204934         10       1023         0
#> 169     4        19       0.9963902 0.03204934         10       1023         0
#> 170     4        20       0.9900801 0.03204934          6        127         0
#> 171     4        21       0.9547605 0.03204934          6        127         0
#> 172     4        22       0.9878980 0.03204934          9        831         0
#> 173     4        23       0.9957027 0.03204934          7        127         0
#> 174     4        24       0.9596356 0.03204934          9        783         0
#> 175     4        25       0.9987294 0.03204934          6         63         0
#> 176     4        26       0.9829070 0.03204934          5         63         0
#> 177     4        27       0.8891739 0.03204934          8        423         0
#> 178     4        28       0.9505994 0.03204934         10       1023         0
#> 179     4        29       0.9929616 0.03204934          6         63         0
#> 180     4        30       0.7685323 0.03204934          6         79         0
#> 181     4        31       0.9900524 0.03204934          9        911         0
#> 182     4        32       0.9579094 0.03204934          7        255         0
#> 183     4        33       0.9937229 0.03204934          8        455         0
#> 184     4        34       0.9798194 0.03204934          8        383         0
#> 185     4        35       0.9502694 0.03204934          9        703         0
#> 186     4        36       0.9891410 0.03204934          6        127         0
#> 187     4        37       0.9968589 0.03204934          6         63         0
#> 188     4        38       0.9649275 0.03204934          9        975         0
#> 189     4        39       0.9441781 0.03204934          9        895         0
#> 190     4        40       0.9700667 0.03204934          4         15         0
#> 191     4        41       0.9007986 0.03204934         10       1023         0
#> 192     4        42       0.9788679 0.03204934          8        383         0
#> 193     4        43       0.8766682 0.03204934          7        255         0
#> 194     4        44       0.9638160 0.03204934         10       1023         0
#> 195     4        45       0.9948981 0.03204934          9        767         0
#> 196     4        46       0.9952965 0.03204934         10       1023         0
#> 197     4        47       0.9811392 0.03204934          8        351         0
#> 198     4        48       0.9838751 0.03204934          4         31         0
#> 199     4        49       0.9346458 0.03204934          9        895         0
#> 200     4        50       0.8551706 0.03204934         10       1023         0
#>       Energy LogPosterior
#> 1   81.68979    -78.53575
#> 2   81.30190    -79.44012
#> 3   83.73613    -77.76254
#> 4   83.83327    -78.54812
#> 5   81.58150    -77.67229
#> 6   80.76513    -77.72217
#> 7   78.86958    -76.65568
#> 8   80.47306    -76.57489
#> 9   80.00525    -77.24579
#> 10  80.38747    -77.69605
#> 11  83.50795    -78.71900
#> 12  79.99357    -76.68875
#> 13  81.08848    -78.41224
#> 14  80.44635    -78.40657
#> 15  83.25134    -76.90618
#> 16  81.55041    -79.25998
#> 17  81.93603    -79.45798
#> 18  82.52994    -79.45795
#> 19  82.56797    -78.76203
#> 20  80.91393    -79.51177
#> 21  82.62931    -79.59458
#> 22  82.52404    -77.47962
#> 23  81.75065    -79.21792
#> 24  81.54242    -77.54294
#> 25  80.28798    -76.43826
#> 26  81.23868    -77.89696
#> 27  84.82903    -79.69482
#> 28  84.27202    -79.33650
#> 29  82.01173    -78.61202
#> 30  83.52101    -80.83462
#> 31  84.19173    -80.50366
#> 32  83.22688    -80.28814
#> 33  80.95878    -78.06432
#> 34  83.41489    -79.20627
#> 35  81.76939    -76.08874
#> 36  78.81229    -77.83248
#> 37  79.71623    -77.32440
#> 38  83.44286    -78.74506
#> 39  81.74730    -77.08450
#> 40  80.00788    -76.52118
#> 41  78.52085    -75.14859
#> 42  76.14307    -74.66305
#> 43  78.17077    -76.99175
#> 44  82.32819    -75.88508
#> 45  82.69528    -78.50423
#> 46  84.08986    -80.33075
#> 47  86.27963    -81.32510
#> 48  83.57613    -78.75639
#> 49  83.37602    -80.38082
#> 50  85.22319    -81.98533
#> 51  79.04425    -75.93612
#> 52  79.59342    -76.88132
#> 53  81.98043    -76.85721
#> 54  84.09465    -81.35656
#> 55  87.52969    -82.04522
#> 56  84.40385    -80.15068
#> 57  83.29075    -79.89185
#> 58  81.02457    -77.92864
#> 59  79.48660    -75.45440
#> 60  81.65772    -76.70111
#> 61  78.79809    -75.66794
#> 62  77.92424    -75.54409
#> 63  81.11599    -77.93756
#> 64  82.91378    -77.97202
#> 65  81.60834    -78.62578
#> 66  83.37749    -78.77475
#> 67  81.49486    -77.59621
#> 68  81.84369    -78.65842
#> 69  83.21586    -77.13988
#> 70  81.77040    -78.27169
#> 71  80.24218    -75.79366
#> 72  80.95216    -75.74954
#> 73  85.45359    -80.36946
#> 74  81.86366    -77.80998
#> 75  84.36743    -78.75500
#> 76  84.03165    -81.71340
#> 77  85.38472    -81.17972
#> 78  87.72757    -78.53602
#> 79  81.70592    -79.29349
#> 80  89.51925    -83.20471
#> 81  88.66343    -83.49537
#> 82  85.51220    -82.51621
#> 83  88.48239    -82.78556
#> 84  86.23336    -80.13370
#> 85  82.87816    -79.53007
#> 86  85.66489    -80.89422
#> 87  90.04579    -80.05998
#> 88  87.75324    -82.60976
#> 89  86.50583    -78.22795
#> 90  83.36130    -78.28413
#> 91  82.86748    -78.98554
#> 92  84.29937    -78.10824
#> 93  82.14089    -79.40267
#> 94  82.73149    -80.67393
#> 95  84.70622    -81.30023
#> 96  89.91822    -85.70927
#> 97  93.83836    -81.46507
#> 98  85.20532    -81.23038
#> 99  84.54402    -79.25060
#> 100 83.81674    -77.61327
#> 101 87.84960    -80.90316
#> 102 83.56417    -78.36262
#> 103 81.36451    -79.69073
#> 104 84.53421    -81.87829
#> 105 83.92396    -79.49371
#> 106 82.05882    -77.34125
#> 107 79.43416    -76.36843
#> 108 78.99842    -76.88755
#> 109 89.20045    -82.35807
#> 110 89.71731    -85.52151
#> 111 91.03985    -83.68061
#> 112 89.72210    -85.08433
#> 113 88.48898    -83.66736
#> 114 85.29272    -79.85449
#> 115 85.05584    -80.59265
#> 116 86.14571    -81.42476
#> 117 87.89185    -80.74854
#> 118 88.68445    -83.90403
#> 119 89.87877    -82.33156
#> 120 85.60347    -80.76304
#> 121 87.87220    -82.80787
#> 122 88.01223    -81.47572
#> 123 84.11699    -79.98619
#> 124 87.77799    -83.58798
#> 125 86.39205    -78.62288
#> 126 89.77851    -85.15048
#> 127 88.10457    -82.96944
#> 128 88.49397    -78.50942
#> 129 85.00417    -76.89855
#> 130 79.76467    -76.28304
#> 131 80.15671    -76.97819
#> 132 84.73166    -79.85099
#> 133 86.48743    -81.80299
#> 134 90.36706    -87.56979
#> 135 91.32256    -77.72510
#> 136 82.83510    -78.23065
#> 137 81.86588    -77.50455
#> 138 83.28792    -77.62655
#> 139 81.73475    -75.42355
#> 140 80.24097    -77.58810
#> 141 80.02829    -77.88882
#> 142 81.95778    -76.93972
#> 143 80.35629    -76.19316
#> 144 77.97606    -76.20728
#> 145 78.93616    -77.04431
#> 146 84.85137    -78.47213
#> 147 86.10982    -80.57124
#> 148 85.22013    -81.62952
#> 149 85.16246    -76.54344
#> 150 78.63998    -75.95998
#> 151 85.09025    -78.61080
#> 152 84.10733    -81.79794
#> 153 85.92464    -83.01607
#> 154 85.51669    -81.25821
#> 155 89.79504    -83.21534
#> 156 87.48172    -80.87003
#> 157 84.27767    -76.44178
#> 158 80.14010    -76.75732
#> 159 77.44618    -75.36220
#> 160 78.00573    -76.10621
#> 161 79.32189    -77.88368
#> 162 80.32595    -77.78867
#> 163 81.65414    -79.27375
#> 164 86.60368    -78.97770
#> 165 83.43989    -78.77708
#> 166 82.12886    -76.53895
#> 167 79.44107    -77.20244
#> 168 89.00809    -82.69022
#> 169 88.11850    -78.93262
#> 170 83.11158    -78.67737
#> 171 82.11975    -77.40317
#> 172 81.67231    -78.88842
#> 173 80.68019    -76.97997
#> 174 79.23976    -77.34819
#> 175 78.67661    -77.87987
#> 176 79.36949    -77.91093
#> 177 81.28618    -77.91514
#> 178 83.50125    -77.54460
#> 179 79.29785    -77.86241
#> 180 81.69942    -78.75083
#> 181 83.85002    -78.72521
#> 182 82.14366    -78.13542
#> 183 79.35053    -77.44870
#> 184 80.39313    -78.60093
#> 185 83.93737    -80.50491
#> 186 84.07392    -78.84227
#> 187 81.65765    -79.31137
#> 188 84.54190    -82.44243
#> 189 88.29899    -85.10235
#> 190 91.25734    -89.05588
#> 191 95.95799    -86.31677
#> 192 90.32763    -81.04195
#> 193 85.14247    -80.29119
#> 194 84.00587    -80.27536
#> 195 86.07170    -83.35788
#> 196 86.94719    -80.06940
#> 197 84.22259    -79.43354
#> 198 81.80435    -77.56382
#> 199 81.70503    -79.41256
#> 200 85.60565    -82.82386
# }