[Depmix-commits] r169 - in trunk: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 17 14:24:16 CEST 2008


Author: ingmarvisser
Date: 2008-06-17 14:24:16 +0200 (Tue, 17 Jun 2008)
New Revision: 169

Added:
   trunk/man/mix-class.Rd
   trunk/man/mix.fitted-class.Rd
Modified:
   trunk/NAMESPACE
   trunk/man/AIC.Rd
   trunk/man/depmix-class.Rd
   trunk/man/depmix-internal.Rd
   trunk/man/depmix-methods.Rd
   trunk/man/depmix.fit.Rd
   trunk/man/mix.Rd
   trunk/man/posterior.Rd
Log:
Added mix-class.Rd and mix.fitted-class.Rd help files and fixed some codoc issues

Modified: trunk/NAMESPACE
===================================================================
--- trunk/NAMESPACE	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/NAMESPACE	2008-06-17 12:24:16 UTC (rev 169)
@@ -10,7 +10,6 @@
 	forwardbackward,
 	llratio,
 	multinomial,
-	binomial,
 	em,
 	viterbi,
 	mlogit

Modified: trunk/man/AIC.Rd
===================================================================
--- trunk/man/AIC.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/AIC.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -1,26 +1,35 @@
 \name{AIC}
 \alias{AIC}
 \alias{AIC,depmix-method}
+\alias{AIC,mix-method}
+
 \alias{BIC}
 \alias{BIC,depmix-method}
+\alias{BIC,mix-method}
 
-\title{Compute AIC and BIC for depmix objects}
+\title{Compute AIC and BIC for (dep-)mix objects}
+
 \description{
-Compute AIC and BIC for depmix objects.
+	Compute AIC and BIC for \code{depmix} and \code{mix} objects.
 }
+
 \usage{
-AIC(object, ..., k = 2)
-BIC(object, ...)
+	AIC(object, ..., k = 2)
+	BIC(object, ...)
 }
-%- maybe also 'usage' for other objects documented here.
+
 \arguments{
-  \item{object}{A \code{depmix} model.}
+  \item{object}{A \code{depmix} or \code{mix} model.}
   \item{\dots}{Not used currently.}
   \item{k}{The penalty factor which defaults to 2.}
 }
+
 \value{
-	The value of the AIC and BIC
+	The value of the AIC or BIC respectively.
 }
+
 \references{}
+
 \author{Ingmar Visser}
+
 \keyword{htest}

Modified: trunk/man/depmix-class.Rd
===================================================================
--- trunk/man/depmix-class.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/depmix-class.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -10,6 +10,10 @@
 \alias{ntimes}
 \alias{ntimes,depmix-method}
 
+\alias{nstates}
+\alias{nstates,depmix-method}
+
+
 \title{Class "depmix"}
 
 \description{A \code{\link{depmix}} model.}

Modified: trunk/man/depmix-internal.Rd
===================================================================
--- trunk/man/depmix-internal.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/depmix-internal.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -7,13 +7,14 @@
 \alias{lystig}
 
 \alias{makeDepmix}
+\alias{makeMix}
 \alias{makePriorModel}
 \alias{makeResponseModels}
 \alias{makeTransModels}
 
 \alias{mlogit}
 \alias{multinomial}
-\alias{nstates}
+
 \alias{pa2conr}
 \alias{viterbi}
 \alias{viterbi2}

Modified: trunk/man/depmix-methods.Rd
===================================================================
--- trunk/man/depmix-methods.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/depmix-methods.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -6,47 +6,62 @@
 
 \alias{logLik}
 \alias{logLik,depmix-method}
+\alias{logLik,mix-method}
 
 \alias{nobs}
 \alias{nobs,depmix-method}
+\alias{nobs,mix-method}
 
 \alias{npar}
 \alias{npar,depmix-method}
+\alias{npar,mix-method}
 
 \alias{freepars}
 \alias{freepars,depmix-method}
+\alias{freepars,mix-method}
 
 \alias{setpars}
 \alias{setpars,depmix-method}
+\alias{setpars,mix-method}
 
 \alias{getpars}
 \alias{getpars,depmix-method}
+\alias{getpars,mix-method}
 
-\title{ Depmix methods. }
+\title{ 'depmix' and 'mix' methods. }
 
 \description{
 
-Computes the log likelihood of a depmix object.
+Various methods for \code{depmix} and \code{mix} objects. 
 
 }
 
 \usage{
 	
 	\S4method{logLik}{depmix}(object,method="lystig")
+	\S4method{logLik}{mix}(object,method="lystig")
 	
 	\S4method{nobs}{depmix}(object, ...)
+	\S4method{nobs}{mix}(object, ...)
+	
 	\S4method{npar}{depmix}(object)
+	\S4method{npar}{mix}(object)
+	
 	\S4method{freepars}{depmix}(object)
+	\S4method{freepars}{mix}(object)
 	
 	\S4method{setpars}{depmix}(object,values, which="pars",...)
+	\S4method{setpars}{mix}(object,values, which="pars",...)
+	
 	\S4method{getpars}{depmix}(object,which="pars",...)	
-
+	\S4method{getpars}{mix}(object,which="pars",...)	
 }
 \arguments{
 
-  \item{object}{A \code{depmix} object.}
+  \item{object}{A \code{depmix} or \code{mix} object.}
     
-  \item{values}{To be used in \code{setpars} to set new parameter values.}
+  \item{values}{To be used in \code{setpars} to set new parameter values; see
+  the example.}
 
   \item{method}{The log likelihood can be computed by either the forward
   backward algorithm from Rabiner, 1989, or by the method of Lystig and
@@ -80,7 +95,7 @@
 
 	\item{freepars}{returns the number of non-fixed parameters.}
 
-	\item{setpars}{returns a depmix object with new parameter values.}
+	\item{setpars}{returns a \code{(dep-)mix} object with new parameter values.}
 
 	\item{getpars}{returns a vector with the current parameter values.}
 

Modified: trunk/man/depmix.fit.Rd
===================================================================
--- trunk/man/depmix.fit.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/depmix.fit.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -9,12 +9,19 @@
 \alias{show,depmix.fitted-method}
 \alias{summary,depmix.fitted-method}
 
-\title{Fit depmix models}
+\alias{mix.fit}
+\alias{fit,mix-method}
 
+\alias{show,mix.fitted-method}
+\alias{summary,mix.fitted-method}
+
+\title{Fit 'depmix' or 'mix' models}
+
 \description{
 
-	\code{fit} optimizes parameters of \code{\link{depmix}} models, optionally
-	subject to general linear (in)equality constraints.}
+	\code{fit} optimizes parameters of \code{\link{depmix}} or
+	\code{\link{mix}} models, optionally subject to general linear
+	(in)equality constraints.}
 
 \usage{
 	
@@ -22,12 +29,18 @@
 		conrows.upper=0, conrows.lower=0, method=NULL,...)
 	
 	\S4method{summary}{depmix.fitted}(object)
+
+	\S4method{fit}{mix}(object, fixed=NULL, equal=NULL, conrows=NULL,
+		conrows.upper=0, conrows.lower=0, method=NULL,...)
 	
+	\S4method{summary}{mix.fitted}(object)
+
+	
 }
 
 \arguments{
 
-	\item{object}{An object of class \code{depmix}.}
+	\item{object}{An object of class \code{(dep-)mix}.}
 	
 	\item{fixed}{Vector of mode logical indicating which parameters should 
 		be fixed.}

Added: trunk/man/mix-class.Rd
===================================================================
--- trunk/man/mix-class.Rd	                        (rev 0)
+++ trunk/man/mix-class.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -0,0 +1,66 @@
+\name{mix-class}
+
+\docType{class}
+
+\alias{mix-class}
+
+\alias{nresp,mix-method}
+\alias{nstates,mix-method}
+\alias{ntimes,mix-method}
+
+\title{Class "mix"}
+\description{ A \code{\link{mix}} model. }
+
+\section{Objects from the Class}{
+Objects can be created by calls to \code{\link{mix}}.
+}
+
+\section{Slots}{
+
+	\describe{ 
+
+		\item{\code{response}:}{List of list of \code{response} objects.}
+
+		\item{\code{prior}:}{\code{\link{transInit}} object; model for the
+		prior probabilities, also unconditional probabilities}
+		
+		\item{\code{dens}:}{Array of dimension sum(ntimes)*nresp*nstates
+		providing the densities of the observed responses for each state.}
+		
+		\item{\code{init}:}{Array of dimension
+		\code{length(ntimes)}*nstates with the current predictions for the
+		initial state probabilities.}
+		
+		\item{\code{nstates}:}{The number of states (classes) of the model.}
+		
+		\item{\code{nresp}:}{The number of independent responses.}
+		
+		\item{\code{ntimes}:}{A vector of 1's for each case; for internal
+		use.}
+		
+		\item{\code{npars}:}{The total number of parameters of the model.
+		This is not the degrees of freedom, ie there are redundancies in
+		the parameters, in particular in the multinomial models for the
+		transitions and prior.}
+
+	}
+}
+
+\section{Accessor Functions}{
+	The following functions should be used for accessing the corresponding
+	slots:
+	\describe{
+		\item{\code{npar}:}{The number of parameters of the model.}
+		\item{\code{nresp}:}{The number of responses.}
+		\item{\code{nstates}:}{The number of states.}
+		\item{\code{ntimes}:}{The vector of independent time series lengths.}
+	}
+}
+
+\author{Ingmar Visser}
+
+\examples{
+	showClass("mix")
+}
+
+\keyword{classes}

Modified: trunk/man/mix.Rd
===================================================================
--- trunk/man/mix.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/mix.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -68,7 +68,7 @@
 	The response model(s) are created by call(s) to \code{\link{response}}
 	providing the response formula and the family specifying the error
 	distribution.  If response is a list of formulae, the \code{response}'s
-	are assumed to be independent conditional on the latent state.
+	are assumed to be independent conditional on the latent class.
 	
 	The prior density is modeled as a multinomial logistic.  This model is
 	created by a call to \code{\link{transInit}}.
@@ -87,7 +87,7 @@
 
 \value{
 	
-\code{depmix} returns an object of class \code{depmix} which has the
+\code{mix} returns an object of class \code{mix} which has the
 following slots:
 
 	\item{response}{A list of a list of response models; the first
@@ -100,9 +100,8 @@
 	\item{dens,init}{See \code{\link{mix-class}} help for details.  For
 	internal use.}
 		
-	\item{ntimes}{A vector containing the lengths of independent time
-		series; if data is provided, sum(ntimes) must be equal to
-		nrow(data).}
+	\item{ntimes}{A vector made by \code{rep(1,nrow(data))}; for internal
+	use only.}
 	
 	\item{nstates}{The number of states of the model.}
 	
@@ -127,10 +126,6 @@
 
 \references{
 	
-	On hidden Markov models: Lawrence R. Rabiner (1989).  A tutorial on
-	hidden Markov models and selected applications in speech recognition.
-	\emph{Proceedings of IEEE}, 77-2, p.  267-295.
-	
 	On latent class models: A. L. McCutcheon (1987).  \emph{Latent class
 	analysis}.  Sage Publications.
 	

Added: trunk/man/mix.fitted-class.Rd
===================================================================
--- trunk/man/mix.fitted-class.Rd	                        (rev 0)
+++ trunk/man/mix.fitted-class.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -0,0 +1,69 @@
+\name{mix.fitted-class}
+
+\docType{class}
+
+\alias{mix.fitted-class}
+
+\title{Class "mix.fitted"}
+
+\description{A fitted \code{\link{mix}} model.}
+
+\section{Slots}{
+	
+	A \code{mix.fitted} object is a \code{mix} object with three 
+	additional slots, here is the complete list:
+	
+	\describe{
+
+		\item{\code{response}:}{List of list of \code{response} objects.}
+
+		\item{\code{prior}:}{\code{transInit} object.}
+		
+		\item{\code{dens}:}{Array of dimension sum(ntimes)*nresp*nstates
+			providing the densities of the observed responses for each state.}
+				
+		\item{\code{init}:}{Array of dimension \code{length(ntimes)}*nstates with 
+			the current predictions for the initial state probabilities.}
+				
+		\item{\code{ntimes}:}{A vector containing the lengths of independent time
+			series; if data is provided, sum(ntimes) must be equal to
+			nrow(data).}
+	
+		\item{\code{nstates}:}{The number of states of the model.}
+	
+		\item{\code{nresp}:}{The number of independent responses.}
+	
+		\item{\code{npars}:}{The total number of parameters of the model. This is not
+			the degrees of freedom, ie there are redundancies in the
+			parameters, in particular in the multinomial models for the
+			transitions and prior.}
+			
+		\item{\code{message}:}{This provides some information on convergence,
+			either from the EM algorithm or from Rdonlp2.}
+		
+		\item{\code{conMat}:}{The linear constraint matrix, which has zero rows
+			if there were no constraints.}
+		
+		\item{\code{posterior}:}{Posterior (Viterbi) state sequence (not
+			implemented currently).}
+	}
+}
+
+\section{Details}{
+	
+	The print function shows some convergence information, and the summary
+	method shows the parameter estimates.
+	
+}
+
+\section{Extends}{
+	Class \code{"\linkS4class{mix}"}, directly.
+}
+
+\author{Ingmar Visser}
+
+\examples{
+	showClass("mix.fitted")
+}
+
+\keyword{classes}

Modified: trunk/man/posterior.Rd
===================================================================
--- trunk/man/posterior.Rd	2008-06-17 10:31:00 UTC (rev 168)
+++ trunk/man/posterior.Rd	2008-06-17 12:24:16 UTC (rev 169)
@@ -3,22 +3,26 @@
 \alias{posterior}
 
 \alias{posterior,depmix.fitted-method}
+\alias{posterior,mix.fitted-method}
 
+
 \title{ Posterior states/classes }
 
 \description{
 
-	Return the posterior states for a fitted depmix object.  In the case
-	of a latent class or mixture model these are the class probabilities.
+	Return the posterior states for a fitted \code{(dep-)mix} object.  In
+	the case of a latent class or mixture model these are the class
+	probabilities.
 
 }
 
 \usage{
 	\S4method{posterior}{depmix.fitted}(object)
+	\S4method{posterior}{mix.fitted}(object)
 }
 
 \arguments{
-  \item{object}{A depmix object.}
+  \item{object}{A (dep-)mix object.}
 }
 
 \value{



More information about the depmix-commits mailing list