Escobar-West augmentation for alpha given K_n with a Gamma(a, b) hyperprior.
Source:R/ghhbp.R
morie_ghosal_hierarchical_bayes.RdEscobar-West augmentation for alpha given K_n with a Gamma(a, b) hyperprior.
Usage
morie_ghosal_hierarchical_bayes(
x,
a_prior = 1,
b_prior = 1,
M = 400,
seed = 0,
deterministic_seed = NULL
)Arguments
- x
Numeric data vector.
- a_prior
Gamma shape hyperparameter (default 1).
- b_prior
Gamma rate hyperparameter (default 1).
- M
Integer number of MCMC iterations (default 400).
- seed
Integer RNG seed (default 0).
- deterministic_seed
Optional integer; if supplied, RNG state is derived via
morie_det_rng()keyed on ("ghhbp", deterministic_seed) so Py<->R streams agree on the canonical fixture. WhenNULL(default) behaviour is unchanged.
Examples
morie_ghosal_hierarchical_bayes(x = rnorm(50))
#> $estimate
#> [1] 1.773259
#>
#> $alpha_se
#> [1] 0.802183
#>
#> $alpha_draws
#> [1] 1.5461710 1.3010831 2.0573008 1.5372509 1.3080979 1.3671531 1.8300648
#> [8] 1.1704377 1.2964644 1.9974553 2.2888494 3.3262279 2.9715410 3.5926287
#> [15] 1.4335570 2.4756082 1.0950105 1.1775254 2.3841599 1.9061864 1.0009245
#> [22] 1.1342109 1.8528024 1.7972708 1.7525236 1.4179328 1.6848614 1.5548366
#> [29] 2.3324711 2.1551181 2.0571221 0.7415710 1.4555970 0.7796734 1.4694838
#> [36] 1.8060339 1.1474861 1.7510352 1.9494259 1.4811314 1.2601147 3.0287722
#> [43] 4.3829488 1.4327199 0.9103379 1.2557454 0.6345918 1.1055127 1.6731670
#> [50] 1.6006012 1.0403745 1.3401487 1.0901126 1.7467462 1.4593079 0.8370741
#> [57] 1.3114396 1.6873894 0.9676195 1.0515785 1.2185810 1.6843051 0.8850352
#> [64] 1.0546058 1.3879970 1.8479718 1.6959724 1.1541191 1.0974324 1.0504225
#> [71] 1.4805361 0.9833314 1.3915213 2.2834459 1.9429739 1.2431744 2.4589480
#> [78] 0.9544856 1.5321232 2.1557271 2.0970986 2.9721070 1.0407405 1.2129195
#> [85] 0.5026218 1.6477276 2.9717559 1.2096230 1.4967306 0.9983613 0.6904602
#> [92] 1.6413022 2.2648917 2.3237204 1.3617307 2.2204281 2.0139799 1.8914756
#> [99] 3.2667596 2.7072000 1.5688552 1.9519197 2.7448013 1.4075200 1.3611379
#> [106] 1.1856722 0.7545106 0.9420514 0.7241569 1.3438558 1.0162363 0.4208578
#> [113] 1.0895392 1.4404923 0.6542715 2.7068710 0.7369990 2.2085741 1.7088563
#> [120] 1.9587081 2.0377632 2.0344334 2.3224806 1.0549906 1.5332552 1.4254238
#> [127] 0.9326015 2.6463620 1.0632556 1.0504192 3.0803463 1.3120862 2.0913432
#> [134] 0.9593692 1.5802882 1.3358703 0.8630909 2.9795926 3.0391218 2.3622407
#> [141] 1.8918132 0.9984658 2.0849382 1.6074614 3.3393650 1.5895143 2.3484276
#> [148] 1.0185229 1.2219064 1.3827362 1.2865617 1.3559042 0.9383224 1.0257179
#> [155] 2.5173743 4.7203973 3.6224424 2.1680322 0.5776028 1.1502392 1.0207135
#> [162] 0.6758330 4.4922808 2.2001807 2.7605796 1.9109422 1.3462596 1.6163821
#> [169] 1.8377519 1.4195768 2.4651551 2.4975561 1.5437023 2.3944415 2.8306795
#> [176] 0.9836628 1.5668880 1.3417819 3.7794672 1.6364938 3.0576345 2.2675215
#> [183] 3.1500405 3.7879029 1.7630730 2.0442150 2.9031727 1.8693139 1.2746829
#> [190] 1.8076144 1.6863975 1.2335611 1.3380270 1.2522434 1.4027476 3.0248182
#> [197] 1.4335584 1.1013873 2.0816609 2.1277423 3.4366816 3.5998427 1.2765110
#> [204] 1.0961100 1.1587436 2.6068845 3.9874822 3.2635065 1.3313595 2.0688615
#> [211] 3.6953065 1.6038459 2.4927054 0.4739703 0.9375832 1.0486311 2.1822544
#> [218] 2.2177905 0.8479119 1.1206250 2.2290605 2.8725761 2.1338241 2.5719433
#> [225] 2.5012559 1.1800192 1.8724568 2.8051384 1.8442893 2.1125089 3.3100294
#> [232] 2.1365388 3.7784466 1.5582443 4.1989711 2.5059443 2.1967676 1.2403729
#> [239] 2.0675011 2.2754682 1.4401761 1.9694919 2.4978704 0.8469237 1.5597475
#> [246] 1.7477165 1.3656512 1.2170181 0.7877377 0.9730968 1.2744572 1.8375259
#> [253] 4.1709791 2.9163872 1.6503330 2.1318659 3.1790339 1.4667005 2.1883821
#> [260] 2.5249197 1.1049547 1.8836166 1.5280196 1.5425429 1.5184188 1.4503570
#> [267] 2.8346608 1.1344377 0.5044114 1.5533961 1.4842419 1.2836411 1.1290011
#> [274] 0.6566242 2.2531656 1.8596482 1.8988159 0.8722794 1.4801637 2.2427720
#> [281] 1.6980723 1.6352531 0.9739736 1.1010946 1.2211078 2.8253610 1.8545625
#> [288] 1.3040178 0.7181434 1.3910174 1.2736471 2.2686810 2.0486332 1.4931024
#> [295] 0.7210882 0.9722704 1.2803751 1.8122133 0.8774872 2.0700093
#>
#> $K_n
#> [1] 7
#>
#> $n
#> [1] 50
#>
#> $method
#> [1] "Escobar-West augmentation for alpha | K_n"
#>