bayes_goal_func: Decision Making using Rate of Correct Classification

View source: R/bayes_goal_func.R

bayes_goal_funcR Documentation

Decision Making using Rate of Correct Classification

Description

Determines the rate of correctly classifying the linear hypothesis as true or false, where the hypothesis test is specified as

H0: u'β = c0

vs.

H1: u'β = c1

. See vignette for more details.

Usage

bayes_goal_func(n, Xn = NULL, K, pi, sigsq, u, beta_0, beta_1)

Arguments

n

sample size (vector or scalar).

Xn

design matrix that characterizing the data. This is specifically given by the normal linear regression model

yn = Xnβ + ε,

ε ~ N(0, σ^2 I_n),

where I_n is an n by n identity matrix. When set to NULL, an appropriate Xn is automatically generated bayesassurance::gen_Xn(). Note that setting Xn = NULL also enables user to pass in a vector of sample sizes to undergo evaluation as the function will automatically adjust Xn accordingly based on the sample size.

K

The amount of utility associated with H0 being correctly accepted.The null hypothesis is not rejected if the posterior probability of H0 is at least 1/(1+K).

pi

constant corresponding to the prior on parameter β such that P(u'β_0) = 1 - P(u'β_1) = π.

sigsq

variance constant of the linear regression model

u

fixed scalar or vector of the same dimension as β_0 and β_1

beta_0

fixed scalar or vector that null hypothesis is set to

beta_1

fixed scalar or vector that alternative hypothesis is set to

Value

a list of objects corresponding to the rate of classifications

  • rc_table: table of sample size and corresponding correct classification rates

  • rc_plot: plot of correct classification rates for varying sample sizes

Examples

## Example
n <- seq(100, 1200, 10)
out <- bayesassurance::bayes_goal_func(n, Xn = NULL, K = 1, pi = 0.5,
sigsq = 1, u = 1, beta_0 = 0.5, beta_1 = 0.6)
out$rc_plot

jpan928/bayesassurance_rpackage documentation built on June 25, 2022, 5:24 a.m.