From noreply at r-forge.r-project.org Mon Dec 11 16:04:30 2023 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 11 Dec 2023 16:04:30 +0100 (CET) Subject: [Splm-commits] r259 - in pkg: . R Message-ID: <20231211150430.3AF7318054C@r-forge.r-project.org> Author: the_sculler Date: 2023-12-11 16:04:29 +0100 (Mon, 11 Dec 2023) New Revision: 259 Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/bsktest.R Log: Internal definition for function pchibar(), courtesy Jason Sinnwell, to eliminate dependence on 'ibdreg' Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2023-10-28 13:57:00 UTC (rev 258) +++ pkg/DESCRIPTION 2023-12-11 15:04:29 UTC (rev 259) @@ -1,12 +1,12 @@ Package: splm Title: Econometric Models for Spatial Panel Data -Version: 1.6-4 -Date: 2023-10-27 +Version: 1.6-5 +Date: 2023-12-11 Authors at R: c(person(given = "Giovanni", family = "Millo", role = c("aut", "cre"), email = "giovanni.millo at deams.units.it"), person(given = "Gianfranco", family = "Piras", role = c("aut"), email = "gpiras at mac.com"), person("Roger", "Bivand", role = c("ctb"), email = "Roger.Bivand at nhh.no", comment=c(ORCID="0000-0003-2392-6140"))) Description: ML and GM estimation and diagnostic testing of econometric models for spatial panel data. Depends: R (>= 2.12.0) -Imports: plm, maxLik, MASS, bdsmatrix, ibdreg, nlme, Matrix, spam, methods, spatialreg (>= 1.2-1), spdep (>= 1.2-1), stringr +Imports: plm, maxLik, MASS, bdsmatrix, nlme, Matrix, spam, methods, spatialreg (>= 1.2-1), spdep (>= 1.2-1), stringr License: GPL-2 LazyLoad: yes Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2023-10-28 13:57:00 UTC (rev 258) +++ pkg/NAMESPACE 2023-12-11 15:04:29 UTC (rev 259) @@ -24,7 +24,6 @@ SE_classic_setup, SE_whichMin_setup, SE_interp_setup, as.spam.listw, get.ZeroPolicyOption) -importFrom(ibdreg, pchibar) import(Matrix) importFrom(spam, as.spam, diag.spam, solve.spam, t.spam, determinant.spam) importFrom(maxLik, maxLik) Modified: pkg/R/bsktest.R =================================================================== --- pkg/R/bsktest.R 2023-10-28 13:57:00 UTC (rev 258) +++ pkg/R/bsktest.R 2023-12-11 15:04:29 UTC (rev 259) @@ -3,7 +3,23 @@ UseMethod("bsktest") } +## define necessary function pchibar() (courtesy Jason Sinnwell) +## eliminates dependency on 'ibdreg' +pchibar <- function(x, df, wt){ + # compute P(X <= x), where P is the chi-bar distribution + # df = vector of df + # wt = vector of mixing proportions + if(x<=0){ + return(0) + } + zed <- df==0 + cdf <- ifelse(any(zed), wt[zed], 0) + cdf <- cdf + sum(pchisq(x, df[!zed])*wt[!zed]) + return(cdf) +} + + #`bsktest.splm` <- #function(x, listw, index=NULL, test=c("CLMlambda","CLMmu"), ...){ # switch(match.arg(test), CLMlambda = {