[Splm-commits] r142 - in pkg: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jun 27 23:09:05 CEST 2012
Author: the_sculler
Date: 2012-06-27 23:09:05 +0200 (Wed, 27 Jun 2012)
New Revision: 142
Modified:
pkg/ChangeLog
pkg/DESCRIPTION
pkg/R/REmod.R
pkg/R/olsmod.R
pkg/R/sarREmod.R
pkg/R/sarem2REmod.R
pkg/R/saremREmod.R
pkg/R/saremmod.R
pkg/R/saremsrREmod.R
pkg/R/saremsrmod.R
pkg/R/sarmod.R
pkg/R/sarsrREmod.R
pkg/R/sarsrmod.R
pkg/R/sem2REmod.R
pkg/R/semREmod.R
pkg/R/semmod.R
pkg/R/semsrREmod.R
pkg/R/semsrmod.R
pkg/R/spreml.R
pkg/R/ssrREmod.R
pkg/R/ssrmod.R
Log:
spREml estimators now output sigma2e as object$sigma2
spreml() calculates sigma2mu based on phi, if any, and sigma2.1
Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/ChangeLog 2012-06-27 21:09:05 UTC (rev 142)
@@ -1,3 +1,7 @@
+Changes in Version 1.0-01
+ o spreml-type models now output object$sigma2, i.e. sigma2e
+ o spreml calcumates sigma2mu on the basis of phi, if any, and sigma2.1 as sigma2e+sigma2mu
+
Changes in Version 1.0-00
o fixed prblem with spgm due to residuals of plm models now being pseries
o added /inst/CITATION, added reference to JSS paper in docs
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/DESCRIPTION 2012-06-27 21:09:05 UTC (rev 142)
@@ -1,7 +1,7 @@
Package: splm
Title: Econometric Models for Spatial Panel Data
-Version: 1.0-00
-Date: 2012-03-02
+Version: 1.0-01
+Date: 2012-06-27
Author: Giovanni Millo <giovanni_millo at generali.com>, Gianfranco Piras <gpiras at mac.com>
Maintainer: Giovanni Millo <giovanni_millo at generali.com>
Description: ML and GM estimation and diagnostic testing of econometric models for spatial panel data.
Modified: pkg/R/REmod.R
===================================================================
--- pkg/R/REmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/REmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -141,6 +141,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms[which(nam.errcomp!="psi")]
names(betas) <- nam.beta
@@ -151,7 +152,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/olsmod.R
===================================================================
--- pkg/R/olsmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/olsmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -94,7 +94,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = s2e)
return(RES)
}
Modified: pkg/R/sarREmod.R
===================================================================
--- pkg/R/sarREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sarREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -158,6 +158,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -172,7 +173,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/sarem2REmod.R
===================================================================
--- pkg/R/sarem2REmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sarem2REmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -140,6 +140,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -152,7 +153,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/saremREmod.R
===================================================================
--- pkg/R/saremREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/saremREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -138,6 +138,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -150,7 +151,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/saremmod.R
===================================================================
--- pkg/R/saremmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/saremmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -127,7 +127,8 @@
covPRL <- covTheta[1:nvcovpms, 1:nvcovpms, drop=FALSE]
## final parms
- betas <- as.vector(beta[[1]])
+ betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -140,7 +141,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/saremsrREmod.R
===================================================================
--- pkg/R/saremsrREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/saremsrREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -146,6 +146,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -158,7 +159,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/saremsrmod.R
===================================================================
--- pkg/R/saremsrmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/saremsrmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -132,6 +132,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -144,7 +145,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/sarmod.R
===================================================================
--- pkg/R/sarmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sarmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -108,6 +108,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- NULL # ols.errors-specific
names(betas) <- nam.beta
@@ -120,7 +121,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/sarsrREmod.R
===================================================================
--- pkg/R/sarsrREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sarsrREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -161,6 +161,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -175,7 +176,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/sarsrmod.R
===================================================================
--- pkg/R/sarsrmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sarsrmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -157,6 +157,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- myparms[which(nam.errcomp=="lambda")] # lag-specific line
errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
@@ -171,7 +172,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/sem2REmod.R
===================================================================
--- pkg/R/sem2REmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/sem2REmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -123,6 +123,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms[which(nam.errcomp!="psi")]
names(betas) <- nam.beta
@@ -133,7 +134,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/semREmod.R
===================================================================
--- pkg/R/semREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/semREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -119,6 +119,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms[which(nam.errcomp!="psi")]
names(betas) <- nam.beta
@@ -129,7 +130,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/semmod.R
===================================================================
--- pkg/R/semmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/semmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -110,6 +110,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms
names(betas) <- nam.beta
@@ -120,7 +121,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/semsrREmod.R
===================================================================
--- pkg/R/semsrREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/semsrREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -130,6 +130,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms
names(betas) <- nam.beta
@@ -140,7 +141,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/semsrmod.R
===================================================================
--- pkg/R/semsrmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/semsrmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -114,17 +114,19 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
- errcomp <- myparms[which(nam.errcomp!="psi")]
+ errcomp <- myparms[which(nam.errcomp!="lambda")]
names(betas) <- nam.beta
- names(errcomp) <- nam.errcomp[which(nam.errcomp!="psi")]
+ names(errcomp) <- nam.errcomp[which(nam.errcomp!="lambda")]
dimnames(covB) <- list(nam.beta, nam.beta)
dimnames(covPRL) <- list(names(errcomp), names(errcomp))
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/spreml.R
===================================================================
--- pkg/R/spreml.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/spreml.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -144,7 +144,12 @@
model.data <- data.frame(cbind(y, X[, -1]))
dimnames(model.data)[[1]] <- nam.rows
type <- "random effects ML"
- sigma2 <- list(one = 3, idios = 2, id = 1)
+ sigma2v <- RES$sigma2
+ sigma2mu <- if(is.null(RES$errcomp["phi"])) {0} else {
+ as.numeric(sigma2v*RES$errcomp["phi"])
+ }
+ sigma2.1 <- sigma2mu + sigma2v
+ sigma2 <- list(one = sigma2.1, idios = sigma2v, id = sigma2mu)
spmod <- list(coefficients = RES$betas, arcoef = RES$arcoef,
errcomp = RES$errcomp, vcov = RES$covB, vcov.arcoef = RES$covAR,
vcov.errcomp = RES$covPRL, residuals = res, fitted.values = y.hat,
Modified: pkg/R/ssrREmod.R
===================================================================
--- pkg/R/ssrREmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/ssrREmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -139,6 +139,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms
names(betas) <- nam.beta
@@ -151,7 +152,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
Modified: pkg/R/ssrmod.R
===================================================================
--- pkg/R/ssrmod.R 2012-04-16 10:36:16 UTC (rev 141)
+++ pkg/R/ssrmod.R 2012-06-27 21:09:05 UTC (rev 142)
@@ -136,6 +136,7 @@
## final parms
betas <- as.vector(beta[[1]])
+ sigma2 <- as.numeric(beta[["sigma2"]])
arcoef <- NULL
errcomp <- myparms
names(betas) <- nam.beta
@@ -148,7 +149,8 @@
## result
RES <- list(betas = betas, arcoef=arcoef, errcomp = errcomp,
- covB = covB, covAR=covAR, covPRL = covPRL, ll = myll)
+ covB = covB, covAR=covAR, covPRL = covPRL, ll = myll,
+ sigma2 = sigma2)
return(RES)
}
More information about the Splm-commits
mailing list