aboutsummaryrefslogtreecommitdiff
path: root/man/memkin.Rd
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-03-30 14:03:51 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-03-30 14:03:51 +0200
commit405cde11f9f26fcab0742e84c110cf3dcb2a4c1f (patch)
treec00c880d74676581fcbaa2d9aa7fb4c739f79b18 /man/memkin.Rd
parent6263a53ef24ff0c06e5f4a869a987f41f361bc58 (diff)
First nlme fits for models with a metabolite
Diffstat (limited to 'man/memkin.Rd')
-rw-r--r--man/memkin.Rd72
1 files changed, 72 insertions, 0 deletions
diff --git a/man/memkin.Rd b/man/memkin.Rd
new file mode 100644
index 00000000..cda9b468
--- /dev/null
+++ b/man/memkin.Rd
@@ -0,0 +1,72 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/memkin.R
+\name{memkin}
+\alias{memkin}
+\title{Estimation of parameter distributions from mmkin row objects}
+\usage{
+memkin(object, ...)
+}
+\arguments{
+\item{object}{An mmkin row object containing several fits of the same model to different datasets}
+
+\item{...}{Additional arguments passed to \code{\link{nlme}}}
+}
+\value{
+A fitted object of class 'memkin'
+}
+\description{
+This function sets up and attempts to fit a mixed effects model to
+an mmkin row object which is essentially a list of mkinfit objects
+that have been obtained by fitting the same model to a list of
+datasets.
+}
+\examples{
+sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
+m_SFO <- mkinmod(parent = mkinsub("SFO"))
+d_SFO_1 <- mkinpredict(m_SFO,
+ c(k_parent_sink = 0.1),
+ c(parent = 98), sampling_times)
+d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
+d_SFO_2 <- mkinpredict(m_SFO,
+ c(k_parent_sink = 0.05),
+ c(parent = 102), sampling_times)
+d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
+d_SFO_3 <- mkinpredict(m_SFO,
+ c(k_parent_sink = 0.02),
+ c(parent = 103), sampling_times)
+d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
+
+d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
+d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
+d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
+ds <- c(d1 = d1, d2 = d2, d3 = d3)
+
+f <- mmkin("SFO", ds)
+x <- memkin(f)
+summary(x)
+
+ds_2 <- lapply(experimental_data_for_UBA_2019[6:10],
+ function(x) x$data[c("name", "time", "value")])
+m_sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"),
+ A1 = mkinsub("SFO"), use_of_ff = "min")
+m_sfo_sfo_ff <- mkinmod(parent = mkinsub("SFO", "A1"),
+ A1 = mkinsub("SFO"), use_of_ff = "max")
+m_fomc_sfo <- mkinmod(parent = mkinsub("FOMC", "A1"),
+ A1 = mkinsub("SFO"))
+m_dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
+ A1 = mkinsub("SFO"))
+
+f_2 <- mmkin(list("SFO-SFO" = m_sfo_sfo,
+ "SFO-SFO-ff" = m_sfo_sfo_ff,
+ "FOMC-SFO" = m_fomc_sfo,
+ "DFOP-SFO" = m_dfop_sfo),
+ ds_2)
+
+f_nlme_sfo_sfo <- memkin(f_2[1, ])
+\dontrun{f_nlme_sfo_sfo_ff <- memkin(f_2[2, ])} # does not converge with maxIter = 50
+f_nlme_fomc_sfo <- memkin(f_2[3, ])
+\dontrun{f_nlme_dfop_sfo <- memkin(f_2[4, ]) # apparently underdetermined}
+anova(f_nlme_sfo_sfo, f_nlme_fomc_sfo)
+# The FOMC variant has a lower AIC and has significantly higher likelihood
+update(f_nlme_fomc_sfo)
+}

Contact - Imprint