[Depmix-commits] r272 - in trunk: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed May 13 16:57:54 CEST 2009
Author: ingmarvisser
Date: 2009-05-13 16:57:54 +0200 (Wed, 13 May 2009)
New Revision: 272
Modified:
trunk/R/EM.R
trunk/R/depmixfit.R
trunk/man/depmixS4-package.Rd
Log:
Added error message for infeasible model in the fit function, ie when loglike is NaN.
Modified: trunk/R/EM.R
===================================================================
--- trunk/R/EM.R 2009-05-13 13:26:28 UTC (rev 271)
+++ trunk/R/EM.R 2009-05-13 14:57:54 UTC (rev 272)
@@ -115,7 +115,7 @@
LL.old <- LL + 1
while(j <= maxit & !converge) {
-
+
# maximization
# should become object at prior <- fit(object at prior)
Modified: trunk/R/depmixfit.R
===================================================================
--- trunk/R/depmixfit.R 2009-05-13 13:26:28 UTC (rev 271)
+++ trunk/R/depmixfit.R 2009-05-13 14:57:54 UTC (rev 272)
@@ -3,7 +3,7 @@
signature(object="mix"),
function(object,fixed=NULL,equal=NULL,conrows=NULL,conrows.upper=0,conrows.lower=0,method=NULL,...) {
- # when there are linear constraints donlp should be used
+ # when there are constraints donlp should be used
# otherwise EM is good
# can/does EM deal with fixed constraints??? it should be possible for sure
@@ -29,7 +29,9 @@
# set those fixed parameters in the appropriate submodels
object <- setpars(object,fixed,which="fixed")
-
+
+ if(is.nan(logLik(object))) stop("Initial model infeasible, log likelihood is NaN; please provide better starting values. ")
+
if(method=="EM") {
object <- em(object,verbose=TRUE,...)
}
Modified: trunk/man/depmixS4-package.Rd
===================================================================
--- trunk/man/depmixS4-package.Rd 2009-05-13 13:26:28 UTC (rev 271)
+++ trunk/man/depmixS4-package.Rd 2009-05-13 14:57:54 UTC (rev 272)
@@ -33,8 +33,8 @@
\tabular{ll}{
Package: \tab depmixS4\cr
Type: \tab Package\cr
- Version: \tab 0.2-0\cr
- Date: \tab 2008-06-10\cr
+ Version: \tab 0.2-2\cr
+ Date: \tab 2009-13-05\cr
License: \tab GPL\cr
}
More information about the depmix-commits
mailing list