tests/testthat/test-AnalyticalDerivs.R

context("Analytical Derivs")

expect_silent({
    # attach gradient and hessian analytical function to curve fitting functions
    .dls <- lapply(
        c("doubleLog.Beck", "doubleLog.Elmore", "doubleLog.Gu",
          "doubleLog.Klos", "doubleLog.Zhang", "doubleLog.AG"),
        function (FUN){
            # FUN <- deparse(substitute(fun))
            fun <- get(FUN)
            attr(fun, 'gradient') <- gradf_t(fun) # gradient
            attr(fun, 'hessian')  <- hessf_t(fun) # hessian
            # print(environment(fun))
            # print(fun)
            # print(FUN)
            # assign(FUN, fun, envir = environment(fun)) #environment("namespace:phenofit"))#
            fun
        })
})

Try the phenofit package in your browser

Any scripts or data that you put into this service are public.

phenofit documentation built on Feb. 16, 2023, 6:21 p.m.