diff options
author | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2013-10-17 13:24:42 +0000 |
---|---|---|
committer | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2013-10-17 13:24:42 +0000 |
commit | ca1420000183be00ede5333ad9a34e5a9d703953 (patch) | |
tree | 5a089e83652c017f9021ae1a82cf164dc9930cfc | |
parent | 0e352cae56c006a5636a1aaf3b40e2eee2c1c941 (diff) |
- 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | R/mkinfit.R | 2 |
2 files changed, 4 insertions, 3 deletions
@@ -1,8 +1,9 @@ -2013-10-17 Johannes Ranke <jranke@stiller> for mkin (0.9-22)
+2013-10-17 Johannes Ranke <jranke@uni-bremen.de> for mkin (0.9-22)
* Fix plot.mkinfit as it passed graphical arguments like main to the solver
* Do not use plot=TRUE in mkinfit example
* The first successful fits in the not so simple GUI
+ * Fix iteratively reweighted least squares for the case of many metabolites
2013-10-16 Johannes Ranke<jranke@uni-bremen.de> for mkin (0.9-22)
@@ -16,7 +17,7 @@ * Implement IRLS assuming different variances for observed variables
-2013-10-09 Johannes Ranke <jranke@uni-bremen.de> for mkin (0.9-22)
+2013-10-09 Johannes Ranke for version (0.9-22)
* Do not use 0 values at time zero for chi2 error level calculations.
This is the way it is done in KinGUII and it makes sense
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)
|