From ca1420000183be00ede5333ad9a34e5a9d703953 Mon Sep 17 00:00:00 2001 From: jranke Date: Thu, 17 Oct 2013 13:24:42 +0000 Subject: - Fix reweighting for the case of many metabolites git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@118 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/mkinfit.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'R') diff --git a/R/mkinfit.R b/R/mkinfit.R index 70ca9c0..83ac087 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -215,7 +215,7 @@ mkinfit <- function(mkinmod, observed, while (reweight.diff > reweight.tol & n.iter < reweight.max.iter) { n.iter <- n.iter + 1 sigma.old <- sqrt(fit$var_ms_unweighted) - observed[err] <- sqrt(fit$var_ms_unweighted)[observed$name] + observed[err] <- sqrt(fit$var_ms_unweighted)[as.character(observed$name)] fit <- modFit(cost, fit$par, method = method.modFit, control = control.modFit, ...) reweight.diff = sum((sqrt(fit$var_ms_unweighted) - sigma.old)^2) -- cgit v1.2.1