R/rtpn.R

Defines functions rtpn

Documented in rtpn

rtpn <-
function(n, sigma, lambda)
{
if(is.null(n))
    stop("sample size must be specified")
  if(is.null(sigma))
    stop("sigma must be specified")
  if(is.null(lambda))
    stop("lambda must be specified")
  if(n<=0 | round(n)!=n)
    stop("sample size must be a positive integer")      
v=runif(n)
u=runif(n)
sigma*(qnorm(1+pnorm(lambda)*(v-1))+lambda)
}

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.