Skip to content

Commit

Permalink
version 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jipingw authored and cran-robot committed Aug 20, 2023
1 parent d5dc665 commit d817727
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 59 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: SPECIES
Type: Package
Title: Statistical Package for Species Richness Estimation
Version: 1.1.3
Date: 2022-04-25
Version: 1.1.4
Date: 2023-08-19
Author: Ji-Ping Wang, <jzwang@northwestern.edu>
Maintainer: Ji-Ping Wang <jzwang@northwestern.edu>
Description: Implementation of various methods in estimation of species richness or diversity in Wang (2011)<doi:10.18637/jss.v040.i09>.
License: GPL-2
Packaged: 2022-04-25 10:06:25 UTC; jon
Packaged: 2023-08-20 20:56:59 UTC; jon
Repository: CRAN
Date/Publication: 2022-04-25 13:40:06 UTC
Date/Publication: 2023-08-20 21:22:38 UTC
NeedsCompilation: yes
15 changes: 7 additions & 8 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
745e034832ee44a31c73f1a048b7c299 *DESCRIPTION
fc170b83c6fd1a7a5e84698f7196d2d6 *NAMESPACE
b06628cc3a7f519dbab645b527d07c65 *DESCRIPTION
bca09dc2c5b2d42bbe21098258b0b7d1 *NAMESPACE
7801c8d89e2d198b4e2b339bca641f55 *NEWS.md
d4d089a5e4811e8b46a5f940a12c733f *R/ChaoBunge.R
fd2d0fd71a8a6add0c7e4cddb18d25a5 *R/ChaoLee1992.R
3d8cbe0d374405f4fe1b88587d6878cf *R/chao1984.R
b967c1113a45663c3fe89d3fd9a76e58 *R/common.R
8495e61564fc636c72a377005583d93b *R/jackknife.R
66ea4f0e60d473f051f4f3301a07231b *R/pcg.R
40beb1737c2c22ca0282889ab0436dd2 *R/pnpmle.R
141b228c575b5298d67d57357c27b740 *R/unpmle.R
e0037648a16c6af8491b70842acb90e4 *R/pcg.R
2de3cd18c55f627e50493027425ccbc5 *R/pnpmle.R
84409608efc80706db197036743160ff *R/unpmle.R
776d989ae1c1c78a3044017d8629282e *data/EST.rda
8fa1e8305a16127de844cc5234da461f *data/butterfly.rda
f73ae884b03518e825f10cac54f2d5c1 *data/cottontail.rda
cb3e67d5a944280622a40d5064bde010 *data/insects.rda
9be2e8ed23273b1d31d078cc0e846327 *data/microbial.rda
f6b32a4453d695a5eb9c74914782673c *data/traffic.rda
78087d89c1ee9d63481cda64c452c0df *inst/CITATION
df9fd0374ae9b9c9dc14f609a6f8a3c3 *man/ChaoBunge.Rd
3b6fd721217518715bc139acb35792e8 *man/ChaoLee1992.Rd
b813a64b410617ef1fdf3066a8c56ebe *man/EST.Rd
b7d7b51149a70528539352aa131c30fb *man/SPECIES.package.Rd
c9855407fc73831d62e157840744a3b2 *man/SPECIES.package.Rd
677c1117cd45030e73b5d61f945f282c *man/butterfly.Rd
627d5de1f705a63c79c1d598a0081f61 *man/chao1984.Rd
6e2f58dd120f2ec85d95af4e93f39605 *man/cottontail.Rd
Expand All @@ -30,7 +29,7 @@ cc124e0cb4cbe07b856af485c390397f *man/jackknife.Rd
42edbe6e5bf1acf41e39d0bf7b71a4d7 *man/pnpmle.Rd
ef144cfac4ed103df30c61816bc78b04 *man/traffic.Rd
5aaaad734727da3583427ed420edeac5 *man/unpmle.Rd
427c8c47f5aa5f293d94fcedc5418571 *src/PPCG.f90
452ed24bb7f7cc5defa3d4e2d7eb1709 *src/PPCG.f90
8fddd80d2c29025b1947d87a0eca795f *src/WLunpmle.f90
f1344dca00dc329f3d28433d92081771 *src/norrispollock.f90
d9cf67617299478460e0713c4f0557f7 *src/pnpmle.f90
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ useDynLib(SPECIES)
importFrom("stats", "dbeta", "dbinom", "dpois", "qnorm", "quantile")
importFrom("utils", "flush.console")
export(ChaoBunge,chao1984,pnpmle,ChaoLee1992, jackknife, unpmle,pcg)
S3method(print,pnpmleClass)
S3method(print,unpmleClass)
S3method(print,pcgClass)
14 changes: 7 additions & 7 deletions R/pcg.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ bootPCG= function(p,pi,b,t,rep,amodel0,alpha,conf){
}

###s3 print method
print.pcgClass=function(results){#results is list of (MLE0,amodel0,alpha,p,pi,noZeroP,dis)
if(results$dis==1){
print.pcgClass=function(x,...){#x is list of (MLE0,amodel0,alpha,p,pi,noZeroP,dis)
if(x$dis==1){
cat("Method: Poisson-Compound Gamma method by Wang 2010.", "\n")
cat("Alpha grid used:", results$alpha,".","\n\n")
cat(' MLE= ', results$MLE0,"\n")
cat(' Selected alpha model: ', results$amodel0,"\n")
cat("Alpha grid used:", x$alpha,".","\n\n")
cat(' MLE= ', x$MLE0,"\n")
cat(' Selected alpha model: ', x$amodel0,"\n")
cat(' Estimated Gamma components: ', "\n")
cat(' p= ', results$p[1:results$noZeroP],"\n")
cat(' pi= ', results$pi[1:results$noZeroP],"\n\n")
cat(' p= ', x$p[1:x$noZeroP],"\n")
cat(' pi= ', x$pi[1:x$noZeroP],"\n\n")
}
}
10 changes: 5 additions & 5 deletions R/pnpmle.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ bootPnpmle=function(p,pi,b,t,rep,conf){
}

#S3 method for on-screen plot
print.pnpmleClass=function(results){ #results is list of (MLE0,p,pi,noZeroP,dis)
if(results$dis==1){
print.pnpmleClass=function(x,...){ #results is list of (MLE0,p,pi,noZeroP,dis)
if(x$dis==1){
cat("Method: Penalized NPMLE method by Wang and Lindsay 2005.", "\n\n")
cat(' MLE= ', results$MLE0,"\n")
cat(' MLE= ', x$MLE0,"\n")
cat(' Estimated zero-truncated Poisson mixture components: ', "\n")
cat(' p= ', results$p[1:results$noZeroP],"\n")
cat(' pi= ', results$pi[1:results$noZeroP],"\n\n")
cat(' p= ', x$p[1:x$noZeroP],"\n")
cat(' pi= ', x$pi[1:x$noZeroP],"\n\n")
}
}
14 changes: 7 additions & 7 deletions R/unpmle.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,20 @@ bootUnpmle=function(p,pi,b,t,method,rep,conf){


#S3 method for on-screen plot
print.unpmleClass=function(results){ #results is list of (MLE0,p,pi,noZeroP,dis,method)
if(results$dis==1){
print.unpmleClass=function(x,...){ #x is list of (MLE0,p,pi,noZeroP,dis,method)
if(x$dis==1){
cat("Method: Unconditional NPMLE method by Norris and Pollock 1996, 1998,","\n")
if(results$method=="N-P"){
if(x$method=="N-P"){
cat(" using algorithm by Bonhing and Schon 2005:", "\n\n")
}else if(results$method=="W-L"){
}else if(x$method=="W-L"){
cat(" using algorithm by Wang and Lindsay 2005:", "\n\n")
}else {
stop ("Error: the method must be either N-P or W-L!")
}

cat(' MLE= ', results$MLE0,"\n")
cat(' MLE= ', x$MLE0,"\n")
cat(' Estimated Poisson mixture components: ', "\n")
cat(' p= ', results$p[1:results$noZeroP],"\n")
cat(' pi= ', results$pi[1:results$noZeroP],"\n\n")
cat(' p= ', x$p[1:x$noZeroP],"\n")
cat(' pi= ', x$pi[1:x$noZeroP],"\n\n")
}
}
20 changes: 0 additions & 20 deletions inst/CITATION

This file was deleted.

8 changes: 1 addition & 7 deletions man/SPECIES.package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
(1) jackknife estimator by Burnham and Overton 1978, 1979; (2) lower-bound estimator by Chao 1984; (3) coverage-base estimators ACE, ACE-1 by Chao and Lee 1992; (4) coverage-duplication estimator from Poisson-Gamma model by Chao and Bunge 2002; (5) unconditional nonparametric maximum likelihood estimator by Norris and Pollock 1996, 1998; (6) penalized nonparametric maximum likelihood estimator by Wang and Lindsay 2005; and (7) Poisson-compound Gamma model with smooth nonparametric maximum likelihood estimation by Wang 2010.
}
\details{
\tabular{ll}{
Package: \tab SPECIES\cr
Type: \tab Package\cr
Version: \tab 1.0\cr
Date: \tab 2011-1-22\cr
License: \tab GPL-2\cr
}

functions: chao1984, ChaoBunge, ChaoLee1992, jackknife, pcg ,pnpmle, unpmle;
data: butterfly, cottontail,EST, insect, microbial, traffic
}
Expand Down
2 changes: 1 addition & 1 deletion src/PPCG.f90
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SUBROUTINE PCGone(n,t,MLE,a_model,alpha,alphaK,p,pi,theta_threshold,noZeroP)


IMPLICIT NONE
INTEGER t,alphaK,cumuless,i,k,noZeroP
INTEGER t,alphaK,i,k,noZeroP
DOUBLE PRECISION p(10),pi(10),pistat(10),a_model, predict(alphaK+1)
DOUBLE PRECISION boot(50),n(50),boot1(50),a
DOUBLE PRECISION Etol, Gtol,gap,mle,theta_threshold
Expand Down

0 comments on commit d817727

Please sign in to comment.