diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2018-07-18 15:18:30 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2018-07-18 15:58:46 +0200 |
commit | 0b98c459c30a0629a728acf6b311de035c55fb64 (patch) | |
tree | f146faf4802da38862aa14b0268265f3fad9ba34 /R | |
parent | d3ed95f2a0a43ed74b02ea90e35d043ed4e1e72f (diff) |
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.
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinfit.R | 6 | ||||
-rw-r--r-- | R/sigma_rl.R | 3 | ||||
-rw-r--r-- | R/sigma_twocomp.R | 3 |
3 files changed, 6 insertions, 6 deletions
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) + } |