R/util-internal-test-mean.R

Defines functions tmean3 tmean2 tmean1

#internal test function of expectation for one-inflated distribution

tmean1 <- function(doifun, ...)
  integrate(function(x) x*doifun(x, ...), 0, 1)$value + 1*doifun(x=1, ...)
tmean2 <- function(poifun, ...)
  integrate(function(x) 1-poifun(x, ...), 0, 1)$value
tmean3 <- function(ecoifun, eps=1e-9, ...)
  eps/ecoifun(eps, ...)

Try the mbbefd package in your browser

Any scripts or data that you put into this service are public.

mbbefd documentation built on Aug. 29, 2023, 1:06 a.m.