fit_taper_Kozak: Fit taper equation to QSM

View source: R/traits_from_qsm.R

fit_taper_KozakR Documentation

Fit taper equation to QSM

Description

This function fits a taper equation to trunk sections of a QSM using Kozak the Model (2002, 2007).

Usage

fit_taper_Kozak(
  qsm,
  dbh,
  terminus_diam_cm = 4,
  segment_size = 0.25,
  plot = TRUE
)

Arguments

qsm

a QSM loaded using '[load_qsm()]'.

dbh

numeric – required to fit Kozak model, not calculated from QSM, so as not to conflict with other more accurate means of measurement e.g., ‘get_DBH’

terminus_diam_cm

numeric – the trunk diameter at which is no longer considered trunk

segment_size

numeric – the length of segments that QSM cylinders are grouped into

plot

boolean – indicates whether model output should be plotted. Plots are found in the output list as object$plot, regardless of this setting.

Details

$ d(h)/D = a0 (h/H) + a1 (h/H) + a2 (h/H)^2 + a3 (h/H)^3 $

The function groups QSM cylinders into segments of 'segment_size' up to 'terminus_diam' which is the maximum diameter at which the taper equation ends.

Value

A list with components:

data

Tibble of trunk segment heights and observed diameters used in model fitting.

plot

A 'ggplot2' object showing observed diameters and fitted taper curve.

results

Data frame containing fitted Kozak parameters ('a0'–'a3'), coefficient of determination ('r2'), and root mean squared error ('rmse').

Examples

qsm_file = system.file("extdata", "tree_0744_qsm.txt", package='tReeTraits')
qsm = load_qsm(qsm_file)
fit_taper_Kozak(qsm, dbh = 13.8)

tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.