Package 'imprecise101'

Title: Introduction to Imprecise Probabilities
Description: An imprecise inference presented in the study of Walley (1996) <doi:10.1111/j.2517-6161.1996.tb02065.x> is one of the statistical reasoning methods when prior information is unavailable. Functions and utils needed for illustrating this inferential paradigm are implemented for classroom teaching and further comprehensive research. Two imprecise models are demonstrated using multinomial data and 2x2 contingency table data. The concepts of prior ignorance and imprecision are discussed in lower and upper probabilities. Representation invariance principle, hypothesis testing, decision-making, and further generalization are also illustrated.
Authors: Chel Hee Lee [aut, cre] , Mikelis Bickis [ctb], Angela McCourt [ctb]
Maintainer: Chel Hee Lee <[email protected]>
License: GPL-3
Version: 0.2.2.4
Built: 2024-11-29 09:04:20 UTC
Source: CRAN

Help Index


Beta-Binomial Distribution

Description

This function computes the predictive posterior density of the outcome of interest under the imprecise Dirichlet prior distribution. It follows a beta-binomial distribution.

Usage

dbetabinom(i, M, x, s, N, tA)

pbetabinom(M, x, s, N, y)

Arguments

i

number of occurrences of event A in the M future trials

M

number of future trials

x

number of occurrence of event A in the N previous trials

s

learning parameter

N

total number of previous trials

tA

prior probability of event A under the Dirichlet prior

y

maximum number of occurrences of event A in the M future trials

Value

dbetabinom returns a scalar value of density and pdetabinom returns a list of scalars corresponding to the lower and upper probabilities of the distribution.

Examples

pbetabinom(M=6, x=1, s=1, N=6, y=0)

Distribution of Difference of Two Proportions

Description

Distribution of Difference of Two Proportions

Usage

dbetadif(x, a1, b1, a2, b2)

Arguments

x

difference of two beta distributions

a1

shape 1 parameter of Beta distribution with control

b1

shape 2 parameter of Beta distribution with control

a2

shape 1 parameter of Beta distribution with treatment

b2

shape 2 parameter of Beta distribution with treatment

Value

betadif gives a scalar value of density.

References

Chen, Y., & Luo, S. (2011). A few remarks on 'Statistical distribution of the difference of two proportions' by Nadarajah and Kotz, Statistics in Medicine 2007; 26 (18): 3518-3523. Statistics in Medicine, 30(15), 1913-1915.


Impreicse Beta Model

Description

This function computes lower and upper posterior probabilities under an imprecise Beta model when prior information is not available.

Usage

ibm(n = 10, m = 6, s0 = 2, showplot = TRUE, xlab1 = NA, main1 = NA)

Arguments

n

total of trials

m

number of observations realized

s0

learning parameter

showplot

logical, TRUE by default

xlab1

x axis text

main1

main title text

Value

ibm returns data.frame containing posterior probabilities on the mean parameter space.

References

Walley, P. (1996), Inferences from Multinomial Data: Learning About a Bag of Marbles. Journal of the Royal Statistical Society: Series B (Methodological), 58: 3-34. https://doi.org/10.1111/j.2517-6161.1996.tb02065.x

Examples

tc <- seq(0,1,0.1)
s <- 2
ibm(n=10, m=6)

Imprecise Dirichlet Model

Description

This function computes lower and upper posterior probabilities under an imprecise Dirichlet model when prior information is not available.

This function searches for the lower and upper bounds of a given level of the highest posterior density interval under the imprecise Dirichlet prior.

Usage

idm(nj, s = 1, N, tj = NA_real_, k, cA = 1)

hpd(
  alpha = 3,
  beta = 5,
  p = 0.95,
  tolerance = 1e-04,
  maxiter = 100,
  verbose = FALSE
)

Arguments

nj

number of observations in the j th category

s

learning parameter

N

total number of drawings

tj

mean probability associated with the j th category

k

number of elements in the sample space

cA

the number of elements in the event A

alpha

shape1 parameter of beta distribution

beta

shape2 parameter of beta distribution

p

level of credible interval

tolerance

level of error allowed

maxiter

maximum number of iterations

verbose

logical option suppressing messages

Value

idm returns a list of lower and upper probabilities.

p.lower

Minimum of imprecise probabilities

p.upper

Maximum of imprecise probabilities

v.lower

Variance of lower bound

v.upper

Variance of upper bound

s.lower

Standard deviation of lower bound

s.upper

Standard deviation of upper bound

p

Precise probabilty

p.delta

Degree of imprecision

hpd gives a list of scalar values corresponding to the lower and upper bounds of highest posterior probability density region.

References

Walley, P. (1996), Inferences from Multinomial Data: Learning About a Bag of Marbles. Journal of the Royal Statistical Society: Series B (Methodological), 58: 3-34. https://doi.org/10.1111/j.2517-6161.1996.tb02065.x

Examples

idm(nj=1, N=6, s=2, k=4)
x <- hpd(alpha=3, beta=5, p=0.95) # c(0.0031, 0.6587) when s=2
# round(x,4); x*(1-x)^5