Description Usage Arguments Value Examples

Main function for variable selection

1 2 3 |

`X` |
covariate with length N, sample size |

`Y` |
multivariate normal response variable N by P |

`initial_chain` |
list of starting points for beta, gamma, sigma, and sigmabeta. beta is length P for the coefficients, gamma is length P inclusion vector where each element is 0 or 1. sigma should be P x P covariance matrix, and sigmabeta should be the expected variance of the betas. |

`Phi` |
prior for the covariance matrix. We suggest identity matrix if there is no appropriate prior information |

`marcor` |
length P vector of correlation between X and each variable of Y |

`niter` |
total number of iteration for MCMC |

`bgiter` |
number of MH iterations within one iteration of MCMC to fit Beta and Gamma |

`hiter` |
number of first iterations to ignore |

`burnin` |
number of MH iterations for h, proportion of variance explained |

`Vbeta` |
variance of beta |

`smallchange` |
perturbation size for MH algorithm |

`verbose` |
if set TRUE, print gamma for each iteration |

list of posterior beta, gamma, and covariance matrix sigma

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
beta = c(rep(0.5, 3), rep(0,3))
n = 200; T = length(beta); nu = T+5
Sigma = matrix(0.8, T, T); diag(Sigma) = 1
X = as.numeric(scale(rnorm(n)))
error = MASS::mvrnorm(n, rep(0,T), Sigma)
gamma = c(rep(1,3), rep(0,3))
Y = X %*% t(beta) + error; Y = scale(Y)
Phi = matrix(0.5, T, T); diag(Phi) = 1
initial_chain = list(beta = rep(0,T),
gamma = rep(0,T),
Sigma = Phi,
sigmabeta = 1)
result = mmvbvs(X = X,
Y = Y,
initial_chain = initial_chain,
Phi = Phi,
marcor = colMeans(X*Y, na.rm=TRUE),
niter=10,
verbose = FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.