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(X, y, w, beta, pi, sigma2, sa2)
fit | A Mr.ASH fit obtained, for example, by running
|
---|
A list object with the following elements:
A 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 phi
should sum to
1.)
A p x K matrix containing the posterior means conditional on assignment to each mixture component.
A p x K matrix containing the posterior variances conditional on assignment to each mixture component.
A vector of length p containing the local false discovery rate for each variable
## 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 model. fit <- mr_ash(X, y)#> Fitting mr.ash model (mr.ash 0.1-61). #> number of samples: 200 #> number of variables: 300 #> number of mixture components: 20 #> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #> Mr.ASH terminated at iteration 109.