Showing 2 of 6 files from the diff.
Other files ignored by Codecov
check.log has changed.
NEWS.md has changed.
test.log has changed.

@@ -712,17 +712,17 @@
Loading
712 712
    if (error_model_algorithm == "d_3") {
713 713
      if (!quiet) message("Directly optimising the complete model")
714 714
      parms.start <- c(degparms, errparms)
715 -
      fit_direct <- nlminb(parms.start, cost_function,
715 +
      fit_direct <- try(nlminb(parms.start, cost_function,
716 716
        lower = lower[names(parms.start)],
717 717
        upper = upper[names(parms.start)],
718 -
        control = control, ...)
719 -
      fit_direct$logLik <- - cost.current
720 -
      if (error_model_algorithm == "direct") {
721 -
        degparms <- fit_direct$par[degparms_index]
722 -
        errparms <- fit_direct$par[errparms_index]
723 -
      } else {
718 +
        control = control, ...))
719 +
      if (!inherits(fit_direct, "try-error")) {
720 +
        fit_direct$logLik <- - cost.current
724 721
        cost.current <- Inf # reset to avoid conflict with the OLS step
725 722
        data_direct <- current_data # We need this later if it was better
723 +
        direct_failed = FALSE
724 +
      } else {
725 +
        direct_failed = TRUE
726 726
      }
727 727
    }
728 728
    if (error_model_algorithm != "direct") {
@@ -775,24 +775,30 @@
Loading
775 775
776 776
      if (error_model_algorithm == "d_3") {
777 777
        d_3_messages = c(
778 +
           direct_failed = "Direct fitting failed, results of three-step fitting are returned",
778 779
           same = "Direct fitting and three-step fitting yield approximately the same likelihood",
779 780
           threestep = "Three-step fitting yielded a higher likelihood than direct fitting",
780 781
           direct = "Direct fitting yielded a higher likelihood than three-step fitting")
781 -
        rel_diff <- abs((fit_direct$logLik - fit$logLik))/-mean(c(fit_direct$logLik, fit$logLik))
782 -
        if (rel_diff < 0.0001) {
783 -
          if (!quiet) message(d_3_messages["same"])
784 -
          fit$d_3_message <- d_3_messages["same"]
782 +
        if (direct_failed) {
783 +
          if (!quiet) message(d_3_messages["direct_failed"])
784 +
          fit$d_3_message <- d_3_messages["direct_failed"]
785 785
        } else {
786 -
          if (fit$logLik > fit_direct$logLik) {
787 -
            if (!quiet) message(d_3_messages["threestep"])
788 -
            fit$d_3_message <- d_3_messages["threestep"]
786 +
          rel_diff <- abs((fit_direct$logLik - fit$logLik))/-mean(c(fit_direct$logLik, fit$logLik))
787 +
          if (rel_diff < 0.0001) {
788 +
            if (!quiet) message(d_3_messages["same"])
789 +
            fit$d_3_message <- d_3_messages["same"]
789 790
          } else {
790 -
            if (!quiet) message(d_3_messages["direct"])
791 -
            fit <- fit_direct
792 -
            fit$d_3_message <- d_3_messages["direct"]
793 -
            degparms <- fit$par[degparms_index]
794 -
            errparms <- fit$par[errparms_index]
795 -
            current_data  <- data_direct
791 +
            if (fit$logLik > fit_direct$logLik) {
792 +
              if (!quiet) message(d_3_messages["threestep"])
793 +
              fit$d_3_message <- d_3_messages["threestep"]
794 +
            } else {
795 +
              if (!quiet) message(d_3_messages["direct"])
796 +
              fit <- fit_direct
797 +
              fit$d_3_message <- d_3_messages["direct"]
798 +
              degparms <- fit$par[degparms_index]
799 +
              errparms <- fit$par[errparms_index]
800 +
              current_data  <- data_direct
801 +
            }
796 802
          }
797 803
        }
798 804
      }

@@ -19,8 +19,9 @@
Loading
19 19
#' @param \dots Further arguments that will be passed to \code{\link{mkinfit}}.
20 20
#' @importFrom parallel mclapply parLapply detectCores
21 21
#' @return A two-dimensional \code{\link{array}} of \code{\link{mkinfit}}
22 -
#'   objects that can be indexed using the model names for the first index (row index) 
23 -
#'   and the dataset names for the second index (column index).
22 +
#'   objects and/or try-errors that can be indexed using the model names for the
23 +
#'   first index (row index) and the dataset names for the second index (column
24 +
#'   index).
24 25
#' @author Johannes Ranke
25 26
#' @seealso \code{\link{[.mmkin}} for subsetting, \code{\link{plot.mmkin}} for
26 27
#'   plotting.
Files Coverage
R 87.91%
Project Totals (39 files) 87.91%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading