weights_formulate: Posterior distribution parameters for mixture priors of Beta...

Description Usage Arguments Details Value See Also Examples

View source: R/weights_formulate.R

Description

weights_formulate calculates posterior distribution paramters when a Binomial Likelihood is given and mixture of two Beta distribution is taken as prior for the parameter pt in the Binomial Distribution

Usage

1
2
weights_formulate(w = NULL, x, n, a1 = NULL, b1 = NULL, a2 = NULL,
  b2 = NULL)

Arguments

w

Weight on the first Beta distribution of the mixture Prior

x

Total Number of events (In Dose Escalation Oncology Trials, this may be defined as number of people who have experienced Dose Limiting Toxicities through administration of current Dose Level)

n

Trial size (In Dose Escalation Oncology Trials, this may be defined as total number of people who have been administered current Dose Level (missing responses will be excluded). Necessarily n will be greater than or equal to x

a1

alpha parameter ( > 0) for 1st Beta distribution, must be input properly when w = 0 or 1

b1

beta parameter ( > 0) for 1st Beta distribution, must be input properly properly when w = 0 or 1

a2

alpha parameter ( > 0) for 2nd Beta distribution, will not be used if w = 0 or 1

b2

beta parameter ( > 0) for 2nd Beta distribution, will not be used if w = 0 or 1

Details

While using the function for Oncology Dose Escalation Trials, w is assumed to be the weight taken on the 1st Prior Distribution of the mixture, named as Informative Prior, that is, the Beta Distribution aring from the past studies. Hence, (1 - w) represents the weight on the 2nd part of the Beta distribution. When w takes the value 0 or 1(implies exstence of a single Prior Beta distribution), weights_formulate by default takes a1 and b1 as model parameters and ignores a2 and b2.

Let, x|p ~ Binom(n,p) hence, f(x|p) = choose(n, x) * p^x (1 - p)^(n-x) and p ~ g(p) = w * dbeta(p, a1, b1) + (1 - w) * dbeta(p, a2, b2) is the prior for p

Then the unconditional distribution of x is given by,

P(X = x) = f(x) = choose(n,x) * [w * (beta(a1 + x, b1 + n - x)/beta(a1, b1)) + (1 - w) * (beta(a2 + x, b2 + n - x)/beta(a2, b2)) ]

The prior distribution for p becomes,

g(p|x) = (f(x | p) * g(p) / f(x)) = w_1 * dbeta(p, a1 + x, b1 + n - x) + (1 - w_1) * dbeta(p, a2 + x, b2 + n - x)

where, w1 = (w * beta(a1 + x , b1 + n - x) / beta(a1, b1))/((w * beta(a1 + x , b1 + n - x) / beta(a1, b1)) + ((1 - w) * beta(a2 + x , b2 + n - x) / beta(a2, b2)))

Please remember that, dbeta(p, a, b) refers to the pdf of Beta distribution of p with parameters a and b , while beta(a,b) gives us the value of beta function with parameters a and b

Value

weights Weight on the 1st part of the Posterior Mixture Beta Distribution. When there is only one Beta distribution, this value will always return 0 (or 1) , if we pass the value of w as 0 (or 1)

param_inform Parameters (alpha, beta) for the 1st Beta distribution. When there is only one prior, these values are returned.

param_noninform Parameters (alpha, beta) for the 2nd Beta distribution. When there is only one prior, these values are returned as NULL

See Also

Special to know about beta(a,b) function

Beta to know about beta distribution function

Binomial to know about Binomial Distribution function

https://en.wikipedia.org/wiki/Beta-binomial_distribution to know about Beta Binomial distribution, the unconditional distribution of x

https://www.cancer.gov/publications/dictionaries/cancer-terms/def/dose-limiting to know about Dose Limiting Toxicity (DLT)

Examples

1
2
3
weights_formulate(w = 1, x = 1, n = 3, a1 = 1, b1= 1,
a2 = 1, b2 = 1) #Will show an warning but return values
weights_formulate(w = 0.1, x = 1, n = 3, a1 = 1, b1= 1, a2 = 1, b2 = 1)

anirban0451/tpidesigns documentation built on Dec. 7, 2019, 5:35 p.m.