extractCN function

Compute Condition Number

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. 1.1

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

Arguments

  • mod: a model of one the unmarkedFit classes for which a condition number is requested.
  • method: 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.

Details

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 log10(κ)\log_{10}(\kappa) of the condition number as a crude estimate of the number of digits of precision lost.

Returns

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

  • CN: the condition number (κ\kappa) of the model.

  • log10: the log base 10 of the condition number.

  • method: the method used to extract the singular values or eigenvalues.

References

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.

Author(s)

Marc J. Mazerolle

See Also

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

Examples

##N-mixture model example modified from ?pcount ## Not run: require(unmarked) ##single season data(mallard) 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 extractCN(fm.mallard) ##compare against 'kappa' kappa(fm.mallard@opt$hessian, exact = TRUE) detach(package:unmarked) ## End(Not run)
  • Maintainer: Marc J. Mazerolle
  • License: GPL (>= 2)
  • Last published: 2025-03-06

Useful links