\HeaderA{twilight.getlambda}{Internal function to compute regularization parameter lambda}{twilight.getlambda}
\keyword{internal}{twilight.getlambda}
\begin{Description}\relax
The SEP method optionally includes a penalty term in order to estimate the percentage of non-significant differences/genes.
\end{Description}
\begin{Usage}
\begin{verbatim}twilight.getlambda(xin, verbose = TRUE)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{xin}] A numerical vector containing \eqn{p}{}-values.
\item[\code{verbose}] Logical value for message printing.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function finds a suitable regularization parameter \eqn{\lambda}{}. For a sequence of lambdas, the objective function of SEP is computed for subsamples of the \eqn{p-value}{} vector \code{xin}. The final estimate is chosen based upon a Wilcoxon test comparison between objective function values of \eqn{\lambda=0}{} and each \eqn{\lambda>0}{}. The penalized objective function should not differ a lot from the unpenalized one. Therefore, the highest lambda that leads to a non-significant difference in means is chosen. The Wilcoxon ranksum test \eqn{p}{}-values are Bonferroni-corrected.
\end{Details}
\begin{Value}
Returns numerical value.
\end{Value}
\begin{Author}\relax
Stefanie Scheid \url{http://www.molgen.mpg.de/~scheid}
\end{Author}
\begin{References}\relax
Scheid S and Spang R (2004): A stochastic downhill search algorithm for estimating the local false discovery rate, \emph{IEEE TCBB} \bold{1(3)}, 98--108.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{twilight}{twilight}}
\end{SeeAlso}

