From 8a3475c59f3d91ce5ce7d980d6de09360617e7fe Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 7 May 2019 08:12:27 +0200 Subject: After the OLS step, use OLS parameter estimates - Fix the respective error in the code - Static documentation rebuilt by pkgdown --- docs/reference/NAFTA_SOP_2015.html | 32 +-- docs/reference/NAFTA_SOP_Attachment.html | 32 +-- docs/reference/logLik.mkinfit.html | 2 +- docs/reference/logistic.solution.html | 18 +- docs/reference/mccall81_245T.html | 45 ++-- docs/reference/mkinfit.html | 339 ++++++++++++---------------- docs/reference/mkinmod.html | 2 +- docs/reference/mkinparplot-1.png | Bin 16549 -> 17306 bytes docs/reference/mkinparplot.html | 2 +- docs/reference/mkinpredict.html | 8 +- docs/reference/mmkin.html | 4 +- docs/reference/nafta.html | 32 +-- docs/reference/summary.mkinfit.html | 30 ++- docs/reference/test_data_from_UBA_2014.html | 54 ++--- docs/reference/transform_odeparms.html | 90 ++++---- 15 files changed, 300 insertions(+), 390 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/NAFTA_SOP_2015.html b/docs/reference/NAFTA_SOP_2015.html index 84341a17..9fbc71c6 100644 --- a/docs/reference/NAFTA_SOP_2015.html +++ b/docs/reference/NAFTA_SOP_2015.html @@ -155,7 +155,7 @@

Examples

-
nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The representative half-life of the IORE model is longer than the one corresponding
#> to the terminal degradation rate found with the DFOP model.
#> The representative half-life obtained from the DFOP model may be used
print(nafta_evaluation)
#> Sums of squares: +
nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The representative half-life of the IORE model is longer than the one corresponding
#> to the terminal degradation rate found with the DFOP model.
#> The representative half-life obtained from the DFOP model may be used
print(nafta_evaluation)
#> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 #> @@ -164,25 +164,25 @@ #> #> Parameters: #> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 83.7558 1.80e-14 77.18268 90.3288 -#> k_parent_sink 0.0017 7.43e-05 0.00112 0.0026 -#> sigma 8.7518 1.22e-05 5.64278 11.8608 +#> Estimate Pr(>t) Lower Upper +#> parent_0 83.7558 NA NA NA +#> k_parent_sink 0.0017 NA NA NA +#> sigma 8.7518 NA NA NA #> #> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 -#> k__iore_parent_sink 8.40e-14 NA 1.79e-18 3.94e-09 -#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 -#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.69e+01 NA NA NA +#> k__iore_parent_sink 8.40e-14 NA NA NA +#> N_parent 6.68e+00 NA NA NA +#> sigma 5.85e+00 NA NA NA #> #> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02 -#> k1 4.24e-02 5.92e-03 2.03e-02 8.88e-02 -#> k2 8.24e-04 6.48e-03 3.89e-04 1.75e-03 -#> g 2.88e-01 2.47e-05 1.95e-01 4.03e-01 -#> sigma 5.36e+00 2.22e-05 3.43e+00 7.30e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.76e+01 NA NA NA +#> k1 4.24e-02 NA NA NA +#> k2 8.24e-04 NA NA NA +#> g 2.88e-01 NA NA NA +#> sigma 5.36e+00 NA NA NA #> #> #> DTx values: diff --git a/docs/reference/NAFTA_SOP_Attachment.html b/docs/reference/NAFTA_SOP_Attachment.html index 76d91c40..149b4d82 100644 --- a/docs/reference/NAFTA_SOP_Attachment.html +++ b/docs/reference/NAFTA_SOP_Attachment.html @@ -152,7 +152,7 @@

Examples

-
nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1)
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The half-life obtained from the IORE model may be used
print(nafta_att_p5a)
#> Sums of squares: +
nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1)
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The half-life obtained from the IORE model may be used
print(nafta_att_p5a)
#> Sums of squares: #> SFO IORE DFOP #> 465.21753 56.27506 32.06401 #> @@ -161,25 +161,25 @@ #> #> Parameters: #> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 95.8401 4.67e-21 92.245 99.4357 -#> k_parent_sink 0.0102 3.92e-12 0.009 0.0117 -#> sigma 4.8230 3.81e-06 3.214 6.4318 +#> Estimate Pr(>t) Lower Upper +#> parent_0 95.8401 NA NA NA +#> k_parent_sink 0.0102 NA NA NA +#> sigma 4.8230 NA NA NA #> #> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 1.01e+02 NA 9.91e+01 1.02e+02 -#> k__iore_parent_sink 1.54e-05 NA 4.08e-06 5.84e-05 -#> N_parent 2.57e+00 NA 2.25e+00 2.89e+00 -#> sigma 1.68e+00 NA 1.12e+00 2.24e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 1.01e+02 NA NA NA +#> k__iore_parent_sink 1.54e-05 NA NA NA +#> N_parent 2.57e+00 NA NA NA +#> sigma 1.68e+00 NA NA NA #> #> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.99e+01 1.41e-26 98.8116 101.0810 -#> k1 2.67e-02 5.05e-06 0.0243 0.0295 -#> k2 2.86e-12 5.00e-01 0.0000 Inf -#> g 6.47e-01 3.67e-06 0.6248 0.6677 -#> sigma 1.27e+00 8.91e-06 0.8395 1.6929 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.99e+01 NA NA NA +#> k1 2.67e-02 NA NA NA +#> k2 2.86e-12 NA NA NA +#> g 6.47e-01 NA NA NA +#> sigma 1.27e+00 NA NA NA #> #> #> DTx values: diff --git a/docs/reference/logLik.mkinfit.html b/docs/reference/logLik.mkinfit.html index f5844a8e..0184d573 100644 --- a/docs/reference/logLik.mkinfit.html +++ b/docs/reference/logLik.mkinfit.html @@ -180,7 +180,7 @@ The total number of estimated parameters returned with the value f_nw <- mkinfit(sfo_sfo, d_t, quiet = TRUE) # no weighting (weights are unity)
#> Warning: Observations with value of zero were removed from the data
f_obs <- mkinfit(sfo_sfo, d_t, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
f_tc <- mkinfit(sfo_sfo, d_t, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
AIC(f_nw, f_obs, f_tc)
#> df AIC #> f_nw 5 204.4486 #> f_obs 6 205.8727 -#> f_tc 6 148.1802
+#> f_tc 6 141.9656
summary(m)$bpar
#> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 1.057896e+02 1.9023449649 55.610120 3.768361e-16 1.016451e+02 -#> kmax 6.398190e-02 0.0143201029 4.467978 3.841828e-04 3.929235e-02 -#> k0 1.612775e-04 0.0005866813 0.274898 3.940351e-01 5.846685e-08 -#> r 2.263946e-01 0.1718110773 1.317695 1.061044e-01 4.335843e-02 -#> sigma 5.332935e+00 0.9145907310 5.830952 4.036926e-05 3.340213e+00 -#> Upper -#> parent_0 109.9341588 -#> kmax 0.1041853 -#> k0 0.4448750 -#> r 1.1821121 -#> sigma 7.3256566
endpoints(m)$distimes
#> DT50 DT90 DT50_k0 DT50_kmax + plot_sep(m)
summary(m)$bpar
#> Warning: Could not calculate correlation; no covariance matrix
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 1.057896e+02 NA NA NA NA NA +#> kmax 6.398190e-02 NA NA NA NA NA +#> k0 1.612775e-04 NA NA NA NA NA +#> r 2.263946e-01 NA NA NA NA NA +#> sigma 5.332935e+00 NA NA NA NA NA
endpoints(m)$distimes
#> DT50 DT90 DT50_k0 DT50_kmax #> parent 36.86533 62.41511 4297.854 10.83349
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.002 0.000 0.001
system.time( +#> 0.001 0.000 0.001
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.022 0.000 0.021
+#> 0.021 0.000 0.022
# Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C)
#> Ordinary least squares optimisation
#> Sum of squared residuals at call 1: 552.5739 #> Sum of squared residuals at call 3: 552.5739 @@ -368,9 +368,7 @@ #> Sum of squared residuals at call 59: 196.5334 #> Sum of squared residuals at call 65: 196.5334 #> Sum of squared residuals at call 73: 196.5334 -#> Negative log-likelihood at call 75: 26.64668 -#> Negative log-likelihood at call 103: 26.64668 -#> Optimisation successfully terminated.
head(mkinpredict(f))
#> time parent m1 +#> Negative log-likelihood at call 75: 26.64668
#> Optimisation successfully terminated.
head(mkinpredict(f))
#> time parent m1 #> 1 0.0 82.49216 0.000000 #> 2 0.1 80.00563 1.179955 #> 3 0.2 77.59404 2.312580 diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index c730ecb0..849e619e 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -194,8 +194,8 @@ time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) time_default
#> User System verstrichen -#> 0.042 0.028 5.095
time_1
#> User System verstrichen -#> 19.29 0.00 19.30
+#> 0.039 0.031 3.113
time_1
#> User System verstrichen +#> 10.445 0.001 10.456
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340481 0.2659519 0.7505684 0.2494316 diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html index a9ee2f76..62027fab 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -182,7 +182,7 @@

Examples

-
nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The representative half-life of the IORE model is longer than the one corresponding
#> to the terminal degradation rate found with the DFOP model.
#> The representative half-life obtained from the DFOP model may be used
print(nafta_evaluation)
#> Sums of squares: +
nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> Warning: Could not calculate correlation; no covariance matrix
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The representative half-life of the IORE model is longer than the one corresponding
#> to the terminal degradation rate found with the DFOP model.
#> The representative half-life obtained from the DFOP model may be used
print(nafta_evaluation)
#> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 #> @@ -191,25 +191,25 @@ #> #> Parameters: #> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 83.7558 1.80e-14 77.18268 90.3288 -#> k_parent_sink 0.0017 7.43e-05 0.00112 0.0026 -#> sigma 8.7518 1.22e-05 5.64278 11.8608 +#> Estimate Pr(>t) Lower Upper +#> parent_0 83.7558 NA NA NA +#> k_parent_sink 0.0017 NA NA NA +#> sigma 8.7518 NA NA NA #> #> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 -#> k__iore_parent_sink 8.40e-14 NA 1.79e-18 3.94e-09 -#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 -#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.69e+01 NA NA NA +#> k__iore_parent_sink 8.40e-14 NA NA NA +#> N_parent 6.68e+00 NA NA NA +#> sigma 5.85e+00 NA NA NA #> #> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02 -#> k1 4.24e-02 5.92e-03 2.03e-02 8.88e-02 -#> k2 8.24e-04 6.48e-03 3.89e-04 1.75e-03 -#> g 2.88e-01 2.47e-05 1.95e-01 4.03e-01 -#> sigma 5.36e+00 2.22e-05 3.43e+00 7.30e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.76e+01 NA NA NA +#> k1 4.24e-02 NA NA NA +#> k2 8.24e-04 NA NA NA +#> g 2.88e-01 NA NA NA +#> sigma 5.36e+00 NA NA NA #> #> #> DTx values: diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 351d7a7e..a4f3d04f 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -209,17 +209,17 @@

Examples

-
summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.49.4 +
summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> Warning: Could not calculate correlation; no covariance matrix
#> mkin version used for fitting: 0.9.49.4 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri May 3 19:08:31 2019 -#> Date of summary: Fri May 3 19:08:31 2019 +#> Date of fit: Tue May 7 08:09:03 2019 +#> Date of summary: Tue May 7 08:09:03 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.27 s +#> Fitted using 39 model solutions performed in 0.08 s #> #> Error model: #> Constant variance @@ -240,25 +240,21 @@ #> None #> #> Optimised, transformed parameters with symmetric confidence intervals: -#> Estimate Std. Error Lower Upper -#> parent_0 109.200 3.70400 99.630 118.700 -#> log_k_parent_sink -3.291 0.09176 -3.527 -3.055 -#> sigma 5.266 1.31600 1.882 8.649 +#> Estimate Std. Error Lower Upper +#> parent_0 109.200 NA NA NA +#> log_k_parent_sink -3.291 NA NA NA +#> sigma 5.266 NA NA NA #> #> Parameter correlation: -#> parent_0 log_k_parent_sink sigma -#> parent_0 1.000e+00 5.428e-01 1.648e-07 -#> log_k_parent_sink 5.428e-01 1.000e+00 2.513e-07 -#> sigma 1.648e-07 2.513e-07 1.000e+00 -#> +#> No covariance matrix #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. #> t-test (unrealistically) based on the assumption of normal distribution #> for estimators of untransformed parameters. -#> Estimate t value Pr(>t) Lower Upper -#> parent_0 109.20000 29.47 4.218e-07 99.6300 118.70000 -#> k_parent_sink 0.03722 10.90 5.650e-05 0.0294 0.04712 -#> sigma 5.26600 4.00 5.162e-03 1.8820 8.64900 +#> Estimate t value Pr(>t) Lower Upper +#> parent_0 109.20000 NA NA NA NA +#> k_parent_sink 0.03722 NA NA NA NA +#> sigma 5.26600 NA NA NA NA #> #> FOCUS Chi2 error levels in percent: #> err.min n.optim df diff --git a/docs/reference/test_data_from_UBA_2014.html b/docs/reference/test_data_from_UBA_2014.html index bc988340..11cb6420 100644 --- a/docs/reference/test_data_from_UBA_2014.html +++ b/docs/reference/test_data_from_UBA_2014.html @@ -159,20 +159,13 @@ # model). m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"), parent_s = mkinsub("SFO", "parent_w"))
#> Successfully compiled differential equation model from auto-generated C code.
f_river <- mkinfit(m_ws, test_data_from_UBA_2014[[1]]$data, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
plot_sep(f_river)
- summary(f_river)$bpar
#> Estimate se_notrans t value Pr(>t) -#> parent_w_0 9.598567e+01 2.12351789 4.520126e+01 9.476190e-18 -#> k_parent_w_sink 3.603743e-01 0.03149282 1.144306e+01 4.126593e-09 -#> k_parent_w_parent_s 6.031371e-02 0.01603582 3.761186e+00 9.436275e-04 -#> k_parent_s_sink 5.108964e-11 0.09482736 5.387647e-10 5.000000e-01 -#> k_parent_s_parent_w 7.419672e-02 0.10737376 6.910135e-01 2.500560e-01 -#> sigma 2.982879e+00 0.50545649 5.901356e+00 1.454535e-05 -#> Lower Upper -#> parent_w_0 91.48420503 100.4871438 -#> k_parent_w_sink 0.30668904 0.4234571 -#> k_parent_w_parent_s 0.03423904 0.1062455 -#> k_parent_s_sink 0.00000000 Inf -#> k_parent_s_parent_w 0.02289956 0.2404043 -#> sigma 2.00184022 3.9639169
mkinerrmin(f_river)
#> err.min n.optim df + summary(f_river)$bpar
#> Warning: Could not calculate correlation; no covariance matrix
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_w_0 9.598567e+01 NA NA NA NA NA +#> k_parent_w_sink 3.603743e-01 NA NA NA NA NA +#> k_parent_w_parent_s 6.031371e-02 NA NA NA NA NA +#> k_parent_s_sink 5.108964e-11 NA NA NA NA NA +#> k_parent_s_parent_w 7.419672e-02 NA NA NA NA NA +#> sigma 2.982879e+00 NA NA NA NA NA
mkinerrmin(f_river)
#> err.min n.optim df #> All data 0.09246946 5 6 #> parent_w 0.06377096 3 3 #> parent_s 0.20882325 2 3
@@ -183,28 +176,17 @@ M2 = mkinsub("SFO", "M3"), M3 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
- f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright"))
summary(f_soil)$bpar
#> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 76.55425584 0.859186619 89.1008474 1.113866e-26 74.755959756 -#> k_parent 0.12081956 0.004601922 26.2541544 1.077373e-16 0.111561582 -#> k_M1 0.84258649 0.806231419 1.0450926 1.545475e-01 0.113839803 -#> k_M2 0.04210878 0.017083049 2.4649453 1.170195e-02 0.018013807 -#> k_M3 0.01122919 0.007245890 1.5497322 6.885127e-02 0.002909463 -#> f_parent_to_M1 0.32240199 0.240803555 1.3388589 9.820820e-02 NA -#> f_parent_to_M2 0.16099854 0.033691991 4.7785403 6.531224e-05 NA -#> f_M1_to_M3 0.27921501 0.269443514 1.0362655 1.565440e-01 0.022992937 -#> f_M2_to_M3 0.55641331 0.595125445 0.9349513 1.807725e-01 0.008003317 -#> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 -#> Upper -#> parent_0 78.35255192 -#> k_parent 0.13084582 -#> k_M1 6.23641265 -#> k_M2 0.09843279 -#> k_M3 0.04333950 -#> f_parent_to_M1 NA -#> f_parent_to_M2 NA -#> f_M1_to_M3 0.86443083 -#> f_M2_to_M3 0.99489847 -#> sigma 1.45337221
mkinerrmin(f_soil)
#> err.min n.optim df + f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright"))
summary(f_soil)$bpar
#> Warning: Could not calculate correlation; no covariance matrix
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 76.55425584 NA NA NA NA NA +#> k_parent 0.12081956 NA NA NA NA NA +#> k_M1 0.84258649 NA NA NA NA NA +#> k_M2 0.04210878 NA NA NA NA NA +#> k_M3 0.01122919 NA NA NA NA NA +#> f_parent_to_M1 0.32240199 NA NA NA NA NA +#> f_parent_to_M2 0.16099854 NA NA NA NA NA +#> f_M1_to_M3 0.27921501 NA NA NA NA NA +#> f_M2_to_M3 0.55641331 NA NA NA NA NA +#> sigma 1.14005399 NA NA NA NA NA
mkinerrmin(f_soil)
#> err.min n.optim df #> All data 0.09649963 9 20 #> parent 0.04721283 2 6 #> M1 0.26551209 2 5 diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 7e05480e..c91565b9 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -202,32 +202,30 @@ The transformation of sets of formation fractions is fragile, as it supposes
SFO_SFO <- mkinmod( parent = list(type = "SFO", to = "m1", sink = TRUE), m1 = list(type = "SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.s <- summary(fit) -# Transformed and backtransformed parameters -print(fit.s$par, 3)
#> Estimate Std. Error Lower Upper -#> parent_0 99.60 1.5702 96.40 102.79 -#> log_k_parent_sink -3.04 0.0763 -3.19 -2.88 -#> log_k_parent_m1 -2.98 0.0403 -3.06 -2.90 -#> log_k_m1_sink -5.25 0.1332 -5.52 -4.98 -#> sigma 3.13 0.3585 2.40 3.85
print(fit.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04103 0.0560 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04678 0.0551 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
+fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.s <- summary(fit)
#> Warning: Could not calculate correlation; no covariance matrix
# Transformed and backtransformed parameters +print(fit.s$par, 3)
#> Estimate Std. Error Lower Upper +#> parent_0 99.60 NA NA NA +#> log_k_parent_sink -3.04 NA NA NA +#> log_k_parent_m1 -2.98 NA NA NA +#> log_k_m1_sink -5.25 NA NA NA +#> sigma 3.13 NA NA NA
print(fit.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 99.59848 NA NA NA NA NA +#> k_parent_sink 0.04792 NA NA NA NA NA +#> k_parent_m1 0.05078 NA NA NA NA NA +#> k_m1_sink 0.00526 NA NA NA NA NA +#> sigma 3.12550 NA NA NA NA NA
# Compare to the version without transforming rate parameters -fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.2.s <- summary(fit.2) -print(fit.2.s$par, 3)
#> Estimate Std. Error Lower Upper -#> parent_0 99.59848 1.57022 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 2.39609 3.85e+00
print(fit.2.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.85e+00
+fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.2.s <- summary(fit.2)
#> Warning: Could not calculate correlation; no covariance matrix
print(fit.2.s$par, 3)
#> Estimate Std. Error Lower Upper +#> parent_0 99.59848 NA NA NA +#> k_parent_sink 0.04792 NA NA NA +#> k_parent_m1 0.05078 NA NA NA +#> k_m1_sink 0.00526 NA NA NA +#> sigma 3.12550 NA NA NA
print(fit.2.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 99.59848 NA NA NA NA NA +#> k_parent_sink 0.04792 NA NA NA NA NA +#> k_parent_m1 0.05078 NA NA NA NA NA +#> k_m1_sink 0.00526 NA NA NA NA NA +#> sigma 3.12550 NA NA NA NA NA
initials <- fit$start$value names(initials) <- rownames(fit$start) transformed <- fit$start_transformed$value @@ -240,18 +238,17 @@ The transformation of sets of formation fractions is fragile, as it supposes parent = list(type = "SFO", to = "m1", sink = TRUE), m1 = list(type = "SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
-fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.ff.s <- summary(fit.ff) -print(fit.ff.s$par, 3)
#> Estimate Std. Error Lower Upper -#> parent_0 99.598 1.5702 96.4038 102.793 -#> log_k_parent -2.316 0.0409 -2.3988 -2.233 -#> log_k_m1 -5.248 0.1332 -5.5184 -4.977 -#> f_parent_ilr_1 0.041 0.0631 -0.0875 0.169 -#> sigma 3.126 0.3585 2.3961 3.855
print(fit.ff.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 -#> k_parent 0.09870 0.00403 24.47 4.96e-23 0.09082 0.1073 -#> k_m1 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> f_parent_to_m1 0.51448 0.02230 23.07 3.10e-22 0.46912 0.5596 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
initials <- c("f_parent_to_m1" = 0.5) +fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.ff.s <- summary(fit.ff)
#> Warning: Could not calculate correlation; no covariance matrix
print(fit.ff.s$par, 3)
#> Estimate Std. Error Lower Upper +#> parent_0 99.598 NA NA NA +#> log_k_parent -2.316 NA NA NA +#> log_k_m1 -5.248 NA NA NA +#> f_parent_ilr_1 0.041 NA NA NA +#> sigma 3.126 NA NA NA
print(fit.ff.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 99.59848 NA NA NA NA NA +#> k_parent 0.09870 NA NA NA NA NA +#> k_m1 0.00526 NA NA NA NA NA +#> f_parent_to_m1 0.51448 NA NA NA NA NA +#> sigma 3.12550 NA NA NA NA NA
initials <- c("f_parent_to_m1" = 0.5) transformed <- transform_odeparms(initials, SFO_SFO.ff) backtransform_odeparms(transformed, SFO_SFO.ff)
#> f_parent_to_m1 #> 0.5
@@ -261,16 +258,15 @@ The transformation of sets of formation fractions is fragile, as it supposes m1 = list(type = "SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
-fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.ff.2.s <- summary(fit.ff.2) -print(fit.ff.2.s$par, 3)
#> Estimate Std. Error Lower Upper -#> parent_0 84.79 3.012 78.67 90.91 -#> log_k_parent -2.76 0.082 -2.92 -2.59 -#> log_k_m1 -4.21 0.123 -4.46 -3.96 -#> sigma 8.22 0.943 6.31 10.14
print(fit.ff.2.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 84.7916 3.01203 28.15 1.92e-25 78.6704 90.913 -#> k_parent 0.0635 0.00521 12.19 2.91e-14 0.0538 0.075 -#> k_m1 0.0148 0.00182 8.13 8.81e-10 0.0115 0.019 -#> sigma 8.2229 0.94323 8.72 1.73e-10 6.3060 10.140
+fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.ff.2.s <- summary(fit.ff.2)
#> Warning: Could not calculate correlation; no covariance matrix
print(fit.ff.2.s$par, 3)
#> Estimate Std. Error Lower Upper +#> parent_0 84.79 NA NA NA +#> log_k_parent -2.76 NA NA NA +#> log_k_m1 -4.21 NA NA NA +#> sigma 8.22 NA NA NA
print(fit.ff.2.s$bpar, 3)
#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 84.7916 NA NA NA NA NA +#> k_parent 0.0635 NA NA NA NA NA +#> k_m1 0.0148 NA NA NA NA NA +#> sigma 8.2229 NA NA NA NA NA