Model Predictions for var_estimate
Objects
Usage
# S3 method for class 'var_estimate'
predict(object, summary = TRUE, cred = 0.95, iter = NULL, progress = TRUE, ...)
Arguments
- object
object of class
var_estimate
- summary
summarize the posterior samples (defaults to
TRUE
).- cred
credible interval used for summarizing
- iter
number of posterior samples (defaults to all in the object).
- progress
Logical. Should a progress bar be included (defaults to
TRUE
) ?- ...
Currently ignored
Examples
# \donttest{
# data
Y <- subset(ifit, id == 1)[,-1]
# fit model with alias (var_estimate also works)
fit <- var_estimate(Y, progress = FALSE)
# fitted values
pred <- predict(fit, progress = FALSE)
# predicted values (1st outcome)
pred[,,1]
#> Post.mean Post.sd Cred.lb Cred.ub
#> [1,] 0.562116637 0.2530684 7.047629e-02 1.06043810
#> [2,] 0.275213394 0.1829880 -8.213391e-02 0.62982899
#> [3,] -0.078973235 0.3342252 -7.240503e-01 0.58031397
#> [4,] -0.142048665 0.3935211 -9.180291e-01 0.63073174
#> [5,] 0.143452317 0.3454895 -5.186182e-01 0.81591537
#> [6,] 0.373436112 0.1901275 4.155063e-05 0.74554829
#> [7,] 0.490776882 0.2105534 8.225338e-02 0.90584507
#> [8,] 0.477444888 0.2477667 -5.492402e-03 0.95849706
#> [9,] 0.358277691 0.2172837 -6.272708e-02 0.78555251
#> [10,] 0.427936477 0.1744513 8.661729e-02 0.76726888
#> [11,] -0.674634948 0.4729400 -1.601325e+00 0.25698657
#> [12,] -0.564238131 0.4362605 -1.414978e+00 0.29084354
#> [13,] 0.064403245 0.2536513 -4.499693e-01 0.56658634
#> [14,] -0.384257658 0.3857338 -1.144618e+00 0.38015704
#> [15,] 0.088025890 0.1473245 -2.037425e-01 0.37639015
#> [16,] 0.231742073 0.1989877 -1.617990e-01 0.62382415
#> [17,] 0.309860457 0.2421396 -1.721425e-01 0.77754822
#> [18,] 0.202100856 0.2880493 -3.536688e-01 0.77693557
#> [19,] 0.169258377 0.2484374 -3.131845e-01 0.65779008
#> [20,] 0.163323994 0.2178996 -2.716978e-01 0.57704704
#> [21,] -0.326699373 0.3023613 -9.065613e-01 0.25797574
#> [22,] 0.218361908 0.1688934 -1.110106e-01 0.55359163
#> [23,] 0.242063165 0.1449472 -4.010986e-02 0.52572812
#> [24,] 0.093509260 0.3520775 -5.750133e-01 0.78441305
#> [25,] 0.537272598 0.3116809 -8.955718e-02 1.14422577
#> [26,] 0.201712990 0.2239085 -2.487261e-01 0.62858614
#> [27,] 0.212531307 0.1940822 -1.731132e-01 0.58717516
#> [28,] 0.123700196 0.1510170 -1.790853e-01 0.40742234
#> [29,] 0.073644743 0.2312380 -3.798830e-01 0.50782438
#> [30,] -0.232489078 0.2006420 -6.268097e-01 0.16225760
#> [31,] 0.213313886 0.4150521 -5.875407e-01 1.04383330
#> [32,] 0.035622632 0.1951117 -3.501065e-01 0.41772990
#> [33,] -0.213257984 0.1906426 -5.844457e-01 0.16479344
#> [34,] -0.012209867 0.1864097 -3.767937e-01 0.35814147
#> [35,] -0.859939735 0.4338367 -1.706415e+00 -0.01312883
#> [36,] -0.692267562 0.3817743 -1.426711e+00 0.04219090
#> [37,] -0.682558494 0.4395044 -1.523251e+00 0.18022662
#> [38,] -0.676119912 0.4677507 -1.575312e+00 0.24633977
#> [39,] -0.277524547 0.3451404 -9.344363e-01 0.41958231
#> [40,] 0.184394172 0.1323283 -8.600888e-02 0.43795045
#> [41,] -0.184504919 0.1998146 -5.718976e-01 0.20724847
#> [42,] -0.148870351 0.3347575 -8.131257e-01 0.50104219
#> [43,] 0.014785671 0.2477706 -4.736071e-01 0.48920119
#> [44,] 0.012859619 0.2050689 -3.894685e-01 0.41306760
#> [45,] 0.076565853 0.2689260 -4.523174e-01 0.59686589
#> [46,] 0.273007178 0.1216092 3.457424e-02 0.51474194
#> [47,] 0.275132492 0.2003072 -1.180581e-01 0.67456131
#> [48,] -0.306363784 0.3914251 -1.057938e+00 0.46081877
#> [49,] 0.020521789 0.1237684 -2.231005e-01 0.26096913
#> [50,] 0.067156233 0.2220628 -3.619923e-01 0.50123085
#> [51,] 0.044227166 0.1421637 -2.340321e-01 0.32499866
#> [52,] 0.163504313 0.1568781 -1.493948e-01 0.47576460
#> [53,] 0.095206191 0.1910677 -2.808211e-01 0.46795561
#> [54,] 0.165362850 0.1963778 -2.233029e-01 0.55046273
#> [55,] 0.109075512 0.1494754 -1.871606e-01 0.39659964
#> [56,] -0.012615788 0.1939933 -3.895035e-01 0.36525274
#> [57,] 0.521664466 0.2080154 1.071628e-01 0.92680716
#> [58,] 0.107910441 0.2218408 -3.322177e-01 0.53126818
#> [59,] 0.282004263 0.3779949 -4.719417e-01 1.03025125
#> [60,] 0.024918244 0.2651423 -4.880465e-01 0.54521052
#> [61,] -0.055425698 0.2799560 -5.904878e-01 0.49164044
#> [62,] -0.193032978 0.2446824 -6.871462e-01 0.27313507
#> [63,] -0.155117884 0.2257220 -6.029590e-01 0.29148924
#> [64,] 0.239519161 0.3479886 -4.327973e-01 0.94600359
#> [65,] 0.100606385 0.4008387 -6.864504e-01 0.90032811
#> [66,] 0.272291806 0.2203475 -1.667987e-01 0.69533531
#> [67,] -0.364739417 0.3047781 -9.578492e-01 0.22310333
#> [68,] 0.209301820 0.1679051 -1.227002e-01 0.53704797
#> [69,] 0.152907859 0.2434675 -3.229189e-01 0.62717137
#> [70,] -0.401775385 0.4208413 -1.225738e+00 0.42503991
#> [71,] 0.062696250 0.2438335 -3.950021e-01 0.55479591
#> [72,] -0.119110443 0.1927604 -4.956992e-01 0.25656125
#> [73,] -0.119267612 0.2038521 -5.163000e-01 0.28635172
#> [74,] -0.098703495 0.2033451 -4.910126e-01 0.29974858
#> [75,] -0.158171025 0.1683948 -4.930956e-01 0.16895700
#> [76,] -0.062216206 0.1500910 -3.569366e-01 0.23719837
#> [77,] -0.181047296 0.1342543 -4.423782e-01 0.08814742
#> [78,] -0.059011468 0.2819407 -6.112845e-01 0.49723296
#> [79,] -0.490652864 0.3845842 -1.236765e+00 0.25021028
#> [80,] 0.098953806 0.2096484 -3.129931e-01 0.50992196
#> [81,] 0.005505305 0.1009212 -1.896074e-01 0.20596422
#> [82,] -0.286561083 0.2089615 -6.945650e-01 0.13088511
#> [83,] -0.436187709 0.3801805 -1.170028e+00 0.32348652
#> [84,] 0.433089949 0.2550436 -5.966714e-02 0.92124838
#> [85,] 0.204432921 0.2003199 -1.757346e-01 0.59252022
#> [86,] 0.142392426 0.3924371 -6.046808e-01 0.93382160
#> [87,] -0.198069141 0.1700985 -5.286237e-01 0.12498131
#> [88,] -0.058882983 0.2202599 -4.897746e-01 0.37594688
#> [89,] -0.290144118 0.2144236 -7.093497e-01 0.13578498
#> [90,] 0.124421089 0.3419510 -5.446050e-01 0.78001422
#> [91,] -0.226947308 0.3211001 -8.460278e-01 0.41254751
#> [92,] -0.146005112 0.2234470 -5.771400e-01 0.29470521
#> [93,] -0.267397549 0.2825103 -8.338310e-01 0.28354674
# }