summary
method for class "bkmrfit"
Arguments
- object
an object of class "bkmrfit"
- q
quantiles of posterior distribution to show
- digits
the number of digits to show when printing
- show_ests
logical; if
TRUE
, prints summary statistics of posterior distribution- show_MH
logical; if
TRUE
, prints acceptance rates from the Metropolis-Hastings algorithm- ...
further arguments passed to or from other methods.
Examples
## First generate dataset
set.seed(111)
dat <- SimData(n = 50, M = 4)
y <- dat$y
Z <- dat$Z
X <- dat$X
## Fit model with component-wise variable selection
## Using only 100 iterations to make example run quickly
## Typically should use a large number of iterations for inference
set.seed(111)
fitkm <- kmbayes(y = y, Z = Z, X = X, iter = 100, verbose = FALSE, varsel = TRUE)
#> Iteration: 10 (10% completed; 0.00479 secs elapsed)
#> Iteration: 20 (20% completed; 0.01022 secs elapsed)
#> Iteration: 30 (30% completed; 0.01544 secs elapsed)
#> Iteration: 40 (40% completed; 0.02056 secs elapsed)
#> Iteration: 50 (50% completed; 0.03398 secs elapsed)
#> Iteration: 60 (60% completed; 0.0398 secs elapsed)
#> Iteration: 70 (70% completed; 0.04525 secs elapsed)
#> Iteration: 80 (80% completed; 0.05047 secs elapsed)
#> Iteration: 90 (90% completed; 0.05558 secs elapsed)
#> Iteration: 100 (100% completed; 0.06082 secs elapsed)
summary(fitkm)
#> Fitted object of class 'bkmrfit'
#> Iterations: 100
#> Outcome family: gaussian
#> Model fit on: 2023-12-07 19:00:26
#> Running time: 0.06099 secs
#>
#> Acceptance rates for Metropolis-Hastings algorithm:
#> param rate
#> 1 lambda 0.1010101
#> 2 r/delta (overall) 0.5252525
#> 3 r/delta (move 1) 0.3255814
#> 4 r/delta (move 2) 0.6785714
#>
#> Parameter estimates (based on iterations 51-100):
#> param mean sd q_2.5 q_97.5
#> 1 beta 1.88931 0.08176 1.72388 2.04660
#> 2 sigsq.eps 0.50905 0.10964 0.33635 0.74966
#> 3 r1 0.76502 0.13487 0.49609 0.94809
#> 4 r2 1.22987 0.08528 1.09164 1.36021
#> 5 r3 0.00000 0.00000 0.00000 0.00000
#> 6 r4 0.00606 0.01004 0.00000 0.02415
#> 7 lambda 4.56075 0.55773 4.17943 6.14513
#>
#> Posterior inclusion probabilities:
#> variable PIP
#> 1 z1 1.00
#> 2 z2 1.00
#> 3 z3 0.00
#> 4 z4 0.28
#> NULL