R/taper_kozak.94.R

Defines functions taper_kozak.94

Documented in taper_kozak.94

#' Kozak (1994) Taper Function.
#'
#' @param dbh tree diameter at breast height, in centimeters.
#' @param h total tree height, in meters.
#' @param hih ratio between the height of the section (hi) and the total height (h).
#' @param b0,b1,b2,b3,b4,b5,b6,b7,b8,b9 model parameters.
#' @param p numerical value representing the first inflection point calculated in the segmented model of Max and Burkhart (1976).
#'
#' @return a numeric value indicating the diameter at the section.
#'
#' @references
#' Kozak, A. (1994). Development of taper equations by BEC zones and species. Report to the Resources Inventory Branch, B.C. Ministry of Forests. Sept. 1994.
#' Kozak, A. (1997). Effects of multicollinearity and autocorrelation on the variable-exponent taper functions. Canadian Journal of Forest Research, Ottawa, v. 27, n. 5, p. 619-629, 1997.
#'
#' @examples
#'
#' library(dplyr)
#' library(minpack.lm)
#' library(timbeR)
#'
#' tree_scaling <- tree_scaling %>%
#' mutate(did = di/dbh,
#'        hih = hi/h)
#'
#' kozak.94 <-  nlsLM(di ~ taper_kozak.94(dbh, h, hih, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, p),
#' data=tree_scaling,
#' start=list(b0=1.5,b1=1.5,b2=1,b3=-10,b4=50,b5=-10,b6=34,b7=10,b8=-1,b9=-0.01, p = .1))
#'
#' @export
taper_kozak.94 <- function(dbh, h, hih, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, p){
  b0*(dbh**b1)*(b2**dbh)*((1-(hih)^0.5)/(1-p^0.5))^(b3+b4*(hih)^(1/4)+b5*((hih))^(1/3)+b6*((hih)^0.5)+b7*asin(1-(hih)^0.5)+b8*(1/((dbh/h)+1))+b9*h)
}
sergiocostafh/timbeR documentation built on Feb. 13, 2025, 8:01 p.m.