\HeaderA{getDensityMatrix}{Calculate density matrix from raw p-value matrix}{getDensityMatrix}
\keyword{models}{getDensityMatrix}
\begin{Description}\relax
Fit a 3 component BUM model to each column of a raw p-value matrix.
\end{Description}
\begin{Usage}
\begin{verbatim}
        getDensityMatrix(Porig, dirname=NULL, startab=c(0.3,10), startlam=c(0.6,0.1,0.3), tol=1e-4)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Porig}] matrix of raw p-values
\item[\code{dirname}] name of a directory to save histograms and QQ-plots to. If dirname=NULL, then the plots are made to the screen, and after each fit the user is asked to press a key in order to continue.
\item[\code{startab}] start values for alpha and beta parameter
\item[\code{startlam}] start values for mixing coefficients
\item[\code{tol}] convergence tolerance: If the absolute likelihood ratio -1 becomes smaller than this value, then the EM algorithm is supposed to be converged.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The BUM density model consists of 3 components: $f(x) = lambda\_1 + lambda\_2*dbeta(x,alpha,1) + lambda\_3*dbeta(x,1,beta)$. The mixing coefficients and the parameters alpha and beta are fitted together via an EM algorithm.
\end{Details}
\begin{Value}
log-density matrix of same dimensions as Porig: The log-densities can be interpreted as log signal-to-noise ratios. A value \textgreater{} 0 means higher signal than noise, and a value \textless{} 0 a higher noise than signal.
\end{Value}
\begin{Note}\relax
Note the difference to the previous package version: the LOG-density is returned now!
\end{Note}
\begin{Author}\relax
Holger Froehlich
\end{Author}

