aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-16 09:15:36 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-16 09:15:36 +0100
commit51d63256a7b3020ee11931d61b4db97b9ded02c0 (patch)
treecb6d628211c99cb6dd1938428a18ef4dd5a997dc /man
parent679cf716192cdfd91dfd232578cbd4e30d7eac12 (diff)
We get about 25% performance gain
with the custom lsoda call, avoiding repeated getNativeSymbolInfo calls. It's just that we should not be calling foreign functions from different packages, because the may change without notice. Using getNativeSymbolInfo for "call_lsoda" avoids the CRAN note, and a similar call could probably be used for "unlock_solver", avoiding the NOTE in checks for cran, but we should not do this in a CRAN package.
Diffstat (limited to 'man')
-rw-r--r--man/mkinmod.Rd4
-rw-r--r--man/mkinpredict.Rd21
-rw-r--r--man/saem.Rd10
3 files changed, 19 insertions, 16 deletions
diff --git a/man/mkinmod.Rd b/man/mkinmod.Rd
index 87ce9016..612c3c2b 100644
--- a/man/mkinmod.Rd
+++ b/man/mkinmod.Rd
@@ -58,7 +58,9 @@ applicable to give detailed information about the C function being built.}
\item{dll_dir}{Directory where an DLL object, if generated internally by
\code{\link[inline:cfunction]{inline::cfunction()}}, should be saved. The DLL will only be stored in a
permanent location for use in future sessions, if 'dll_dir' and 'name'
-are specified.}
+are specified. This is helpful if fit objects are cached e.g. by knitr,
+as the cache remains functional across sessions if the DLL is stored in
+a user defined location.}
\item{unload}{If a DLL from the target location in 'dll_dir' is already
loaded, should that be unloaded first?}
diff --git a/man/mkinpredict.Rd b/man/mkinpredict.Rd
index 0797f259..d93c0753 100644
--- a/man/mkinpredict.Rd
+++ b/man/mkinpredict.Rd
@@ -18,9 +18,10 @@ mkinpredict(x, odeparms, odeini, outtimes, ...)
method.ode = "lsoda",
atol = 1e-08,
rtol = 1e-10,
- maxsteps = 20000,
+ maxsteps = 20000L,
map_output = TRUE,
na_stop = TRUE,
+ call_lsoda = NULL,
...
)
@@ -60,23 +61,21 @@ solver is used.}
\item{solution_type}{The method that should be used for producing the
predictions. This should generally be "analytical" if there is only one
observed variable, and usually "deSolve" in the case of several observed
-variables. The third possibility "eigen" is faster but not applicable to
-some models e.g. using FOMC for the parent compound.}
+variables. The third possibility "eigen" is fast in comparison to uncompiled
+ODE models, but not applicable to some models, e.g. using FOMC for the
+parent compound.}
\item{use_compiled}{If set to \code{FALSE}, no compiled version of the
\link{mkinmod} model is used, even if is present.}
\item{method.ode}{The solution method passed via \link{mkinpredict} to \link{ode}] in
-case the solution type is "deSolve". The default "lsoda" is performant, but
-sometimes fails to converge.}
+case the solution type is "deSolve" and we are not using compiled code.}
-\item{atol}{Absolute error tolerance, passed to \link{ode}. Default is 1e-8,
-lower than in \link{lsoda}.}
+\item{atol}{Absolute error tolerance, passed to the ode solver.}
-\item{rtol}{Absolute error tolerance, passed to \link{ode}. Default is 1e-10,
-much lower than in \link{lsoda}.}
+\item{rtol}{Absolute error tolerance, passed to the ode solver.}
-\item{maxsteps}{Maximum number of steps, passed to \link{ode}.}
+\item{maxsteps}{Maximum number of steps, passed to the ode solver.}
\item{map_output}{Boolean to specify if the output should list values for
the observed variables (default) or for all state variables (if set to
@@ -84,6 +83,8 @@ FALSE). Setting this to FALSE has no effect for analytical solutions,
as these always return mapped output.}
\item{na_stop}{Should it be an error if \link{ode} returns NaN values}
+
+\item{call_lsoda}{The address of the compiled function "call_lsoda"}
}
\value{
A matrix with the numeric solution in wide format
diff --git a/man/saem.Rd b/man/saem.Rd
index 11463351..3a5abada 100644
--- a/man/saem.Rd
+++ b/man/saem.Rd
@@ -206,12 +206,12 @@ plot(f_saem_dfop_sfo)
summary(f_saem_dfop_sfo, data = TRUE)
# The following takes about 6 minutes
-#f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
-# control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))
+f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
+ nbiter.saemix = c(200, 80))
-#saemix::compare.saemix(list(
-# f_saem_dfop_sfo$so,
-# f_saem_dfop_sfo_deSolve$so))
+#anova(
+# f_saem_dfop_sfo,
+# f_saem_dfop_sfo_deSolve))
# If the model supports it, we can also use eigenvalue based solutions, which
# take a similar amount of time

Contact - Imprint