\HeaderA{nemModelSelection}{Model selection for nested effect models}{nemModelSelection}
\keyword{graphs}{nemModelSelection}
\keyword{models}{nemModelSelection}
\begin{Description}\relax
Infers models with different regularization constants, compares them via the BIC or AIC criterion and returns the highest scoring one
\end{Description}
\begin{Usage}
\begin{verbatim}
nemModelSelection(lambdas,D,inference="nem.greedy",models=NULL,control=set.default.parameters(unique(colnames(D))),verbose=TRUE,...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{lambdas}] vector of regularization constants
\item[\code{D}] data matrix with experiments in the columns (binary or continious)
\item[\code{inference}] \code{search} to use exhaustive enumeration, \code{triples} for triple-based inference, \code{pairwise} for the pairwise heuristic, \code{ModuleNetwork} for the module based inference, \code{nem.greedy} for greedy hillclimbing, \code{nem.greedyMAP} for alternating MAP optimization using log odds or log p-value densities
\item[\code{models}] a list of adjacency matrices for model search. If NULL, an exhaustive enumeration of all possible models is performed.
\item[\code{control}] list of parameters: see \code{set.default.parameters}
\item[\code{verbose}] do you want to see progression statements? Default: TRUE
\item[\code{...}] other arguments to pass to function \code{nem} or \code{network.AIC}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{nemModelSelection} internally calls \code{nem} to infer a model with a given regularization constant. The comparison between models is based on the BIC or AIC criterion, depending on the parameters passed to \code{network.AIC}.
\end{Details}
\begin{Value}
nem object
\end{Value}
\begin{Author}\relax
Holger Froehlich
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{set.default.parameters}{set.default.parameters}}, \code{\LinkA{nem}{nem}}, \code{\LinkA{network.AIC}{network.AIC}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
   data("BoutrosRNAi2002")
   D <- BoutrosRNAiDiscrete[,9:16]   
   hyper = set.default.parameters(unique(colnames(D)), para=c(0.13, 0.05), Pm=diag(4))
   res <- nemModelSelection(c(0.1,1,10), D, control=hyper)      
   
   plot.nem(res,main="highest scoring model")      
\end{ExampleCode}
\end{Examples}

