aboutsummaryrefslogtreecommitdiff
path: root/R/mkinerrmin.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-10-21 12:11:34 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2019-10-21 12:11:34 +0200
commit7624a2b8398b4ad665a3b0b622488e1893a5ee7c (patch)
tree30e5bc32adc77de6540e68fa80a157f893c7770d /R/mkinerrmin.R
parent8ce251e5ee619a240da2381eda58bc94a554ca37 (diff)
Refactor mkinfit, infrastructure work
mkinfit objects now include an ll() function to calculate the log-likelihood. Part of the code was refactored, hopefully making it easier to read and maintain. IRLS is currently the default algorithm for the error model "obs", for no particular reason. This may be subject to change when I get around to investigate. Slow tests are now in a separate subdirectory and will probably only be run by my own Makefile target. Formatting of test logs is improved. Roundtripping error model parameters works with a precision of 10% when we use lots of replicates in the synthetic data (see slow tests). This is not new in this commit, but as I think it is reasonable this closes #7.
Diffstat (limited to 'R/mkinerrmin.R')
-rw-r--r--R/mkinerrmin.R7
1 files changed, 3 insertions, 4 deletions
diff --git a/R/mkinerrmin.R b/R/mkinerrmin.R
index c0c6fad7..ce4877d2 100644
--- a/R/mkinerrmin.R
+++ b/R/mkinerrmin.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2014 Johannes Ranke
+# Copyright (C) 2010-2019 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package mkin
@@ -62,9 +62,8 @@ mkinerrmin <- function(fit, alpha = 0.05)
n.k.optim <- n.k.optim + length(grep(paste("^log_k", obs_var, sep="_"),
names(parms.optim)))
n.k__iore.optim <- length(grep(paste("^k__iore", obs_var, sep="_"), names(parms.optim)))
- n.k__iore.optim <- n.k__iore.optim + length(grep(paste("^log_k__iore", obs_var,
- sep = "_"),
- names(parms.optim)))
+ n.k__iore.optim <- n.k__iore.optim + length(grep(paste("^log_k__iore",
+ obs_var, sep = "_"), names(parms.optim)))
n.N.optim <- length(grep(paste("^N", obs_var, sep="_"), names(parms.optim)))

Contact - Imprint