get.full.posterior | R Documentation |
Recover the parameters specifying the variational
approximation to the posterior distribution of the regression
coefficients. To streamline the model fitting implementation, and
to reduce memory requirements, mr.ash
does not store
all the parameters needed to specify the approximate posterior.
get.full.posterior(fit)
fit |
A Mr.ASH fit obtained, for example, by running
|
A list object with the following elements:
phi |
An p x K matrix containing the posterior assignment
probabilities, where p is the number of predictors, and K is the
number of mixture components. (Each row of |
m |
An p x K matrix containing the posterior means conditional on assignment to each mixture component. |
s2 |
An p x K matrix containing the posterior variances conditional on assignment to each mixture component. |
## generate synthetic data
set.seed(1)
n = 200
p = 300
X = matrix(rnorm(n*p),n,p)
beta = double(p)
beta[1:10] = 1:10
y = X %*% beta + rnorm(n)
## fit mr.ash
fit.mr.ash = mr.ash(X, y)
## recover full posterior
full.post = get.full.posterior(fit.mr.ash)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.