[Splm-commits] r127 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 31 19:09:25 CEST 2011


Author: gpiras
Date: 2011-08-31 19:09:24 +0200 (Wed, 31 Aug 2011)
New Revision: 127

Modified:
   pkg/R/likelihoodsFE.R
   pkg/R/spfeml.R
Log:
Eliminate dependence on fixedsacsarpanel

Modified: pkg/R/likelihoodsFE.R
===================================================================
--- pkg/R/likelihoodsFE.R	2011-06-11 10:45:54 UTC (rev 126)
+++ pkg/R/likelihoodsFE.R	2011-08-31 17:09:24 UTC (rev 127)
@@ -60,8 +60,10 @@
     s2 <- SSE/n
     ldet1 <- do_ldet(coefs[1], env, which = 1)
     ldet2 <- do_ldet(coefs[2], env, which = 2)
-    ret <- (T* ldet1 + T*ldet2 - ((n/2) * log(2 * pi)) - (n/2) * log(s2) - 
+
+            ret <- (T * ldet1 + T * ldet2 - ((n*T/2) * log(2 * pi)) - (n*T/2) * log(s2) - 
         (1/(2 * (s2))) * SSE)
+        
 if (get("verbose", envir = env)) cat("rho:", coefs[1], " lambda:", coefs[2], " function:", 
             ret, " Jacobian1:", ldet1, " Jacobian2:", ldet2, 
             " SSE:", SSE, "\n")

Modified: pkg/R/spfeml.R
===================================================================
--- pkg/R/spfeml.R	2011-06-11 10:45:54 UTC (rev 126)
+++ pkg/R/spfeml.R	2011-08-31 17:09:24 UTC (rev 127)
@@ -1,12 +1,5 @@
 spfeml<-function(formula, data=list(), index=NULL,listw,listw2 = NULL, model=c("lag","error", "sarar"),effects=c('pooled','spfe','tpfe','sptpfe'), method="eigen",na.action=na.fail,quiet=TRUE,zero.policy = NULL, interval = NULL, tol.solve = 1e-10, control=list(), legacy = FALSE, llprof = NULL, cl = NULL, ...){
-	###
-	##model should be one between "lag"  or "error"
-	##effects should be one of:
-		#"pooled" (default) no space or time fixed effects
-		#"spfe" : spatial fixed effects
-		#"tpfe" : time period fixed effects
-		#"sptpfe" : for both types of fixed effects
-	##the method argument is taken from lagsarlm
+
 	  
         timings <- list()
         .ptime_start <- proc.time()
@@ -49,7 +42,7 @@
         if(is.null(cl)) cl <- match.call()
 
 #check the model
-model<-match.arg(model)
+# model<-match.arg(model)
 
 
 #check the effects
@@ -105,7 +98,7 @@
 
 ##checks on listw
   if(is.matrix(listw)) {
-    if(dim(listw)[[1]]!=N) stop("Non conformable spatial weights")
+    if(dim(listw)[[1]] !=N ) stop("Non conformable spatial weights")
     require(spdep)
     listw <- mat2listw(listw)
    }



More information about the Splm-commits mailing list