aboutsummaryrefslogtreecommitdiff
path: root/man/mkinfit.Rd
diff options
context:
space:
mode:
Diffstat (limited to 'man/mkinfit.Rd')
-rw-r--r--man/mkinfit.Rd30
1 files changed, 26 insertions, 4 deletions
diff --git a/man/mkinfit.Rd b/man/mkinfit.Rd
index 9c82f5ff..801f540c 100644
--- a/man/mkinfit.Rd
+++ b/man/mkinfit.Rd
@@ -21,8 +21,9 @@ mkinfit(mkinmod, observed,
parms.ini = "auto",
state.ini = "auto",
fixed_parms = NULL, fixed_initials = names(mkinmod$diffs)[-1],
- solution_type = "auto",
+ solution_type = c("auto", "analytical", "eigen", "deSolve"),
method.ode = "lsoda",
+ use_compiled = "auto",
method.modFit = c("Port", "Marq", "SANN", "Nelder-Mead", "BFGS", "CG", "L-BFGS-B"),
maxit.modFit = "auto",
control.modFit = list(),
@@ -102,6 +103,11 @@ mkinfit(mkinmod, observed,
\code{\link{ode}} in case the solution type is "deSolve". The default
"lsoda" is performant, but sometimes fails to converge.
}
+ \item{use_compiled}{
+ If set to \code{FALSE}, no compiled version of the \code{\link{mkinmod}}
+ model is used, in the calls to \code{\link{mkinpredict}} even if
+ a compiled verion is present.
+ }
\item{method.modFit}{
The optimisation method passed to \code{\link{modFit}}.
@@ -235,8 +241,22 @@ SFO_SFO <- mkinmod(
parent = list(type = "SFO", to = "m1", sink = TRUE),
m1 = list(type = "SFO"))
# Fit the model to the FOCUS example dataset D using defaults
-fit <- mkinfit(SFO_SFO, FOCUS_2006_D)
-summary(fit)
+system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D,
+ solution_type = "eigen"))
+system.time(fit.deSolve <- mkinfit(SFO_SFO, FOCUS_2006_D,
+ solution_type = "deSolve", use_compiled = FALSE))
+system.time(fit.deSolve.compiled <- mkinfit(SFO_SFO, FOCUS_2006_D,
+ solution_type = "deSolve", use_compiled = TRUE))
+# The performance benefit of using the compiled version is immense compared
+# with deSolve without compilation, and about a factor of two compared with the
+# eigenvalue based solution
+coef(fit)
+coef(fit.deSolve)
+coef(fit.deSolve.compiled)
+endpoints(fit)
+endpoints(fit.deSolve)
+# Check compiled model versions against other solutions
+
# Use stepwise fitting, using optimised parameters from parent only fit, FOMC
\dontrun{
@@ -258,10 +278,10 @@ SFORB_SFO <- mkinmod(
m1 = list(type = "SFO"))
# Fit the model to the FOCUS example dataset D using defaults
fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D)
+fit.SFORB_SFO.deSolve <- mkinfit(SFORB_SFO, FOCUS_2006_D, solution_type = "deSolve")
# Use starting parameters from parent only SFORB fit (not really needed in this case)
fit.SFORB = mkinfit(SFORB, FOCUS_2006_D)
fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode)
-}
# Weighted fits, including IRLS
SFO_SFO.ff <- mkinmod(parent = list(type = "SFO", to = "m1"),
@@ -275,6 +295,7 @@ summary(f.w.mean)
f.w.mean.irls <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, weight = "mean",
reweight.method = "obs")
summary(f.w.mean.irls)
+}
\dontrun{
# Manual weighting
@@ -287,6 +308,7 @@ f.w.man.irls <- mkinfit(SFO_SFO.ff, dw, err = "err.man",
reweight.method = "obs")
summary(f.w.man.irls)
}
+
}
\keyword{ models }
\keyword{ optimize }

Contact - Imprint