Skip to contents

Computes history for a fitted model, uses only mean values for each history parameter. Uses values for each random cluster, if "random" or "1|random" parametrisation was used.

Usage

extract_history(object)

Arguments

object

An object of class cumhist

Value

A matrix of cumulative history values for each state

Examples

# \donttest{
br_fit <- fit_cumhist(br_singleblock, state = "State", duration = "Duration")
#> 
#> SAMPLING FOR MODEL 'historylm' NOW (CHAIN 1).
#> Chain 1: 
#> Chain 1: Gradient evaluation took 0 seconds
#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 1: Adjust your expectations accordingly!
#> Chain 1: 
#> Chain 1: 
#> Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 1: 
#> Chain 1:  Elapsed Time: 4.554 seconds (Warm-up)
#> Chain 1:                4.275 seconds (Sampling)
#> Chain 1:                8.829 seconds (Total)
#> Chain 1: 
extract_history(br_fit)
#>               1         2
#>  [1,] 0.0000000 0.0000000
#>  [2,] 0.4447766 0.0000000
#>  [3,] 0.2251146 0.4938705
#>  [4,] 0.5424931 0.2915904
#>  [5,] 0.3170203 0.5860220
#>  [6,] 0.7995474 0.1719958
#>  [7,] 0.3089143 0.6800911
#>  [8,] 0.7639363 0.2323081
#>  [9,] 0.3391252 0.6592076
#> [10,] 0.6997565 0.2994861
#> [11,] 0.2515760 0.7481517
#> [12,] 0.8344187 0.1655210
#> [13,] 0.2551863 0.7447953
#> [14,] 0.7836364 0.2163583
#> [15,] 0.2875886 0.7124095
#> [16,] 0.7281983 0.2718009
#> [17,] 0.2591222 0.7408775
#> [18,] 0.6695000 0.3304999
#> [19,] 0.2823764 0.7176235
#> [20,] 0.6871171 0.3128828
#> [21,] 0.2647937 0.7352063
#> [22,] 0.7121947 0.2878053
#> [23,] 0.2340086 0.7659914
#> [24,] 0.7728592 0.2271408
#> [25,] 0.2808030 0.7191970
#> [26,] 0.7112020 0.2887980
#> [27,] 0.1775154 0.8224846
#> [28,] 0.7484635 0.2515365
#> [29,] 0.1707358 0.8292642
#> [30,] 0.8053548 0.1946452
#> [31,] 0.3135678 0.6864322
#> [32,] 0.7655259 0.2344741
#> [33,] 0.2867818 0.7132182
#> [34,] 0.7637795 0.2362205
#> [35,] 0.1986463 0.8013537
#> [36,] 0.6997964 0.3002036
#> [37,] 0.2365928 0.7634072
#> [38,] 0.8460380 0.1539620
#> [39,] 0.2292830 0.7707170
#> [40,] 0.7340819 0.2659181
#> [41,] 0.3841714 0.6158286
#> [42,] 0.6021592 0.3978408
#> [43,] 0.2350566 0.7649434
#> [44,] 0.8218321 0.1781679
#> [45,] 0.2894481 0.7105519
#> [46,] 0.8314946 0.1685054
#> [47,] 0.4350390 0.5649610
#> [48,] 0.5860071 0.4139929
#> [49,] 0.5573041 0.4426959
#> [50,] 0.3419833 0.6580167
#> [51,] 0.4298535 0.5701465
#> [52,] 0.6456085 0.3543915
#> [53,] 0.2513700 0.7486300
#> [54,] 0.7016166 0.2983834
#> [55,] 0.1737771 0.8262229
#> [56,] 0.8618899 0.1381101
#> [57,] 0.3099458 0.6900542
#> [58,] 0.4324507 0.5675493
#> [59,] 0.4699364 0.5300636
#> [60,] 0.6504478 0.3495522
#> [61,] 0.2262182 0.7737818
#> [62,] 0.6232824 0.3767176
#> [63,] 0.3004184 0.6995816
#> [64,] 0.7838382 0.2161618
#> [65,] 0.2075663 0.7924337
#> [66,] 0.6545000 0.3455000
#> [67,] 0.2965075 0.7034925
#> [68,] 0.7997498 0.2002502
#> [69,] 0.2058730 0.7941270
#> [70,] 0.8077604 0.1922396
#> [71,] 0.1399738 0.8600262
#> [72,] 0.8562394 0.1437606
#> [73,] 0.2721579 0.7278421
#> [74,] 0.7686535 0.2313465
#> [75,] 0.2104650 0.7895350
#> [76,] 0.8221962 0.1778038
# }