Population Estimate quandary

170 views
Skip to first unread message

Don Segundo

unread,
Jan 22, 2016, 3:35:27 PM1/22/16
to unmarked
Hello All,

Ive been using unmarked to come up with population estimates for a group of restored sites that I randomly sampled between 2012 and 2015. Ive run into a problem with my population estimates which is that the best model from the first year is different than each of the subsequent years so the best model from 2012 was forest (continuous) and cp (categorical) but the best model for subsequent years included forest and crp (continuous). Although I didnt think that was a major problem to begin with when I generated the estimates the first year was way higher than all the subsequent years. Anyway, my way of dealing with that was to come up with a model using all variables from the top models in all years so the new model includes forest, crp, and cp however when I run parboot to come up with the standard error, t0(which is the estimate for all locations combined) comes out as 14434 which is way too high relative to the estimates generated from either of the previous top models.   For some reason when I include cp and crp together the predictions go way up and the variability of the estimates in parboot is extremely high, i.e. it generates estimates greater than 50,000 and all the way down to 3000. Obviously there is some problem but I cant figure out what it is, if anyone has time could you take a look at it?

Here is my code and the two files needed to do the analysis.

a<-read.csv("BEVI2012_20m.csv")
y<-a[,2:21]
R<-202
T<-4
crp<-scale(a["crp"])
forest<- scale(a["forest"])
patch<-scale(a["patch"])
db<-c(0,20,40,60,80,100)

site.Covs<-data.frame(cp=a["
cp"], crp, forest, patch)

beviumf<-unmarkedFrameGDS(y=y, siteCovs=site.Covs, survey="point", dist.breaks=db,unitsIn="m", numPrimary=T)
summary(beviumf)





BEVInull<-gdistsamp(~1, ~1, ~1, beviumf, keyfun="halfnorm",output="density", unitsOut="ha",mixture="NB", K=50)
BEVIcp<-gdistsamp(~cp, ~1, ~1, beviumf,keyfun="halfnorm", output="density", unitsOut="ha", mixture="NB", K=50)
BEVIcrp<-gdistsamp(~crp, ~1, ~1, beviumf,keyfun="halfnorm", output="density", unitsOut="ha", mixture="NB", K=50)
BEVIforest<-gdistsamp(~forest, ~1, ~1, beviumf,keyfun="halfnorm", output="density", unitsOut="ha", mixture="NB", K=50)
BEVIpatch<-gdistsamp(~patch, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)
BEVIpatchsq<-gdistsamp(~(patch)^2, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)
BEVIforestcp<-gdistsamp(~forest+cp, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)
BEVIforestcrp<-gdistsamp(~forest+crp, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)
BEVIforestpatch<-gdistsamp(~forest+patch, ~1, ~1, beviumf,keyfun="halfnorm", output="density", unitsOut="ha", mixture="NB", K=50)
BEVIcppatch<-gdistsamp(~cp+patch, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)
BEVIcrppatch<-gdistsamp(~crp+patch, ~1, ~1, beviumf,keyfun="halfnorm", output="abund", mixture="NB", K=50)
BEVIcrppatchforest<-gdistsamp(~crp+patch+forest, ~1, ~1, beviumf, keyfun="halfnorm",output="abund", mixture="NB", K=50)
BEVIforestcrpCP<-gdistsamp(~forest+crp+cp, ~1, ~1, beviumf,keyfun="halfnorm",output="density", unitsOut="ha", mixture="NB", K=50)

fmlist<-fitList(BEVInull, BEVIcp,BEVIcrp, BEVIforest, BEVIpatch, BEVIpatchsq, BEVIforestcp, BEVIforestcrp, BEVIforestpatch, BEVIcppatch, BEVIcrppatch, BEVIcrppatchforest,BEVIforestcrpCP)
modSel (fmlist)



#Fit statistics########################################################################################################
fitstats1 <- function(BEVIforestcp) {
  observed <- getY(BEVIforestcp@data)
  expected <- fitted(BEVIforestcp)
  resids <- residuals(BEVIforestcp)
  sse <- sum(resids^2,na.rm=TRUE)
  chisq <- sum((observed - expected)^2 / expected,na.rm=TRUE)
  freeTuke <- sum((sqrt(observed) - sqrt(expected))^2,na.rm=TRUE)
  out <- c(SSE=sse, Chisq=chisq, freemanTukey=freeTuke)
  return(out)
}

(pb.mhb <- parboot(BEVIforestcp, fitstats1, nsim=25, report=1))

#plot parboot - the dashed line should be somewhere near the biggest bar.
plot(pb.mhb, main = "")

#extract coefficients for the best model
betaBEVI<-coef(BEVIforestcrpCP)
betaBEVI<-betaBEVI[c("lambda(Int)","lambda(forest)","lambda(crp)","lambda(cp)")]


## sample area, in ha:
point.area<- pi*50*50/10000


b <- read.csv("C:/Users/Bryan/Desktop/CREP dissertation/ch.2CREPPopulationestimate/N-mixture data/BEVI_csv/Landscape/FedCREP_updated2010abuffer700m_truncated.csv")
b$FOR_700[b$FOR_700<0]<-NA
b$CRP_1200[b$CRP_1200<0]<-NA
b <- na.omit(b)
# create new data frame for prediction
newdat <- data.frame(crp.orig=b[,"CRP_1200"],cp=b[,"CP"],forest.orig=b[,"FOR_700"],ha=b[,"ha"])
# scale to match the model
newdat$forest <- (newdat$forest.orig-attr(forest,"scaled:center"))/attr(forest,"scaled:scale")
newdat$crp <- (newdat$crp.orig-attr(crp,"scaled:center"))/attr(crp,"scaled:scale")
# predict density for newdat using top model
mod.pred <- predict(BEVIforestcrpCP,newdata=newdat,type="lambda")

BEVI2012_20m.csv
FedCREP_updated2010abuffer700m_truncated.csv

John Clare

unread,
Jan 24, 2016, 12:23:49 PM1/24/16
to unmarked
Hi Don,

With the caveat that I haven't carefully looked at the code (though it runs fine), one thing quickly jumped out.  As you mentioned, there's a pretty large difference in abundance predictions derived between forestcp and forestcropcp, but the coefficient estimates appear fairly stable across the two top models save that including cropland has a positive (albeit not 'significant' effect).  However, you appear to be predicting into a landscape with substantially more cropland.  In fact, some of these predicted sites appear to have cropland attributes that fall really far outside of the range of variance that was used for model fitting (e.g, z-scores >10).  So my sense is that the problem is sampling-related.

mean(newdat$crp)
[1] 1.686178

 min(newdat$crp)
[1] -1.509328

max(newdat$crp)
[1] 14.36989


...etc.





Don Segundo

unread,
Jan 24, 2016, 9:52:23 PM1/24/16
to unmarked
Hey John,

Thanks for taking a look at the problem!  I see what your saying however the best models in 2013, 2014, and 2015 included crp and the estimates were within reason, in fact they were relatively low compared to the best model from 2012. Im hoping the problem isn't related to the sampling and that it's a problem with the coding...

Bryan

John Clare

unread,
Feb 2, 2016, 9:39:02 PM2/2/16
to unmarked
Hi Bryan,

Did you sample different sites in different years?  If so, I'd just stack the data.  If not, I'd stack it and add some term for year that could be modeled as a factor, linear trend, interaction.  Were there different sample sizes in different years? If crp was really important in 2012, might expect to see this in an interaction coefficient.  No real reason to estimate independent year models, as far as I can tell.  I guess I'm thinking that if this is a sampling issue, it looks like it might be an issue for only one year, and perhaps stronger inferences might be made by putting years in context.  If this were analyzed in a true open and robust design HDS framework, I speculate you'd see shrinkage in the 2012 coefficients that would render the issue moot. 

Cheers,

John
Reply all
Reply to author
Forward
0 new messages