Description Usage Arguments Value Author(s) See Also Examples
Graphical visualization of the HPDI's of the weight matrix computed during the estimation of
vbpca
. Note that no intervals will be plotted if hpdi = FALSE
is specified in the
control
argument.
1 |
obj |
list; |
d |
integer; |
vars |
array_like; |
the graphical visualization of the high posterior density intervals.
D. Vidotto <d.vidotto@uvt.nl>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Create a synthetic dataset
I <- 1e+3
X1 <- rnorm(I, 0, 50)
X2 <- rnorm(I, 0, 30)
X3 <- rnorm(I, 0, 10)
X <- cbind(X1, X1, X1, X2, X2, X2, X3, X3 )
X <- X + matrix(rnorm(length(X), 0, 1), ncol = ncol(X), nrow = I )
colnames(X) <- paste('X', 1:8, sep='')
# Estimate the Bayesian PCA model, with Inverse Gamma priors for tau
# and SVS with Beta priors for priorInclusion, and compute 90% HPD intervals
ctrl <- vbpca_control( alphatau = 1., betatau = 1e-02, beta1pi = 1., beta2pi = 1.,
hpdi = TRUE, probHPDI = 0.9, plot.lowerbound = FALSE )
mod <- vbpca(X, D = 3, priorvar = 'invgamma', SVS = TRUE, control = ctrl )
# Plot the intervals of variables (1, 2, 3) of the second column of the W matrix:
plothpdi(mod, d = 2, vars = 1:3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.