% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/imp.R
\name{imp}
\alias{imp}
\title{Rejection sampling of standardized truncated univariate normal distribution}
\usage{
imp(a, b)
}
\arguments{
\item{a}{lower bound for truncation.}

\item{b}{upper bound for truncation (must be \code{> a}).}
}
\value{
\code{imp} returns a list
\code{x}: sampled value; and
\code{acc}: total number of draw used.
}
\description{
\code{imp} contains a general function for rejection sampling of standardized truncated univariate normal distribution in (a,b).
}
\examples{
imp(1,Inf) # Case 1: [a,infty)
imp(-1,1) # Case 2: 0 in [a,b], a<0<b
imp(1,2) # Case 3: [a,b], a>=0

}
