[Splm-commits] r219 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 3 01:15:16 CET 2018


Author: gpiras
Date: 2018-03-03 01:15:16 +0100 (Sat, 03 Mar 2018)
New Revision: 219

Modified:
   pkg/R/likelihoodsFE.R
Log:
first question Debarsy

Modified: pkg/R/likelihoodsFE.R
===================================================================
--- pkg/R/likelihoodsFE.R	2017-11-02 16:52:47 UTC (rev 218)
+++ pkg/R/likelihoodsFE.R	2018-03-03 00:15:16 UTC (rev 219)
@@ -70,21 +70,42 @@
     names(r) <- names(fit)
     SSE <- crossprod(residuals(lm.lag))
     s2 <- as.numeric(SSE)/NT
-
-if(LeeYu && effects == "spfe") s2 <- (time/(time-1)) * as.numeric(s2)	
-if(LeeYu && effects == "tpfe") s2 <- (n/(n-1)) * as.numeric(s2)	
-
-	betas <- coefficients(lm.lag)
-	 # betas <- b0 - lambda*b1
-	names(betas) <- colnames(xt)
-	coefs <- c(lambda, betas)
-
+    ldet <- do_ldet(lambda, env, which = 1)
+    
+    betas <- coefficients(lm.lag)
+    names(betas) <- colnames(xt)
+    coefs <- c(lambda, betas)
+    ens <- as.numeric((time * ldet  - ((n*time/2) * log(2 * pi)) - (n*time/2) * log(s2) - 1/(2 * s2) * SSE))  
+    #print(SSE)
+if(LeeYu && effects == "spfe") {
+  s2 <- (time/(time-1)) * as.numeric(s2)	
+  ens <- as.numeric(((time-1) * ldet  - ((n*(time-1)/2) * log(2 * pi)) - (n*(time-1)/2) * log(s2) - 1/(2 * s2) * SSE))
+} 
+  
+if(LeeYu && effects == "tpfe"){
+  s2 <- (n/(n-1)) * as.numeric(s2)	
+  ens <-as.numeric( (time * ldet  - (((n-1)*time/2) * log(2 * pi)) - ((n-1)*time/2) * log(s2) - 1/(2 * s2) * SSE)  )
+} 
+    
+  
+    
 ###see Debarsy's mail in February 2017
-    SSE <- sar_hess_sse_panel(lambda, betas, env)
-    s2 <- SSE /n   
-    ldet <- do_ldet(lambda, env, which = 1)
-    ens <- (time * ldet  - ((n*time/2) * log(2 * pi)) - (n*time/2) * log(s2) - 
-        (1/(2 * s2)) * SSE)
+    #SSE <- sar_hess_sse_panel(lambda, betas, env)
+    #s2 <- SSE /(n*time)   
+  
+   # print(SSE)
+   # print(s2)
+  #  print(ldet)
+   # print(time)
+    #print(n)
+    
+    #time = time -1
+    
+   
+  #  nt1 <- -(n*time)/2
+ #   print(nt1)
+    #fr*log(2*pi*sige_sar)+T_1*ldet_sar-1/(2*sige_sar)*sres_sar2
+#ens <- time * ldet  +  nt1* log(2 * pi * s2) - 1/(2 * s2) * SSE
      # print(ens)
      
  # LL <- - (NT/2)*log(SSE)  + time * ldet  



More information about the Splm-commits mailing list