Estimate Bayes Factors for the bbnam
This function uses monte carlo integration to estimate the BFs, and tests the fixed probability, pooled, and pooled by actor models. (See bbnam
for details.)
bbnam.bf(dat, nprior=0.5, em.fp=0.5, ep.fp=0.5, emprior.pooled=c(1, 11), epprior.pooled=c(1, 11), emprior.actor=c(1, 11), epprior.actor=c(1, 11), diag=FALSE, mode="digraph", reps=1000)
dat |
Input networks to be analyzed. This may be supplied in any reasonable form, but must be reducible to an array of dimension m x n x n, where n is |V(G)|, the first dimension indexes the observer (or information source), the second indexes the sender of the relation, and the third dimension indexes the recipient of the relation. (E.g., |
nprior |
Network prior matrix. This must be a matrix of dimension n x n, containing the arc/edge priors for the criterion network. (E.g., |
em.fp |
Probability of false negatives for the fixed probability model |
ep.fp |
Probability of false positives for the fixed probability model |
emprior.pooled |
(alpha,beta) pairs for the (beta) false negative prior under the pooled model |
epprior.pooled |
(alpha,beta) pairs for the (beta) false positive prior under the pooled model |
emprior.actor |
Matrix of per observer (alpha,beta) pairs for the (beta) false negative prior under the per observer/actor model, or something that can be coerced to this form |
epprior.actor |
Matrix of per observer ((alpha,beta) pairs for the (beta) false positive prior under the per observer/actor model, or something that can be coerced to this form |
diag |
Boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the criterion graph can contain loops. Diag is false by default. |
mode |
String indicating the type of graph being evaluated. |
reps |
Number of Monte Carlo draws to take |
The bbnam model (detailed in the bbnam
function help) is a fairly simple model for integrating informant reports regarding social network data. bbnam.bf
computes log Bayes Factors (integrated likelihood ratios) for the three error submodels of the bbnam: fixed error probabilities, pooled error probabilities, and per observer/actor error probabilities.
By default, bbnam.bf
uses weakly informative Beta(1,11) priors for false positive and false negative rates, which may not be appropriate for all cases. (Likewise, the initial network prior is uniformative.) Users are advised to consider adjusting the error rate priors when using this function in a practical context; for instance, it is often reasonable to expect higher false negative rates (on average) than false positive rates, and to expect the criterion graph density to be substantially less than 0.5. See the reference below for a discussion of this issue.
An object of class bayes.factor
.
It is important to be aware that the model parameter priors are essential components of the models to be compared; inappropriate parameter priors will result in misleading Bayes Factors.
Carter T. Butts buttsc@uci.edu
Butts, C. T. (2003). “Network Inference, Error, and Informant (In)Accuracy: A Bayesian Approach.” Social Networks, 25(2), 103-140.
Robert, C. (1994). The Bayesian Choice: A Decision-Theoretic Motivation. Springer.
#Create some random data from the "pooled" model g<-rgraph(7) g.p<-0.8*g+0.2*(1-g) dat<-rgraph(7,7,tprob=g.p) #Estimate the log Bayes Factors b<-bbnam.bf(dat,emprior.pooled=c(3,5),epprior.pooled=c(3,5), emprior.actor=c(3,5),epprior.actor=c(3,5)) #Print the results b
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.