Learn R Programming

AICcmodavg (version 2.3-1)

checkConv: Check Convergence of Fitted Model

Description

This function checks the convergence information contained in models of various classes.

Usage

checkConv(mod, ...)

# S3 method for betareg checkConv(mod, ...)

# S3 method for clm checkConv(mod, ...)

# S3 method for clmm checkConv(mod, ...)

# S3 method for glm checkConv(mod, ...)

# S3 method for glmmTMB checkConv(mod, ...)

# S3 method for hurdle checkConv(mod, ...)

# S3 method for lavaan checkConv(mod, ...)

# S3 method for maxlikeFit checkConv(mod, ...)

# S3 method for merMod checkConv(mod, ...)

# S3 method for lmerModLmerTest checkConv(mod, ...)

# S3 method for multinom checkConv(mod, ...)

# S3 method for nls checkConv(mod, ...)

# S3 method for polr checkConv(mod, ...)

# S3 method for unmarkedFit checkConv(mod, ...)

# S3 method for zeroinfl checkConv(mod, ...)

Value

checkConv returns a list with the following components:

converged

a logical value indicating whether the algorithm converged or not.

message

a string containing the message from the optimization function.

Arguments

mod

an object containing the output of a model of the classes mentioned above.

...

additional arguments passed to the function.

Author

Marc J. Mazerolle

Details

This function checks the element of a model object that contains the convergence information from the optimization function. The function is currently implemented for models of classes betareg, clm, clmm, glm, glmmTMB, hurdle, lavaan, maxlikeFit, merMod, lmerModLmerTest, multinom, nls, polr, unmarkedFit, and zeroinfl. The function is particularly useful for functions with several groups of parameters, such as those of the unmarked package (Fiske and Chandler, 2011).

References

Fiske, I., Chandler, R. (2011) unmarked: An R Package for fitting hierarchical models of wildlife occurrence and abundance. Journal of Statistical Software 43, 1--23.

See Also

checkParms, covDiag, mb.gof.test, Nmix.gof.test

Examples

Run this code
##example modified from ?pcount
if (FALSE) {
if(require(unmarked)){
##Simulate data
set.seed(3)
nSites <- 100
nVisits <- 3
##covariate
x <- rnorm(nSites)               
beta0 <- 0
beta1 <- 1
##expected counts
lambda <- exp(beta0 + beta1*x)   
N <- rpois(nSites, lambda)      
y <- matrix(NA, nSites, nVisits)
p <- c(0.3, 0.6, 0.8)           
for(j in 1:nVisits) {
  y[,j] <- rbinom(nSites, N, p[j])
}
## Organize data
visitMat <- matrix(as.character(1:nVisits),
                   nSites, nVisits, byrow=TRUE)
     
umf <- unmarkedFramePCount(y=y, siteCovs=data.frame(x=x),
                           obsCovs=list(visit=visitMat))
## Fit model
fm1 <- pcount(~ visit ~ 1, umf, K=50)
checkConv(fm1)
}
}

Run the code above in your browser using DataLab