diff options
author | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2013-10-16 15:18:14 +0000 |
---|---|---|
committer | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2013-10-16 15:18:14 +0000 |
commit | ebf00aeb389424b09be4a1051044291b01555153 (patch) | |
tree | ccd63de4f9afbb2012d2c24fb0a06836c1d555f0 /R | |
parent | b85eb94988f28eb2a096c377470f39e752e466d0 (diff) |
- More consistent output regarding optimised and fixed parameters (see ChangeLog)
- Switch from gcanvas to gsvg
- Start setting up the fits in the GUI
- add files for testing gWidgetsWWW2 functionality
git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@115 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinfit.R | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R index b46184b7..70ca9c0e 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -89,11 +89,16 @@ mkinfit <- function(mkinmod, observed, state.ini.fixed <- state.ini[fixed_initials]
state.ini.optim <- state.ini[setdiff(names(state.ini), fixed_initials)]
- # Preserve names of state variables before renaming initial state variable parameters
+ # Preserve names of state variables before renaming initial state variable
+ # parameters
state.ini.optim.boxnames <- names(state.ini.optim)
+ state.ini.fixed.boxnames <- names(state.ini.fixed)
if(length(state.ini.optim) > 0) {
names(state.ini.optim) <- paste(names(state.ini.optim), "0", sep="_")
}
+ if(length(state.ini.fixed) > 0) {
+ names(state.ini.fixed) <- paste(names(state.ini.fixed), "0", sep="_")
+ }
# Decide if the solution of the model can be based on a simple analytical
# formula, the spectral decomposition of the matrix (fundamental system)
@@ -138,8 +143,8 @@ mkinfit <- function(mkinmod, observed, if(length(state.ini.optim) > 0) {
odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed)
- names(odeini) <- c(state.ini.optim.boxnames, names(state.ini.fixed))
- } else odeini <- state.ini.fixed
+ names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+ } else odeini <- state.ini.fixed.boxnames
odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], parms.fixed)
@@ -235,7 +240,7 @@ mkinfit <- function(mkinmod, observed, fit$predicted <- mkin_wide_to_long(out_predicted, time = "time")
# Collect initial parameter values in two dataframes
- fit$start <- data.frame(initial = c(state.ini.optim,
+ fit$start <- data.frame(value = c(state.ini.optim,
backtransform_odeparms(parms.optim, mod_vars)))
fit$start$type = c(rep("state", length(state.ini.optim)),
rep("deparm", length(parms.optim)))
|