BinTest: A test function provide binomial data for testing Weierstrass...

Description Usage Arguments Details Value See Also Examples

View source: R/BinTest.r

Description

A test function provide binomial data for testing Weierstrass rejection sampling (and comparing to the fullset posterior/averaging/weighted averaging combiners).

Usage

1
2
BinTest(prob = 0.001, samp = 20000, n = 20000, m = 20, accept = 0.1,
  draw = TRUE)

Arguments

prob

The parameter for binomial distribution. Default is 0.001.

samp

The posterior sample size on each subset. Default is 20000.

n

The total sample size. Default is 10000.

m

Number of subsets. Default is 20.

accept

The acceptance rate for the Weierstrass rejection sampling. Default is 0.2.

draw

Indicate whether the result should be plotted.

Details

The function generates data from a binomial distribution and make use of Weierstrass rejection sampler, weighted average and averge to combine the subset posterior samples.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. posteriors: 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. logitTest for another test on the logistic regression.

Examples

1
2
3
## Not run: BinTest()
## Not run: BinTest(prob = 0.49)
## Not run: BinTest(prob = 0.99)

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