logitTest: A test function provide logistic regression (require package...

Description Usage Arguments Details Value See Also Examples

View source: R/logitTest.r

Description

A test function provide logistic regression (require package "BayesLogit") for testing Weierstrass rejection sampling (and comparing to the fullset posterior/averaging/weighted averaging combiners).

Usage

1
2
logitTest(n = 20000, samp = 20000, p = 5, m = 20, r = 0.3,
  draw = TRUE, accept = 0.1)

Arguments

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.

Details

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.

Value

A list containing several components.

  1. Samples: a list containing all subset posterior samples. Input for weierstrass rejection samping.

  2. true.posterior: a matrix containing posterior samples drawn with full data set.

  3. CombSample.weight: a matrix containing combined samples generated by the Weierstrass rejection sampler

  4. CombSample.unweight: a matrix containing combined samples generated by the unweighted Weierstrass rejection sampler

  5. weight.ave: a matrix containing combined samples via inverse-variance weighted averaging.

  6. ave: a matrix containing combined samples via simple averaging.

See Also

weierstrass for the details of weierstrass rejection sampling. BinTest for another test on the binomial data.

Examples

1
2
## Not run: logitTest()
## Not run: logitTest(n = 20000, p = 10, m = 50, r = 0.4)

wwrechard/weierstrass documentation built on May 4, 2019, 12:04 p.m.