R/create_deg_func.R
create_deg_func.Rd
Create degradation functions for known analytical solutions
create_deg_func(spec, use_of_ff = c("min", "max"))
spec | List of model specifications as contained in mkinmod objects |
---|---|
use_of_ff | Minimum or maximum use of formation fractions |
Degradation function to be attached to mkinmod objects
#>FOCUS_D <- subset(FOCUS_2006_D, value != 0) # to avoid warnings fit_1 <- mkinfit(SFO_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE)#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165# \dontrun{ if (require(rbenchmark)) benchmark( analytical = mkinfit(SFO_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE), deSolve = mkinfit(SFO_SFO, FOCUS_D, solution_type = "deSolve", quiet = TRUE), replications = 2)#>#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165#> test replications elapsed relative user.self sys.self user.child #> 1 analytical 2 0.423 1.000 0.423 0 0 #> 2 deSolve 2 0.716 1.693 0.715 0 0 #> sys.child #> 1 0 #> 2 0#>benchmark( analytical = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE), deSolve = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "deSolve", quiet = TRUE), replications = 2)#> test replications elapsed relative user.self sys.self user.child #> 1 analytical 2 0.910 1.000 0.909 0 0 #> 2 deSolve 2 1.734 1.905 1.733 0 0 #> sys.child #> 1 0 #> 2 0# }