From 9ac853c7ceece333099021974025d07e75be2b33 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 12 May 2020 08:07:07 +0200 Subject: Documentation improvements, rebuild static docs --- docs/reference/confint.mkinfit.html | 164 +++++++++++++++++++++--------------- 1 file changed, 94 insertions(+), 70 deletions(-) (limited to 'docs/reference/confint.mkinfit.html') diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index 1dd6288b..7658a572 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -44,7 +48,6 @@ parameter. The 'profile' method uses two nested optimisations and can take a very long time, even if parallelized by specifying 'cores' on unixoid platforms. The speed of the method could likely be improved by using the method of Venzon and Moolgavkar (1988)." /> - @@ -62,7 +65,7 @@ method of Venzon and Moolgavkar (1988)." /> - +
@@ -120,7 +123,12 @@ method of Venzon and Moolgavkar (1988)." />
@@ -135,7 +143,7 @@ method of Venzon and Moolgavkar (1988)." />
@@ -212,7 +220,7 @@ their confidence intervals?

cores -

The number of cores to be used for multicore processing. +

The number of cores to be used for multicore processing. On Windows machines, cores > 1 is currently not supported.

@@ -228,15 +236,15 @@ On Windows machines, cores > 1 is currently not supported.

Value

A matrix with columns giving lower and upper confidence limits for - each parameter.

+each parameter.

References

Bates DM and Watts GW (1988) Nonlinear regression analysis & its applications

Pawitan Y (2013) In all likelihood - Statistical modelling and - inference using likelihood. Clarendon Press, Oxford.

+inference using likelihood. Clarendon Press, Oxford.

Venzon DJ and Moolgavkar SH (1988) A Method for Computing - Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, - 87–94.

+Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, +87–94.

Examples

f <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE) @@ -262,50 +270,71 @@ On Windows machines, cores > 1 is currently not supported.

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))
#> Error in mkinpredict.mkinmod(mkinmod, parms, odeini, outtimes, solution_type = solution_type, use_compiled = use_compiled, method.ode = method.ode, atol = atol, rtol = rtol, ...): Differential equations were not integrated for all output times because -#> NaN values occurred in output from ode()
#> Timing stopped at: 11.39 0 11.4
# Using more cores does not save much time here, as parent_0 takes up most of the time +system.time(ci_profile <- confint(f_d_1, method = "profile", cores = 1, quiet = TRUE))
#> User System verstrichen +#> 3.362 0.000 3.364
# 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 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
#> User System verstrichen -#> 20.058 0.122 11.784
ci_profile
#> Error in eval(expr, envir, enclos): Objekt 'ci_profile' nicht gefunden
ci_quadratic_transformed <- confint(f_d_1, method = "quadratic") -ci_quadratic_transformed
#> 2.5% 97.5% -#> parent_0 96.403841641 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.403841648 102.79312450 -#> 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 + c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores))
#> Profiling the likelihood
#> Warning: scheduled cores 1, 2, 3 encountered errors in user code, all values of the jobs will be affected
#> Error in dimnames(x) <- dn: Länge von 'dimnames' [2] ungleich der Arrayausdehnung
#> Timing stopped at: 0.011 0.045 0.201
ci_profile
#> 2.5% 97.5% +#> parent_0 96.456003640 1.027703e+02 +#> k_parent 0.090911032 1.071578e-01 +#> k_m1 0.003892605 6.702778e-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") +ci_quadratic_transformed
#> 2.5% 97.5% +#> parent_0 96.403839460 1.027931e+02 +#> k_parent 0.090823790 1.072543e-01 +#> k_m1 0.004012216 6.897547e-03 +#> f_parent_to_m1 0.469118713 5.595960e-01 +#> 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.403839413 1.027931e+02 +#> k_parent 0.090491931 1.069035e-01 +#> k_m1 0.003835483 6.685819e-03 +#> f_parent_to_m1 0.469113365 5.598386e-01 +#> sigma 2.396089689 3.854918e+00
# 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)
#> Error in eval(expr, envir, enclos): Objekt 'ci_profile' nicht gefunden
rel_diffs_untransformed <- abs((ci_quadratic_untransformed - ci_profile)/ci_profile)
#> Error in eval(expr, envir, enclos): Objekt 'ci_profile' nicht gefunden
rel_diffs_transformed < rel_diffs_untransformed
#> Error in eval(expr, envir, enclos): Objekt 'rel_diffs_transformed' nicht gefunden
signif(rel_diffs_transformed, 3)
#> Error in eval(expr, envir, enclos): Objekt 'rel_diffs_transformed' nicht gefunden
signif(rel_diffs_untransformed, 3)
#> Error in eval(expr, envir, enclos): Objekt 'rel_diffs_untransformed' nicht gefunden
+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 TRUE TRUE +#> k_parent TRUE TRUE +#> k_m1 FALSE FALSE +#> f_parent_to_m1 TRUE FALSE +#> sigma FALSE 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
# Investigate a case with formation fractions f_d_2 <- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), quiet = TRUE) ci_profile_ff <- confint(f_d_2, method = "profile", cores = n_cores)
#> Profiling the likelihood
ci_profile_ff
#> 2.5% 97.5% -#> parent_0 96.456003650 1.027703e+02 +#> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 #> k_m1 0.003892605 6.702778e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 #> sigma 2.535612399 3.985263e+00
ci_quadratic_transformed_ff <- confint(f_d_2, method = "quadratic") ci_quadratic_transformed_ff
#> 2.5% 97.5% -#> parent_0 96.403839992 1.027931e+02 +#> parent_0 96.403839460 1.027931e+02 #> k_parent 0.090823790 1.072543e-01 #> k_m1 0.004012216 6.897547e-03 -#> f_parent_to_m1 0.469118711 5.595960e-01 +#> f_parent_to_m1 0.469118713 5.595960e-01 #> sigma 2.396089689 3.854918e+00
ci_quadratic_untransformed_ff <- confint(f_d_2, method = "quadratic", transformed = FALSE) ci_quadratic_untransformed_ff
#> 2.5% 97.5% -#> parent_0 96.403839944 1.027931e+02 +#> parent_0 96.403839413 1.027931e+02 #> k_parent 0.090491931 1.069035e-01 #> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113362 5.598386e-01 +#> f_parent_to_m1 0.469113365 5.598386e-01 #> sigma 2.396089689 3.854918e+00
rel_diffs_transformed_ff <- abs((ci_quadratic_transformed_ff - ci_profile_ff)/ci_profile_ff) rel_diffs_untransformed_ff <- abs((ci_quadratic_untransformed_ff - ci_profile_ff)/ci_profile_ff) # While the confidence interval for the parent rate constant is closer to @@ -318,15 +347,15 @@ On Windows machines, cores > 1 is currently not supported.

#> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE #> sigma FALSE FALSE
rel_diffs_transformed_ff
#> 2.5% 97.5% -#> parent_0 0.0005408026 0.0002217846 -#> k_parent 0.0009596414 0.0009003877 -#> k_m1 0.0307277403 0.0290579212 -#> f_parent_to_m1 0.0046884168 0.0027782604 +#> parent_0 0.0005408080 0.0002217794 +#> k_parent 0.0009596417 0.0009003876 +#> k_m1 0.0307277370 0.0290579182 +#> f_parent_to_m1 0.0046884130 0.0027782556 #> sigma 0.0550252516 0.0327066836
rel_diffs_untransformed_ff
#> 2.5% 97.5% -#> parent_0 0.0005408031 0.0002217851 -#> k_parent 0.0046100089 0.0023730230 -#> k_m1 0.0146746442 0.0025300972 -#> f_parent_to_m1 0.0046997642 0.0023460268 +#> parent_0 0.0005408085 0.0002217799 +#> k_parent 0.0046100096 0.0023730229 +#> k_m1 0.0146746469 0.0025301011 +#> f_parent_to_m1 0.0046997599 0.0023460223 #> sigma 0.0550252516 0.0327066836
# The profiling for the following fit does not finish in a reasonable time, # therefore we use the quadratic approximation @@ -337,29 +366,24 @@ On Windows machines, cores > 1 is currently not supported.

DFOP_par_c <- synthetic_data_for_UBA_2014[[12]]$data f_tc_2 <- mkinfit(m_synth_DFOP_par, DFOP_par_c, error_model = "tc", error_model_algorithm = "direct", quiet = TRUE) -confint(f_tc_2, method = "quadratic")
#> 2.5% 97.5% -#> parent_0 94.596218141 106.19934683 -#> k_M1 0.037605440 0.04490756 -#> k_M2 0.008568747 0.01087674 -#> f_parent_to_M1 0.021466788 0.62023878 -#> f_parent_to_M2 0.015168650 0.37975352 -#> k1 0.273897581 0.33388066 -#> k2 0.018614556 0.02250379 -#> g 0.671943831 0.73583255 -#> sigma_low 0.251283700 0.83992071 -#> rsd_high 0.040411017 0.07662005
confint(f_tc_2, "parent_0", method = "quadratic")
#> 2.5% 97.5% -#> parent_0 94.59622 106.1993
# } +confint(f_tc_2, method = "quadratic")
#> 2.5% 97.5% +#> parent_0 94.59613833 106.19939215 +#> k_M1 0.03760542 0.04490759 +#> k_M2 0.00856874 0.01087675 +#> f_parent_to_M1 0.02146166 0.62023888 +#> f_parent_to_M2 0.01516502 0.37975343 +#> k1 0.27389751 0.33388078 +#> k2 0.01861456 0.02250379 +#> g 0.67194349 0.73583256 +#> sigma_low 0.25128383 0.83992146 +#> rsd_high 0.04041100 0.07662001
confint(f_tc_2, "parent_0", method = "quadratic")
#> 2.5% 97.5% +#> parent_0 94.59614 106.1994
# }
- @@ -370,7 +394,7 @@ On Windows machines, cores > 1 is currently not supported.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

-- cgit v1.2.1