beta_sample_comparison: Sampling beta distributions and compare the two variables

Description Usage Arguments Value Examples

View source: R/beta_sample_comparison.R

Description

Sampling beta distributions and compare the two variables

Usage

1
2
beta_sample_comparison(sample_size, beta_a1, beta_b1, beta_a2, beta_b2,
  theta1_smaller_than_theta2 = TRUE, plot = FALSE)

Arguments

sample_size

How many samples to produce.

beta_a1

First parameter of theta1.

beta_b1

Second parameter of theta1.

beta_a2

First parameter of theta2.

beta_b2

Second parameter of theta2.

theta1_smaller_than_theta2

How to make the comparison. If FALSE, compute theta1 > theta2.

plot

Whether to plot the figure showing the tendency of probability change.

Value

The probability vector or value. If the variables supplied consists of non-positive numbers, the program will ignore that pair of alpha and beta at the same time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
beta_sample_comparison(sample_size = 5000, beta_a1 = 58, beta_b1 = 44, 
beta_a2 = 31, beta_b2 = 21)

beta_sample_comparison(sample_size = 6000, beta_a1 = c(58, 58), beta_b1 = c(44, 50), 
beta_a2 = 31, beta_b2 = 21)

beta_sample_comparison(sample_size = 7000, beta_a1 = 58, beta_b1 = 44, 
beta_a2 = c(31, 31), beta_b2 = c(21, 30))

beta_sample_comparison(sample_size = 8000, beta_a1 = 58, beta_b1 = 44, 
beta_a2 = 31, beta_b2 = 21, theta1_smaller_than_theta2 = FALSE)

beta_sample_comparison(sample_size = 8000, beta_a1 = 58, beta_b1 = 44, 
beta_a2 = 31, beta_b2 = 21, theta1_smaller_than_theta2 = FALSE, plot = TRUE)

beta_sample_comparison(sample_size = 9000, beta_a1 = 50:60, beta_b1 = 40:50, 
beta_a2 = 31, beta_b2 = 21, plot = TRUE)

beta_sample_comparison(sample_size = 5000, beta_a1 = 58, beta_b1 = 44, 
beta_a2 = 30:40, beta_b2 = 20:30, plot = TRUE)

nathanxli/BayesPD documentation built on June 18, 2020, 4:38 a.m.