BVS4GCR | R Documentation |
MCMC implementation of Bayesian Variable Selection for Gaussian Copula Regression models
BVS4GCR( Y, X, pFixed, responseType, EVgamma = c(2, 4), tau = 1, niter, burnin, thin, monitor, fullCov = FALSE, nonDecomp = FALSE, nTrial = NULL, negBinomParInit = NULL, link = "probit", alpha = 0.05, probAddDel = 0.9, probAdd = 0.5, probMix = 0.25, geomMean = EVgamma[1], graphParNiter = max(16, dim(Y)[2] * dim(Y)[2]), std = FALSE, seed = 31122021 )
Y |
(number of samples) times (number of responses) matrix of responses |
X |
(number of samples) times (number of predictors) matrix of predictors. If the model contains an intercept (for all responses), the first column is a vector of ones, followed by the covariates and the predictors on which Bayesian Variable Selection is performed |
pFixed |
Number of covariates (including the intercept) |
responseType |
Character vector specifying the response's type. Response's types currently supported are |
EVgamma |
A priori number of expected predictors associated with each response and its variance. For details, see
\insertCiteKohn2001;textualBVS4GCR and \insertCiteAlexopoulos2021;textualBVS4GCR. Default value is |
tau |
Prior variance of the beta (regression coefficient) prior with the default value set at |
niter |
Number of MCMC iterations (including burn-in) |
burnin |
Number of iterations to be discarded as burn-in |
thin |
Store the outcome at every thin-th iteration |
monitor |
Display the monitored-th iteration |
fullCov |
Logical parameter to select full or sparse inverse correlation |
nonDecomp |
Logical, |
nTrial |
Number of trials of binomial responses if |
negBinomParInit |
Initial value for the over-dispersion parameter of the negative binomial distribution |
link |
Specification for the model link function with default value ( |
alpha |
Level of significance ( |
probAddDel |
Probability ( |
probAdd |
Probability ( |
probMix |
Probability ( |
geomMean |
Mean of the geometric proposal distribution that samples the index of the predictor being added/deleted. Default
value is the number of expected predictors directly associated with each response and specified in |
graphParNiter |
Number of Markov chain Monte Carlo internal iterations to sample the graphical model between responses. Default value is the max between 16 and the square of the number of responses |
std |
Logical parameter to standardise the predictors before the analysis. Default value is set at |
seed |
Seed used to initialise the Markov chain Monte Carlo algorithm |
For details regarding the model and the algorithm, see details in \insertCiteAlexopoulos2021;textualBVS4GCR. Types of
responses currently supported: c("Gaussian", "binary", "ordinal", "binomial", "negative binomial")
. For ordinal
categorical responses it is assumed that the first category is labelled with zero. The maximum number of categories
supported is currently 5.
The value returned is a list object list(B, G, R, D, Cutoff, NBPar)
Β
Matrix of the (thinned) samples drawn from the posterior distribution of the regression coefficients
G
3D array of the (thinned) samples drawn from the posterior distribution of the graphs
R
3D array of the (thinned) samples drawn from the posterior distribution of the correlation matrix between the
responses
D
Matrix of the (thinned) samples drawn from the posterior distribution of the standard deviations of the
responses (non-identifiable parameters in the case of discrete responses)
cutPoint
List of the samples drawn from the posterior distribution of the cut-off points for ordinal categorical
responses
NBPar
List of the samples drawn from the posterior distribution of the over-dispersion parameter for the negative
responses
postMean
List of the posterior means of list(B, G, R, D)
hyperPar
List of the hyper-parameters list(tau)
and the parameters of the beta-binomial distribution
derived from EVgamma
samplerPar
List of parameters used in the Markov chain Monte Carlo algorithm
list(alpha, probAddDel, probAdd, probMix, geomMean, graphParNiter)
opt
List of options used list(std, seed)
# Example 1: Toy example with only Gaussian responses and decomposable graphs specification d <- Sim_GCRdata(m = 4, n = 500, p = 100, pFixed = 2, responseType = rep("Gaussian", 4), extras = list(rhoY = 0.8, rhoX = 0.7, fixedEffect = rep(1, 2), muEffect = rep(3, 4), varEffect = rep(0.5, 4), s1Lev = 0.05, s2Lev = 0.95, sdResponse = rep(1, 4)), seed = 28061971) output <- BVS4GCR(d$Y, d$X, pFixed = 2, responseType = rep("Gaussian", 4), EVgamma = c(5, 3^2), niter = 250, burnin = 50, thin = 4, monitor = 50, seed = 280610971) # Example 2: Toy example with only Gaussian responses and non-decomposable graphs d <- Sim_GCRdata(m = 8, n = 1000, p = 100, pFixed = 1, responseType = rep("Gaussian", 8), extras = list(rhoY = 0.8, rhoX = 0.7, fixedEffect = 1, muEffect = rep(3, 8), varEffect = rep(0.5, 8), s1Lev = 0.10, s2Lev = 0.90, sdResponse = rep(1, 8)), seed = 28061971) output <- BVS4GCR(d$Y, d$X, pFixed = 1, responseType = rep("Gaussian", 8), EVgamma = c(5, 3^2), niter = 250, burnin = 50, thin = 4, monitor = 50, nonDecomp = TRUE, seed = 280610971) # Example 3: Combination of Gaussian, binary and ordinal responses (similar to Scenario I in # Alexopoulos and Bottolo (2021)) d <- Sim_GCRdata(m = 4, n = 50, p = 30, pFixed = 1, responseType = c("Gaussian", "binary", "ordinal", "ordinal"), extras = list(rhoY = 0.8, rhoX = 0.7, fixedEffect = 1, muEffect = c(1, rep(0.5, 3)), varEffect = c(1, rep(0.2, 3)), s1Lev = 0.15, s2Lev = 0.95, sdResponse = rep(1, 4), nCat = c(3, 4), cutPoint = cbind(c(0.5, NA, NA), c(0.5, 1.2, 2))), seed = 28061971) output <- BVS4GCR(d$Y, d$X, pFixed = 1, responseType = c("Gaussian", "binary", "ordinal", "ordinal"), EVgamma = c(5, 3^2), niter = 250, burnin = 50, thin = 4, monitor = 50, seed = 280610971) # Example 4: Combination of Gaussian and count responses (Scenario IV in Alexopoulos and Bottolo # (2021)) d <- Sim_GCRdata(m = 4, n = 100, p = 100, pFixed = 2, responseType = c("Gaussian", "binomial", "negative binomial", "negative binomial"), extras = list(rhoY = 0.8, rhoX = 0.7, fixedEffect = c(-0.5, 0.5), muEffect = c(1, rep(0.5, 3)), varEffect = c(1, rep(0.2, 3)), s1Lev = 0.05, s2Lev = 0.95, sdResponse = rep(1, 4), nTrial = 10, negBinomPar = c(0.5, 0.75)), seed = 28061971) output <- BVS4GCR(d$Y, d$X, pFixed = 2, responseType = c("Gaussian", "binomial", "negative binomial", "negative binomial"), EVgamma = c(5, 3 ^2), niter = 250, burnin = 50, thin = 4, monitor = 50, seed = 280610971, nTrial = 10, negBinomParInit = rep(1, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.