From 0b98c459c30a0629a728acf6b311de035c55fb64 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 18 Jul 2018 15:18:30 +0200 Subject: Correct references to the Rocke and Lorenzato model Rename 'sigma_rl' to 'sigma_twocomp' as the Rocke and Lorenzato model assumes lognormal distribution for large y. Rebuild static documentation. --- R/mkinfit.R | 6 +++--- R/sigma_rl.R | 3 --- R/sigma_twocomp.R | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 R/sigma_rl.R create mode 100644 R/sigma_twocomp.R (limited to 'R') diff --git a/R/mkinfit.R b/R/mkinfit.R index 840faf53..92b455f7 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -259,7 +259,7 @@ mkinfit <- function(mkinmod, observed, weight.ini <- weight <- match.arg(weight) if (weight.ini == "tc") { - observed$err = sigma_rl(observed$value, tc["sigma_low"], tc["rsd_high"]) + observed$err = sigma_twocomp(observed$value, tc["sigma_low"], tc["rsd_high"]) err <- "err" } else { if (!is.null(err)) weight.ini = "manual" @@ -415,7 +415,7 @@ mkinfit <- function(mkinmod, observed, # We need unweighted residuals to update the weighting cost_tmp <- cost(fit$par) - tc_fit <- nls(abs(res.unweighted) ~ sigma_rl(obs, sigma_low, rsd_high), + tc_fit <- nls(abs(res.unweighted) ~ sigma_twocomp(obs, sigma_low, rsd_high), start = list(sigma_low = tc["sigma_low"], rsd_high = tc["rsd_high"]), data = cost_tmp$residuals, algorithm = "port") @@ -453,7 +453,7 @@ mkinfit <- function(mkinmod, observed, if (reweight.method == "tc") { cost_tmp <- cost(fit$par) - tc_fit <- nls(abs(res.unweighted) ~ sigma_rl(obs, sigma_low, rsd_high), + tc_fit <- nls(abs(res.unweighted) ~ sigma_twocomp(obs, sigma_low, rsd_high), start = as.list(tc_fitted), data = cost_tmp$residuals, algorithm = "port") diff --git a/R/sigma_rl.R b/R/sigma_rl.R deleted file mode 100644 index 2b921d29..00000000 --- a/R/sigma_rl.R +++ /dev/null @@ -1,3 +0,0 @@ - sigma_rl <- function(y, sigma_low, rsd_high) { - sqrt(sigma_low^2 + y^2 * rsd_high^2) - } diff --git a/R/sigma_twocomp.R b/R/sigma_twocomp.R new file mode 100644 index 00000000..b06816c1 --- /dev/null +++ b/R/sigma_twocomp.R @@ -0,0 +1,3 @@ + sigma_twocomp <- function(y, sigma_low, rsd_high) { + sqrt(sigma_low^2 + y^2 * rsd_high^2) + } -- cgit v1.2.1