rejectregion: Find the rejection region

Description Usage Arguments Details Value Examples

View source: R/ultility.R

Description

Find the rejection region

Usage

1
2
3
4
5
rejectregion.npnorm(result, alpha = 0.05)

rejectregion.npt(result, alpha = 0.05)

rejectregion(result, alpha = 0.05)

Arguments

result

an object class nspmix

alpha

the FDR controlling rate.

Details

Find the rejection region based on the family in the result The rejection region is calculated using the density estimate rather than data points hence robust. The rejection is based on the hypothesis is located at 0. The optimisation is done via NLopt library (The package nloptr)

Value

a list with par is the boundary for rejection and area is the propotion of rejection

Examples

1
2
3
4
5
6
7
data = rnorm(500, c(0, 2))
x = makeobject(data, pi0 = 0.5)
r1 = computemixdist(x)
rejectregion(r1)
x2 = makeobject(data, pi0 = 0.5, method = "nptll") # equivalent to normal
r2 = computemixdist(x2)
rejectregion(r2)

xiangjiexue/npfixedcompR documentation built on Jan. 1, 2021, 11:39 p.m.