Description Usage Arguments Details Value Examples
Performs hyper parameter tuning of proposal standard deviation that can be used in Bayesian Logistic Regression Model training with user specified parameters and data
1 | BLRM.Tuning(Y0, X0, PriorVar, nMC = 10000, b = 50, seed = 1)
|
Y0 |
vector of responses |
X0 |
covariate matrix |
PriorVar |
variance of prior distribution of beta |
nMC |
number of MCMC samples, should be the multiple of b |
b |
batch size |
seed |
set seed for random number generation |
Runs nMc/b number of batches of size b. In each batch the algorithm calculates the Metropolis acceptance rate and adjusts the proposal standard deviation accordingly. As such, nMC must be a multiple of b.
a nested list of beta samples, beta acceptance rates and proposal SD for each batch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## simulate data;
set.seed(1);
N = 100;
p = 10;
X = matrix(data = rnorm(N*p), nrow=N, ncol=p)
beta_true = c(rep(1,p/2),rep(0,p/2))
eta = X %*% beta_true
pi = exp(eta) / (1 + exp(eta))
Y = rbinom(N,1,pi)
## Compute optimal proposal SD;
test1 <- BLRM.Tuning(Y0 = Y, X0 = X, PriorVar = 1000,
nMC = 100, b = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.