% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCpj.R
\name{MCpj}
\alias{MCpj}
\title{Generate distribution of timing errors}
\usage{
MCpj(Emean, pzero = NULL, maxterr = 10, pinterv = 0.99, fill.short.side = TRUE)
}
\arguments{
\item{Emean}{scalar or vector of size two. Expected size of non-zero timing errors. If a vector, the first value is used for negative errors and the second value for positive errors. If a scalar, the value is used for both negative and positive errors. Values must be strictly greater than 1.}

\item{pzero}{number in range [0,1]. Probability of no-error. If \code{NULL} (default), \code{pzero} is set to the the greatest probability of zero between the right and left side Poisson distributions.}

\item{maxterr}{integer. Maximal error size to consider. Default is 10.}

\item{pinterv}{control value used for solving numerically an implicit function. Default is .99 and should be increased in case the zero of the implicit function cannot be found because of ending values of same sign.}

\item{fill.short.side}{logical. Should the shortest side be filled with zeros to equal length of the other side. Default is \code{TRUE}.}
}
\value{
The vector of probabilities Pj with the computed \code{lambda} values as attribute.
}
\description{
Generates a distribution of timing errors that complies with the provided expected size of non-zero timing errors and the expected probability of no error.
}
\details{
Currently \code{\link{MCseqReplicate}} expects a vector Pj with same number of backward and forward error values. To comply with this, the shorter side of Pj is by default filled with zeros.
}
\examples{
# expected timing error of 1.2 on each side
MCpj(Emean=1.2, pzero=.4)

# expected backward timing error higher than for forward errors
MCpj(Emean=c(3.5,1.2), pzero=.4)


}
\seealso{
\code{\link{MCseqReplicate}}
}
