diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2014-05-20 08:36:42 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2014-05-20 09:50:33 +0200 |
commit | 4110808d1953b8704ef48d0dc5b5e445cbde9af0 (patch) | |
tree | 72b3fb574fecc0494baadf48cea71de2ea5a5b8a /R | |
parent | 9a594513914874eac093046678f0e7a5ab640871 (diff) |
Step back regarding confidence intervals of formation fractions
- Don't give confidence intervals for formation fractions that belong
to a set, only for single formation fractions
- Update the vignette with history and background
- Correct 'isotropic' into 'isometric' in the ilr documentation, the
README and the comments in transform_odeparms
- Candidate for release to CRAN
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinfit.R | 18 | ||||
-rw-r--r-- | R/transform_odeparms.R | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R index ab1977d1..612e43d2 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -364,15 +364,27 @@ summary.mkinfit <- function(object, data = TRUE, distimes = TRUE, alpha = 0.05, "t value", "Pr(>|t|)", "Pr(>t)"))
blci <- buci <- numeric()
- # Only transform boundaries of CI for one parameter at a time
+ # Transform boundaries of CI for one parameter at a time,
+ # with the exception of sets of formation fractions (single fractions are OK).
+ f_names_skip <- character(0)
+ for (box in mod_vars) { # Figure out sets of fractions to skip
+ f_names <- grep(paste("^f", box, sep = "_"), pnames, value = TRUE)
+ n_paths <- length(f_names)
+ if (n_paths > 1) f_names_skip <- c(f_names_skip, f_names)
+ }
+
for (pname in pnames) {
par.lower <- par.upper <- object$par
par.lower[pname] <- param[pname, "Lower"]
par.upper[pname] <- param[pname, "Upper"]
- blci[pname] <- backtransform_odeparms(par.lower, mod_vars,
+ if (!pname %in% f_names_skip) {
+ blci[pname] <- backtransform_odeparms(par.lower, mod_vars,
object$transform_rates, object$transform_fractions)[pname]
- buci[pname] <- backtransform_odeparms(par.upper, mod_vars,
+ buci[pname] <- backtransform_odeparms(par.upper, mod_vars,
object$transform_rates, object$transform_fractions)[pname]
+ } else {
+ blci[pname] <- buci[pname] <- NA
+ }
}
bparam <- cbind(object$bparms.optim, blci, buci)
dimnames(bparam) <- list(pnames, c("Estimate", "Lower", "Upper"))
diff --git a/R/transform_odeparms.R b/R/transform_odeparms.R index a0c302f5..2438151b 100644 --- a/R/transform_odeparms.R +++ b/R/transform_odeparms.R @@ -30,7 +30,7 @@ transform_odeparms <- function(parms, mod_vars, else transparms[index_k] <- parms[index_k]
}
- # Go through state variables and apply isotropic logratio transformation if requested
+ # Go through state variables and apply isometric logratio transformation if requested
for (box in mod_vars) {
indices_f <- grep(paste("^f", box, sep = "_"), names(parms))
f_names <- grep(paste("^f", box, sep = "_"), names(parms), value = TRUE)
@@ -73,7 +73,7 @@ backtransform_odeparms <- function(transparms, mod_vars, else parms[index_k] <- transparms[index_k]
}
- # Go through state variables and apply inverse isotropic logratio transformation
+ # Go through state variables and apply inverse isometric logratio transformation
for (box in mod_vars) {
indices_f <- grep(paste("^f", box, sep = "_"), names(transparms))
f_names <- grep(paste("^f", box, sep = "_"), names(transparms), value = TRUE)
|