[Depmix-commits] r370 - trunk/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 25 22:53:44 CET 2010


Author: ingmarvisser
Date: 2010-02-25 22:53:44 +0100 (Thu, 25 Feb 2010)
New Revision: 370

Modified:
   trunk/R/allGenerics.R
   trunk/R/depmix-class.R
Log:
Added function getModel to extract submodels from a model

Modified: trunk/R/allGenerics.R
===================================================================
--- trunk/R/allGenerics.R	2010-02-24 16:10:41 UTC (rev 369)
+++ trunk/R/allGenerics.R	2010-02-25 21:53:44 UTC (rev 370)
@@ -40,6 +40,8 @@
 
 setGeneric("nlin", function(object, ...) standardGeneric("nlin"))
 
+setGeneric("getModel", function(object, ...) standardGeneric("getModel"))
+
 # setGeneric("logLik", function(object, ...) standardGeneric("logLik"))
 
 setGeneric("fit", function(object, ...) standardGeneric("fit"))

Modified: trunk/R/depmix-class.R
===================================================================
--- trunk/R/depmix-class.R	2010-02-24 16:10:41 UTC (rev 369)
+++ trunk/R/depmix-class.R	2010-02-25 21:53:44 UTC (rev 370)
@@ -131,8 +131,15 @@
 	}
 )
 
+setMethod("getModel",signature(object="mix"),
+	function(object,which="response",...) {
+		res <- switch(which,
+			"prior"=object at prior,
+			"response"=object at response)
+		res
+	}
+)
 
-
 # 
 # PRINT method
 # 
@@ -297,8 +304,16 @@
 	}
 )
 
+setMethod("getModel",signature(object="depmix"),
+	function(object,which="response",...) {
+		res <- switch(which,
+			"prior"=object at prior,
+			"response"=object at response,
+			"transition"=object at transition)
+		res
+	}
+)
 
-
 # 
 # SUMMARY method: to do
 # 



More information about the depmix-commits mailing list