From cf73354f985be17352a4d538c6f9ea69f6be9aa9 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 2 Dec 2022 13:28:26 +0100 Subject: Avoid redundant warnings in summaries --- NEWS.md | 2 +- R/summary.saem.mmkin.R | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 65df4191..15c45cc9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ - 'R/mhmkin.R': Allow an 'illparms.mhmkin' object or a list with suitable dimensions as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well. -- 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters +- 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted. # mkin 1.2.1 (2022-11-19) diff --git a/R/summary.saem.mmkin.R b/R/summary.saem.mmkin.R index 7337b0f3..46ab548b 100644 --- a/R/summary.saem.mmkin.R +++ b/R/summary.saem.mmkin.R @@ -136,10 +136,11 @@ summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = } # Correlation of fixed effects (inspired by summary.nlme) - varFix <- try(vcov(object$so)[1:n_fixed, 1:n_fixed]) - if (inherits(varFix, "try-error")) { + cov_so <- try(solve(object$so@results@fim), silent = TRUE) + if (inherits(cov_so, "try-error")) { object$corFixed <- NA } else { + varFix <- cov_so[1:n_fixed, 1:n_fixed] stdFix <- sqrt(diag(varFix)) object$corFixed <- array( t(varFix/stdFix)/stdFix, -- cgit v1.2.1