\HeaderA{hmm}{Fits the hidden Markov model}{hmm}
\keyword{models}{hmm}
\begin{Description}\relax
Fits the hidden Markov model
\end{Description}
\begin{Usage}
\begin{verbatim}
hmm(object, params)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An object of class \code{HmmOptions}
\item[\code{params}] An object of class \code{HmmParameter}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
None yet.
\end{Details}
\begin{Value}
An object of class \code{HmmPredict}
\end{Value}
\begin{Author}\relax
R. Scharpf
\end{Author}
\begin{References}\relax
RB Scharpf et al. (2008) Hidden Markov Models for the assessment of
chromosomal alterations using high-throughput SNP arrays, Annals of
Applied Statistics
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{HmmParameter-class}{HmmParameter.Rdash.class}}
\code{\LinkA{HmmPredict-class}{HmmPredict.Rdash.class}}
\code{\LinkA{SnpLevelSet-class}{SnpLevelSet.Rdash.class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(chromosome1)
chromosome1 <- chromosome1[1:500, ]
options <- new("HmmOptions",
               states=c("D", "N", "L", "A"),
               snpset=chromosome1,
               copyNumber.location=c(1, 2, 2, 3),
               probHomCall=c(0.99, 0.7, 0.99, 0.7))
validObject(options)
params <- new("HmmParameter", 
              states=states(options),
              initialStateProbability=0.99)
cn.emission <- copyNumber.emission(options)
gt.emission <- calls.emission(options)
emission(params) <- cn.emission + gt.emission ##log scale
genomicDistance(params) <- exp(-2 *calculateDistance(options)/(100*1e6))
##no scaling
transitionScale(params) <- matrix(1, length(states(options)), length(states(options)))
if(validObject(params)) fit <- hmm(options, params)
\end{ExampleCode}
\end{Examples}

