Description Usage Arguments Details Value See Also Examples
A test function provide logistic regression (require package "BayesLogit") for testing Weierstrass rejection sampling (and comparing to the fullset posterior/averaging/weighted averaging combiners).
1 2 |
n |
The total sample size. Default is 10000. |
samp |
The posterior sample size on each subset. Default is 20000. |
p |
The number of predictors (intercept is always included, so the total number of coefficients will be p+1). Default is 5. |
m |
Number of subsets. Default is 20. |
r |
The correlation between predictors. Default is 0.3. |
draw |
Indicate whether the result should be plotted. |
accept |
The acceptance rate for the Weierstrass rejection sampling. |
The function generates data from a logistic regression and make use of Weierstrass rejection sampler, weighted average and averge to combine the subset posterior samples. The coefficients of the model is generated by the following formula
β_i \sim (-1)^{ber(0.6)}|N(0,4)|
Both the weighted and unweighted weierstrass sampler will be used, and the results are saved for further processing.
A list containing several components.
Samples: a list containing all subset posterior samples. Input for weierstrass rejection samping.
true.posterior: a matrix containing posterior samples drawn with full data set.
CombSample.weight: a matrix containing combined samples generated by the Weierstrass rejection sampler
CombSample.unweight: a matrix containing combined samples generated by the unweighted Weierstrass rejection sampler
weight.ave: a matrix containing combined samples via inverse-variance weighted averaging.
ave: a matrix containing combined samples via simple averaging.
weierstrass
for the details of weierstrass rejection sampling. BinTest
for another test on the binomial data.
1 2 | ## Not run: logitTest()
## Not run: logitTest(n = 20000, p = 10, m = 50, r = 0.4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.