Density covariates: predicted density at different levels giving enormous S.E. and C.L.

95 views
Skip to first unread message

Angela Demarse

unread,
Nov 8, 2022, 10:52:16 AM11/8/22
to secr

I'm struggling to replicate results from a previous analysis. I suppose it's normal for density estimates to change slightly between analyses? But there's some major problems:

-Top density model ranked in AIC changes when analysis is repeated.

-The s.e. and CL estimates (at different levels of the covariate) are so large it isn't tenable for publication anymore. eg. at a density estimate = 0.0003, s.e.=6e^23.

I didn't have this issue originally back in March 2022 when I produced these results for my thesis. I might have lost some important piece of the code in my attempt to tidy it between now and then? Or maybe some R/Rstudio/secr/dependency updates since then might have thrown off the analysis?

My complete code is below. Please let me know if you notice anything that seems odd.

markocc=c(1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0))
Ald21CH <- addSightings(Ald21CH, nonID="TmAld21.txt",
                        unmarked="TuAld21.txt", uncertain="TnAld21.txt")
mask <- make.mask(traps(Ald21CH))
UsedHabitat2 <- rgdal::readOGR(dsn=".", layer="Useable_corrected")
traps<- traps(Ald21CH)
clippedmask <- make.mask(traps(Ald21CH), buffer=347, spacing=15, type="trapbuffer", poly=UsedHabitat2, poly.habitat=TRUE)
DENScov5 <- rgdal::readOGR(dsn=".", layer="NewCov_Burn_2021", stringsAsFactors =FALSE)
DENScov5@data$Ceanothus2 <- as.factor(DENScov5@data$Ceanothus2)
DENScov5@data$Canopy3cat <- as.factor(DENScov5@data$Canopy3cat)
clippedmask <- addCovariates (clippedmask, DENScov5, columns = 'Ceanothus2', strict = FALSE, replace = FALSE)
clippedmask <- addCovariates (clippedmask, DENScov5, columns = 'Canopy3cat', strict = FALSE, replace = FALSE)
base.args <- list(capthist = Ald21CH, mask = clippedmask, trace = FALSE, verify=TRUE, method='Nelder-Mead', details = list(nsim = 10000))
args.0 <- c(base.args, model = D ~ 1, g0 ~ 1)
args.Dcan <- c(base.args, model = D ~ Canopy3cat, g0 ~ 1)
args.Dcean <- c(base.args, model = D ~ Ceanothus2, g0 ~ 1)
args.Dceancan <- c(base.args, model = D ~ Ceanothus2:Canopy3cat, g0 ~ 1)
args.Dadd <- c(base.args, model = D ~ Ceanothus2+Canopy3cat, g0 ~ 1)
arglist <- list(null = args.0, Dcan = args.Dcan, Dcean = args.Dcean, Dceancan = args.Dceancan, Dadd = args.Dadd)
fits <- par.secr.fit(arglist,ncores = 4)
covAIC <- AIC(fits, criterion = "AIC", verify=TRUE)
Canopy3cat <- c(0,0,1,1,2,2)
Ceanothus2 <- c(4,5,4,5,4,5)
Canopy3cat <- as.factor(Canopy3cat)
Ceanothus2 <- as.factor(Ceanothus2)
covs <- data.frame(Canopy3cat, Ceanothus2)
covs
CIa21 <- predict(fits$fit.Dadd, newdata=covs,
                 realnames=NULL, type=c("response"),
                 se.fit=TRUE, alpha=0.05, savenew=FALSE)


*This issue was cross-posted at phidot.org for expediency - working within a quickly closing revision window.*

Any help is greatly appreciated.
                   
                                               demarsea                                         Posts: 4Joined: Wed Mar 17, 2021 12:23 pm                            

Murray Efford

unread,
Nov 8, 2022, 3:21:09 PM11/8/22
to secr
Angela
We're really in the dark here. I assume you are using the same version of secr? I am willing to take a look if you send me all the data (including spatial data) offline.
Murray

Murray Efford

unread,
Nov 9, 2022, 4:10:05 PM11/9/22
to secr
Angela
Thanks for sending the data. It seems (i) covariate models were not fully identifiable, (ii) perhaps in consequence, maximization of the likelihood was unreliable (dependent on starting values), and (iii) a simple E-W density trend was better (greater maximized likelihood, lower AIC) than any covariate model. Even if the E-W trend is not biologically interesting, it gives insight into the model behaviour. That's how I see it for now.
Murray
Reply all
Reply to author
Forward
0 new messages