logp.vs | R Documentation |
Calculates the log-unnormalized posterior probability of a model.
logp.vs(model, X, y, lam0 = 0, a0 = 0, b0 = 0, lam, w)
model |
The indices of active variables. |
X |
The |
y |
The response vector of length |
lam0 |
The precision parameter for |
a0 |
The shape parameter for prior on |
b0 |
The scale parameter for prior on |
lam |
The slab precision parameter. |
w |
The prior inclusion probability of each variable. |
The log-unnormalized posterior probability of the model.
Vivekananda Roy
Roy, V.(2024) A geometric approach to informative MCMC sampling https://arxiv.org/abs/2406.09010
n=50; p=100; nonzero = 3
trueidx <- 1:3
nonzero.value <- 4
TrueBeta <- numeric(p)
TrueBeta[trueidx] <- nonzero.value
rho <- 0.5
xone <- matrix(rnorm(n*p), n, p)
X <- sqrt(1-rho)*xone + sqrt(rho)*rnorm(n)
y <- 0.5 + X %*% TrueBeta + rnorm(n)
result <- geomc.vs(X=X, y=y)
logp.vs(result$median.model,X,y,lam = nrow(X)/ncol(X)^2,w = sqrt(nrow(X))/ncol(X))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.