From df733ceeb044e41922930f89be437e2def92e804 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 20 Feb 2015 22:31:55 +0100 Subject: Add termination message to mkinfit, prepare release --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/mkinfit.R | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 202251fb..03976d1e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Type: Package Title: Routines for Fitting Kinetic Models with One or More State Variables to Chemical Degradation Data Version: 0.9-35 -Date: 2014-11-22 +Date: 2015-02-20 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Katrin", "Lindenberger", role = "ctb"), diff --git a/NEWS.md b/NEWS.md index 929a8263..c8284175 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,10 @@ - `mkinparplot()`: Avoid warnings that occurred when not all confidence intervals were available in the summary of the fit - `print.summary.mkinfit()`: Fix printing the summary for the case that the number of iterations is not available +## NEW FEATURES + +- `mkinfit()`: Report successful termination when quiet = FALSE. This is helpful for more difficult problems fitted with reweight.method = obs, as no progress is often indicated during the reweighting. + # CHANGES in mkin VERSION 0.9-34 ## NEW FEATURES diff --git a/R/mkinfit.R b/R/mkinfit.R index 08622f9c..b0df6e8c 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -376,6 +376,9 @@ mkinfit <- function(mkinmod, observed, fit$message) warning(fit$warning) } + else { + if(!quiet) cat("Optimisation by method", method.modFit, "successfully terminated.\n") + } } if (method.modFit %in% c("Port", "SANN", "Nelder-Mead", "BFGS", "CG", "L-BFGS-B")) { if (fit$convergence != 0) { @@ -385,11 +388,16 @@ mkinfit <- function(mkinmod, observed, ifelse(is.null(fit$message), "", paste0("\nMessage is ", fit$message))) warning(fit$warning) + } else { + if(!quiet) cat("Optimisation by method", method.modFit, "successfully terminated.\n") } } # Return number of iterations for SANN method - if (method.modFit == "SANN") fit$iter = maxit.modFit + if (method.modFit == "SANN") { + fit$iter = maxit.modFit + if(!quiet) cat("Termination of the SANN algorithm does not imply convergence.\n") + } # We need to return some more data for summary and plotting fit$solution_type <- solution_type -- cgit v1.2.1