From ac183c732317cf6ede26a2ee127604a407f0a6b3 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 4 Feb 2021 11:24:22 +0100 Subject: Documentation improvements, mainly fixing example code The errors in the example code were in the \dontrun sections, so they were not caught by CRAN checks. In addition, the static help files generated with pkgdown were cached, so I noticed the errors only after completely regenerating the documentation for version 1.0.0. --- docs/reference/confint.mkinfit.html | 85 +++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 42 deletions(-) (limited to 'docs/reference/confint.mkinfit.html') diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index 4f7e8872..b71e039a 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -273,68 +273,69 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, if (identical(Sys.getenv("NOT_CRAN"), "true")) { n_cores <- parallel::detectCores() - 1 } else { - n_cores <- 1 + n_cores <- 1 } if (Sys.getenv("TRAVIS") != "") n_cores = 1 if (Sys.info()["sysname"] == "Windows") n_cores = 1 -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), quiet = TRUE) +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), + use_of_ff = "min", quiet = TRUE) SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), use_of_ff = "max", quiet = TRUE) f_d_1 <- mkinfit(SFO_SFO, subset(FOCUS_2006_D, value != 0), quiet = TRUE) system.time(ci_profile <- confint(f_d_1, method = "profile", cores = 1, quiet = TRUE))
#> user system elapsed -#> 3.796 1.056 3.506
# Using more cores does not save much time here, as parent_0 takes up most of the time +#> 4.324 0.980 3.960
# Using more cores does not save much time here, as parent_0 takes up most of the time # If we additionally exclude parent_0 (the confidence of which is often of -# minor interest), we get a nice performance improvement from about 50 -# seconds to about 12 seconds if we use at least four cores +# minor interest), we get a nice performance improvement if we use at least 4 cores system.time(ci_profile_no_parent_0 <- confint(f_d_1, method = "profile", c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores)) -
#> Profiling the likelihood
#> Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected
#> Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent
#> Timing stopped at: 0 0.043 0.246
ci_profile -
#> 2.5% 97.5% -#> parent_0 96.456003640 1.027703e+02 -#> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892606 6.702775e-03 -#> f_parent_to_m1 0.471328495 5.611550e-01 -#> sigma 2.535612399 3.985263e+00
ci_quadratic_transformed <- confint(f_d_1, method = "quadratic") +
#> Profiling the likelihood
#> user system elapsed +#> 1.480 0.109 0.905
ci_profile +
#> 2.5% 97.5% +#> parent_0 96.456003640 1.027703e+02 +#> k_parent_sink 0.040762501 5.549764e-02 +#> k_parent_m1 0.046786482 5.500879e-02 +#> k_m1_sink 0.003892605 6.702778e-03 +#> sigma 2.535612399 3.985263e+00
ci_quadratic_transformed <- confint(f_d_1, method = "quadratic") ci_quadratic_transformed -
#> 2.5% 97.5% -#> parent_0 96.403833585 102.79311650 -#> k_parent 0.090823771 0.10725430 -#> k_m1 0.004012219 0.00689755 -#> f_parent_to_m1 0.469118824 0.55959615 -#> sigma 2.396089689 3.85491806
ci_quadratic_untransformed <- confint(f_d_1, method = "quadratic", transformed = FALSE) +
#> 2.5% 97.5% +#> parent_0 96.403841640 1.027931e+02 +#> k_parent_sink 0.041033378 5.596269e-02 +#> k_parent_m1 0.046777902 5.511931e-02 +#> k_m1_sink 0.004012217 6.897547e-03 +#> sigma 2.396089689 3.854918e+00
ci_quadratic_untransformed <- confint(f_d_1, method = "quadratic", transformed = FALSE) ci_quadratic_untransformed -
#> 2.5% 97.5% -#> parent_0 96.403833589 1.027931e+02 -#> k_parent 0.090491913 1.069035e-01 -#> k_m1 0.003835485 6.685823e-03 -#> f_parent_to_m1 0.469113477 5.598387e-01 -#> sigma 2.396089689 3.854918e+00
# Against the expectation based on Bates and Watts (1988), the confidence +
#> 2.5% 97.5% +#> parent_0 96.403841645 102.79312449 +#> k_parent_sink 0.040485331 0.05535491 +#> k_parent_m1 0.046611582 0.05494364 +#> k_m1_sink 0.003835483 0.00668582 +#> sigma 2.396089689 3.85491806
# Against the expectation based on Bates and Watts (1988), the confidence # intervals based on the internal parameter transformation are less # congruent with the likelihood based intervals. Note the superiority of the # interval based on the untransformed fit for k_m1_sink rel_diffs_transformed <- abs((ci_quadratic_transformed - ci_profile)/ci_profile) rel_diffs_untransformed <- abs((ci_quadratic_untransformed - ci_profile)/ci_profile) rel_diffs_transformed < rel_diffs_untransformed -
#> 2.5% 97.5% -#> parent_0 FALSE FALSE -#> k_parent TRUE TRUE -#> k_m1 FALSE FALSE -#> f_parent_to_m1 TRUE FALSE -#> sigma TRUE FALSE
signif(rel_diffs_transformed, 3) -
#> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent 0.000960 0.000900 -#> k_m1 0.030700 0.029100 -#> f_parent_to_m1 0.004690 0.002780 -#> sigma 0.055000 0.032700
signif(rel_diffs_untransformed, 3) -
#> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent 0.004610 0.002370 -#> k_m1 0.014700 0.002530 -#> f_parent_to_m1 0.004700 0.002350 -#> sigma 0.055000 0.032700
+
#> 2.5% 97.5% +#> parent_0 FALSE FALSE +#> k_parent_sink TRUE FALSE +#> k_parent_m1 TRUE FALSE +#> k_m1_sink FALSE FALSE +#> sigma FALSE FALSE
signif(rel_diffs_transformed, 3) +
#> 2.5% 97.5% +#> parent_0 0.000541 0.000222 +#> k_parent_sink 0.006650 0.008380 +#> k_parent_m1 0.000183 0.002010 +#> k_m1_sink 0.030700 0.029100 +#> sigma 0.055000 0.032700
signif(rel_diffs_untransformed, 3) +
#> 2.5% 97.5% +#> parent_0 0.000541 0.000222 +#> k_parent_sink 0.006800 0.002570 +#> k_parent_m1 0.003740 0.001180 +#> k_m1_sink 0.014700 0.002530 +#> sigma 0.055000 0.032700
# Investigate a case with formation fractions f_d_2 <- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), quiet = TRUE) -- cgit v1.2.1