[Robkalman-commits] r49 - branches/robKalman_2012/pkg/robKalman/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 29 15:30:13 CET 2012


Author: dashunka
Date: 2012-10-29 15:30:10 +0100 (Mon, 29 Oct 2012)
New Revision: 49

Modified:
   branches/robKalman_2012/pkg/robKalman/R/SSM-classes.R
Log:
Checking dimensions of the variables of the fct SSM is added

Modified: branches/robKalman_2012/pkg/robKalman/R/SSM-classes.R
===================================================================
--- branches/robKalman_2012/pkg/robKalman/R/SSM-classes.R	2012-10-29 13:04:38 UTC (rev 48)
+++ branches/robKalman_2012/pkg/robKalman/R/SSM-classes.R	2012-10-29 14:30:10 UTC (rev 49)
@@ -2,6 +2,25 @@
                 Z, V, Exo.obs = NULL, T = NULL, distr.obs = NULL,
                 a0, Sigma0, Exo.ini =NULL, distr.ini = NULL,
                 p, q) {
+  # Checking dimensions of the variables of the fct
+  
+  if(! all(dim(F)==c(p,p))) print("F is of wrong dimension")
+  if(! all(dim(Z)==c(q,p))) print("Z is of wrong dimension")
+  if(! all(dim(Q)==c(p,p))) print("Q is of wrong dimension")
+  if(! all(dim(V)==c(q,q))) print("V is of wrong dimension")
+  if(! length(a0)==p) print ("a0 is of wrong dimension")
+  if(! all(dim(Sigma0)==c(p,p))) print("Sigma0 is of wrong dimension")
+  
+  if(! (length(Ex0.ini)==p|identical(Ex0.ini,NULL))) print ("Ex0.ini is of wrong dimension")
+  if(! (length(Exo.state)==p|identical(Ex0.state,NULL))) print ("Exo.state is of wrong dimension")
+  if(! (length(Exo.obs)==q|identical(Ex0.obs,NULL))) print ("Exo.obs is of wrong dimension")
+  
+  if(! (length(distr.ini)==p|identical(distr.ini,NULL))) print ("distr.ini is of wrong dimension")
+  if(! (length(distr.state)==p|identical(distr.state,NULL))) print ("distr.state is of wrong dimension")
+  if(! (length(distr.obs)==q|identical(distr.obs,NULL))) print ("distr.obs is of wrong dimension")
+  
+  #########################################################################
+  
   Exo.state.ret <- if(!is.null(Exo.state)) createExo(Exo.state) else NULL
   Exo.obs.ret <- if(!is.null(Exo.obs)) createExo(Exo.obs) else NULL
   Exo.ini.ret <- if(!is.null(Exo.ini)) createExo(Exo.ini)  else NULL



More information about the Robkalman-commits mailing list