extractCN {AICcmodavg}R Documentation

Compute Condition Number


This function computes the condition number for models of unmarkedFit classes as the ratio of the largest eigenvalue of the Hessian matrix to the smallest eigenvalue of the Hessian matrix.


extractCN(mod, method = "svd", ...)

## S3 method for class 'unmarkedFit'
extractCN(mod, method = "svd", ...)



a model of one the unmarkedFit classes for which a condition number is requested.


specifies the method used to extract the singular values or eigenvalues from the Hessian matrix using singular value decomposition (method = "svd") or eigenvalue decomposition (method = "eigen").


additional arguments passed to the function.


The condition number (\kappa) is a measure of the transfer of error to the solution in response to small changes in the input (Cheney and Kincaid 2008). In this implementation, the condition number is computed on the Hessian matrix of models of unmarkedFit classes from the optim results stored in the model object. The condition number is defined as the ratio of the largest to the smallest non-negative singular values of a given matrix (Cline et al. 1979, Dixon 1983). In the special case of positive semi-definite matrices, the singular values are equal to the eigenvalues (Ruhe 1975).

Large values of the condition number may indicate problems in estimating parameters or their variance (ill-conditioning), possibly due to a model having too many parameters for the given data set. Cheney and Ward (2008) suggest using the \log_{10}(\kappa) of the condition number as a crude estimate of the number of digits of precision lost.


extractCN returns a list of class extractCN with the following components:


the condition number (\kappa) of the model.


the log base 10 of the condition number.


the method used to extract the singular values or eigenvalues.


Marc J. Mazerolle


Cheney, W., Kincaid, D. (2008) Numerical mathematics and computing. Sixth edition. Thomson Brooks/Cole: Belmont.

Cline, A. K., Moler, C. B., Stewart, G. W., Wilkinson, J. H. (1979) An estimate for the condition number of a matrix. SIAM Journal on Numerical Analysis 16, 368–375.

Dixon, J. D. (1983) Estimating extremal eigenvalues and condition numbers of matrices. SIAM Journal on Numerical Analysis 20, 812–814.

Ruhe, A. (1975) On the closeness of eigenvalues and singular values for almost normal matrices. Linear Algebra and its Applications 11, 87–94.

See Also

c_hat, mb.gof.test, Nmix.gof.test, parboot, kappa, rcond


##N-mixture model example modified from ?pcount
## Not run: 
##single season
mallardUMF <- unmarkedFramePCount(mallard.y, siteCovs = mallard.site,
                                  obsCovs = mallard.obs)
##run model
fm.mallard <- pcount(~ ivel+ date + I(date^2) ~ length + elev + forest,
                     mallardUMF, K=30)

##compute condition number

##compare against 'kappa'
kappa(fm.mallard@opt$hessian, exact = TRUE)

## End(Not run)

[Package AICcmodavg version 2.3-3 Index]