diff options
author | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2012-03-27 01:03:18 +0000 |
---|---|---|
committer | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2012-03-27 01:03:18 +0000 |
commit | fff1fc581da5b4ff935ebd4d7ded02f750472fdc (patch) | |
tree | a18da58a5bfd013c1bd35bbc7828925084a13a76 /R/mkinstart.R | |
parent | 1718d434efae26de02754c6622c43f4dc9e624b9 (diff) |
Start of the transition to fitting transformed parameters.
Many things are broken now (see TODO list)
git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@20 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Diffstat (limited to 'R/mkinstart.R')
-rw-r--r-- | R/mkinstart.R | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/R/mkinstart.R b/R/mkinstart.R deleted file mode 100644 index 46e5bed..0000000 --- a/R/mkinstart.R +++ /dev/null @@ -1,23 +0,0 @@ -mkinstart <- function(model, data, mode = "auto")
-{
- if (class(model) != "mkinmod") stop("The first argument must be a model of class mkinmod")
- names <- model$parms
- observed <- names(model$map)
- if(!all(observed %in% levels(data$name))) stop("The data must contain the observed variables used in the model")
- for (obs in observed)
- {
- tmp <- subset(data, name == obs)
- max <- tmp[which.max(tmp$value), ]
- type = names(model$map[[obs]])[[1]]
- kinmodel <- ifelse(type == "SFORB", "DFOP", type)
- tmp.longdata <- subset(data, name == obs & time >= max$time)
- tmp.widedata <- mkin_long_to_wide(tmp.longdata, outtime = "t")
- names(tmp.widedata) <- c("t", "parent")
- tmp.fit <- kinfit(
- kindata = tmp.widedata,
- kinmodels = kinmodel,
- parent.0.user = max$value)
- if(class(tmp.fit[[kinmodel]]) == "try-error") stop(paste("Automatic generation of starting parameters failed\nkinfit failed to find a", kinmodel, "fit for", obs))
- tmp.results <- kinresults(tmp.fit)
- }
-}
|