R/ptpn.R

Defines functions ptpn

Documented in ptpn

ptpn <-
function(x, sigma, lambda, lower.tail=TRUE, log=FALSE)
{
if(is.null(x))
    stop("x must be specified")
  if(is.null(sigma))
    stop("sigma must be specified")
  if(is.null(lambda))
    stop("lambda must be specified")
  if(sigma<=0)
    stop("sigma must be positive")
  if(any(x<=0))
    stop("x's must be positive")
  lf=1-exp(pnorm(x/sigma-lambda, log.p=TRUE, lower.tail = FALSE)-pnorm(lambda, log.p=TRUE))
  if(!lower.tail) lf=1-lf
  if(log) lf=log(lf)
  lf
}

Try the tpn package in your browser

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

tpn documentation built on Sept. 28, 2023, 1:06 a.m.