\HeaderA{validate}{Inference Validation}{validate}
\keyword{misc}{validate}
\begin{Description}\relax
\code{validate} compares the infered network to the true underlying network for several threshold values 
and appends the resulting confusion matrices to the returned object.
\end{Description}
\begin{Usage}
\begin{verbatim}
validate( inet, tnet, steps=50 )
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{inet}] This is the infered network, a data.frame or matrix obtained by one of the functions \LinkA{minet}{minet}, \LinkA{aracne}{aracne},
\LinkA{clr}{clr} or \LinkA{mrnet}{mrnet} .
\item[\code{tnet}] The true underlying network. This network must have the same size and variable names as \code{inet}.
\item[\code{steps}] The number of threshold values to be used in the validation process - see \code{details}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For each of the \code{steps} threshold values \eqn{I_0}{T}, the edges whose weight are (strictly) 
below \eqn{I_0}{T} are eliminated. All the other edges will have a weight 1. 
Thus for each threshold, we obtain a boolean network from the infered network. This 
network is compared to the true underlying network, \code{tnet}, in order to compute a 
confusion (adjacency) matrix.
All the confusion matrices, obtained with different threshold values, are appended to the 
returned object.
In the end the \code{validate} function returns a data.frame containing \code{steps} confusion matrices.
\end{Details}
\begin{Value}
\code{validate} returns a data.frame whith four columns named \code{thrsh, tp, fp, fn}. These values are 
computed for each of the \code{steps} thresholds. Thus each row of the returned object contains
the confusion matrix for a different threshold.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{minet}{minet}},   \code{\LinkA{vis.res}{vis.res}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(syn.data)
data(syn.net)
inf.net <- mrnet(build.mim(discretize(syn.data)))
table <- validate( inf.net, syn.net, steps=100 )
\end{ExampleCode}
\end{Examples}

