📄 readme_bvsgs
字号:
************************************************************************* bvsgs_sp: Bayesian Variable Selection - Gibbs Sampler, Selection prior************************************************************************ (Matlab version 5 required)REFERENCE: Brown, P.J., Vannucci, M. and Fearn, T.---------- JRSS Series B, 60(3), 1998, pp. 627-641. ************************ LIST OF MATLAB FUNCTIONS ************************bvsgs_sp.m -- Main programgibbs_sp.m -- Gibbs sampleritergs_sp.m -- called by gibbs_spbernoulli.m -- called by itergs_spgofg_sp.m -- log relative probability functionrepliche.m -- search for replicatesprobord.m -- posterior and marginal probs + orderingpbvs_sp.m -- prediction ***** USAGE *****[Gamma, GammD, logProb, logProbD, PostGamD, MargGam, SWITCH]= ...bvsgs_sp(gamprec, X,Y, delta,k, w, v1)Inputs: gamprec, starting binary vector.------- If gamprec=[] the program asks for r to select a starting vector with first r elements equal to 1 X, independent variables, n by p Y, response variables, n by q delta, k, hyperparameters Inverse Wishart w, Bernoulli priors with w_j = w, j=1...p v1, hyperparameter normal selection prior (column vector (p by 1) of standard deviations)Outputs: Gamma, all visited vectors (in sparse form)-------- (Gamma(1,:) contains the starting vector) GammaD, distinct visited vectors, ordered according to their (normalized) relative post prob (matrix in sparse form) logProb, log-relative post probs of all visited vectors logProbD log-relative posterior probabilities of distinct visited vectors PostGamD normalized ordered relative probs of distinct visited vectors MargGam marginal probs of components SWITCH, number of component switches (out of p) from iteration to iterationFunctions called by BVS_GSsP:---------------------------gofg_sp, gibbs_sp, repliche, probordNotes:------_ Data must be centered_ The programs asks for possible permuting of the data and for the Gibbs parameters (initial number of variables included, number of iterations)_ QR matrices updated every m iterations (m provided by the user)._ Programs use sparse matrices. To convert to the full form use the Matlab function full.m ********** PREDICTION **********[BayesPred,LSPred,ILS,IB]=pbvs_sp(X,Y,Xf,Yf,PostGamD,GammaD,numero)Inputs:------- X, independent variables - calibration data Y, response variables - calibration data Xf, independent variables - future data Yf, response variables - future data PostGamD, normalized ordered relative probabilities of distinct visited vectors GammaD, distinct visited vectors, ordered according to their (normalized) relative post. prob. (PostGamD) numero, number of most likely models for Bayes prediction Outputs:-------- BayesPred Bayes prediction with the 'numero' most likely models LSPred Least Squares prediction with the best model ILS Indices of selected variables for LS prediction IB Indices of selected variables for Bayes prediction *************** PARALLEL CHAINS ***************Use BVS_GSsP.m to obtain the chains(ex. [Gamma1, GammD1, logProb1, logProbD1, PostGamD1, MargGam1, SWITCH1]= ... bvsgs_sp(gamprec, X,Y, delta,k, w, v1) [Gamma2, GammD2, logProb2, logProbD2, PostGamD2, MargGam2, SWITCH2]= ... bvsgs_sp(gamprec, X,Y, delta,k, w, v1) )Pool together distinct visited vectors(ex. Gamma = [GammaD1' GammaD2']'; )Pool together log-relative post probabilities of distinct visited vectors(ex. logProb = cat(2, logProbD1, logProbD2); )Use repliche.m to search for replications(ex. [GammaD, logProbD]=repliche(Gamma, logProb); )Use ProbOrd.m to get normalized posterior and marginal probs andto order the distinct visited vectors according to probability(ex. [GammaD, logProbD, PostGamD, MargGam]=probord(logProbD, GammaD); )Do prediction using PostGamD and GammaD**********************************Copyright (c) 1997 Marina Vannucci**********************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -