Skip to contents

Computes the condition number of the correlation matrix of parameter estimates as the ratio of the largest to smallest eigenvalue. A condition number above 1000 typically indicates numerical difficulties in parameter estimation.

Usage

fetch_condn(lst, digits = NA)

Arguments

lst

An object of class "lst" from read_lst_file().

digits

Integer or NA. Rounding for the condition number. Default NA.

Value

A single numeric value (the condition number), or NA_real_ if the eigenvalue section is absent or contains invalid/negative eigenvalues. Zero eigenvalues return Inf to indicate singularity.

Details

Returns NA gracefully when no covariance step was run or when eigenvalues were not printed (EIGENVLS. PRINTED: NO).

Examples

path <- system.file("extdata", "lst", "s01_focei_cov_success.lst",
                    package = "lstparsR")
lst  <- read_lst_file(path)
fetch_condn(lst)
#> [1] 3.17029