RN occupancy model in RMark - convergence problem solved

I had an offline exchange with Jeff about some problems I ran into with the OccupRNPoisson model and groups in RMark. Several models would not converge when groups were defined for Lambda. The same models worked fine for regular Occupancy models and worked when using the RN model in PRESENCE. The solution to the problem was to run a simple model that would converge and use that to define the initial values for the more complex models. That way all models converged and the output from Mark and PRESENCE was identical. Bellow the R code.
Note: Groups won't work for occupancy models with the Oct 1 version of mark.exe. I used the July 08 version and everything worked fine.
Note: Groups won't work for occupancy models with the Oct 1 version of mark.exe. I used the July 08 version and everything worked fine.
- Code: Select all
# create an initial model
initial=mark(occdata,model="OccupRNPoisson", groups=c("Habitat","Site","Survey"),
model.parameters=list(r=list(formula=~1), Lambda=list(formula=~1)))
run.rnocc=function(){
occdata.process=process.data(occdata,model="OccupRNPoisson", groups=c("Habitat","Site","Survey"))
occdata.ddl=make.design.data(occdata.process)
# Define r models
r.dot=list(formula=~1)
r.site=list(formula=~Site)
r.survey=list(formula=~Survey)
# Define Lambda models
Lambda.dot=list(formula=~1)
Lambda.habitat=list(formula=~Habitat)
Lambda.site=list(formula=~Site)
Lambda.sitehabitatint=list(formula=~Site*Habitat)
Lambda.sitehabitat=list(formula=~Site+Habitat)
Lambda.survey=list(formula=~Survey)
Lambda.surveyhabitatint=list(formula=~Survey*Habitat)
Lambda.surveyhabitat=list(formula=~Survey+Habitat)
# Create model list
cml=create.model.list("OccupRNPoisson")
# Run and return marklist of models
return(mark.wrapper(cml,data=occdata.process,ddl=occdata.ddl, initial=initial))
}
rnocc.results<-run.rnocc()
print(rnocc.results)