BLRM.fit.mwg: Bayesian Logistic Regression Model (BLRM) training

Description Usage Arguments Value Examples

View source: R/RcppWrapper.R

Description

Performs Bayesian Logistic Regression Model training by sampling beta from posterior distribution with user specified parameters and data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
BLRM.fit.mwg(
  Y0,
  X0,
  PriorVar,
  propSD0,
  nMC = 1000,
  nBI = 250,
  thin = 5,
  seed = 1
)

Arguments

Y0

vector of responses

X0

covariate matrix

PriorVar

variance of prior distribution of beta

propSD0

vector of standard deviations for normal proposal density

nMC

number of MCMC samples

nBI

number of burn-in samples

thin

number of samples to skip over in thinning

seed

set seed for random number generation

Value

a nested list of beta samples, and beta acceptance rates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)
propSD = rep(1,p)

## fit model;
test1 <- G3proj::BLRM.fit.mwg(Y0 = Y, X0 = X, PriorVar = 1000, propSD0 = propSD,
                      nMC = 500, nBI = 100, thin = 5)

lcw68/G3proj documentation built on Dec. 21, 2021, 9:46 a.m.