[Depmix-commits] r392 - trunk/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 8 16:56:02 CET 2010
Author: maarten
Date: 2010-03-08 16:56:02 +0100 (Mon, 08 Mar 2010)
New Revision: 392
Modified:
trunk/R/EM.R
Log:
- added missng parentheses in EM
Modified: trunk/R/EM.R
===================================================================
--- trunk/R/EM.R 2010-03-08 15:26:42 UTC (rev 391)
+++ trunk/R/EM.R 2010-03-08 15:56:02 UTC (rev 392)
@@ -2,7 +2,7 @@
# Maarten Speekenbrink 23-3-2008
#
-em <- function(object,maxit=100,tol=1e-8,crit=c(relative,absolute),verbose=FALSE,...) {
+em <- function(object,maxit=100,tol=1e-8,crit=c("relative","absolute"),verbose=FALSE,...) {
if(!is(object,"mix")) stop("object is not of class '(dep)mix'")
call <- match.call()
if(is(object,"depmix")) {
@@ -87,8 +87,8 @@
if(converge) {
object at message <- switch(crit,
- "relative" = "Log likelihood converged to within tol. (relative change crit.)",
- "absolute" = "Log likelihood converged to within tol. (absolute change crit.)"
+ relative = "Log likelihood converged to within tol. (relative change crit.)",
+ absolute = "Log likelihood converged to within tol. (absolute change crit.)"
)
} else object at message <- "'maxit' iterations reached in EM without convergence."
@@ -188,8 +188,8 @@
if(converge) {
object at message <- switch(crit,
- "relative" = "Log likelihood converged to within tol. (relative change crit.)",
- "absolute" = "Log likelihood converged to within tol. (absolute change crit.)"
+ relative = "Log likelihood converged to within tol. (relative change crit.)",
+ absolute = "Log likelihood converged to within tol. (absolute change crit.)"
)
} else object at message <- "'maxit' iterations reached in EM without convergence."
More information about the depmix-commits
mailing list