TapeR_FIT_LME.f: Fits a taper curve model to the specified diameter-height...

View source: R/TapeR_FIT_LME.f.R

TapeR_FIT_LME.fR Documentation

Fits a taper curve model to the specified diameter-height data

Description

Fits a taper curve model with random effects on tree-level based on B-Splines to the specified diameter-height data. Number and position of nodes and order of B-Splines can be specified.

Usage

TapeR_FIT_LME.f(
  Id,
  x,
  y,
  knt_x,
  ord_x,
  knt_z,
  ord_z,
  IdKOVb = "pdSymm",
  control = list(),
  ...
)

Arguments

Id

Vector of tree identifiers of same length as diameter and height measurements.

x

Numeric vector of height measurements (explanatory variables) along the stem relative to the tree height.

y

Numeric vector of diameter measurements (response) along the stem (in centimeters).

knt_x

Numeric vector of relative knot positions for fixed effects.

ord_x

Numeric scalar. Order of fixed effects Spline (4=cubic).

knt_z

Numeric vector of relative knot positions for random effects.

ord_z

Numeric scalar. Order of random effects Spline (4=cubic).

IdKOVb

Character string. Type of covariance matrix used by lme. Only "pdSymm" makes sense. Rather reduce number of knots if function does not converge.

control

a list of control values for the estimation algorithm to replace the default values returned by the function lmeControl. Defaults to an empty list.

...

not currently used

Details

If too few trees are given, the linear mixed model (lme) will not converge. See examples for a suggestion of node positions.

The variance parameters theta are stored in the natural parametrization (Pinheiro and Bates (2004), p. 93). This means log for variances and logit for covariances. theta is the vectorized triangle of the random effects covariance matrix + the residual variance (lSigma). Given there are 2 inner knots for random effects, the structure will be c(sig^2_b1, sig_b1 sig_b2, sig_b1 sig_b3, sig_b1 sig_b4, sig^2_b2,...,sig^2_b4, lSigma)

Value

List of model properties

  • fit.lmeSummary of the fitted lme model.

  • par.lmeList of model parameters (e.g., coefficients and variance-covariance matrices) needed for volume estimation and other functions in this package. Components of the par.lme list

    • knt_xRelative positions of the fixed effects Spline knots along the stem.

    • pad_knt_xPadded version of knt_x, as used to define B-Spline design matrix.

    • ord_xOrder of the spline.

    • knt_zRelative positions of the random effects Spline knots along the stem.

    • pad_knt_zPadded version of knt_z, as used to define B-Spline design matrix.

    • ord_zOrder of the spline.

    • b_fixFixed-effects spline coefficients.

    • KOVb_fixCovariance of fixed-effects.

    • sig2_epsResidual variance.

    • dfResResidual degrees of freedom.

    • KOVb_rndCovariance of random effects.

    • thetaVariance parameters in natural parametrization. See Details.

    • KOV_thetaApproximate asymptotic covariance matrix of variance parameters.

Author(s)

Edgar Kublin

References

Kublin, E., Breidenbach, J., Kaendler, G. (2013) A flexible stem taper and volume prediction method based on mixed-effects B-spline regression, Eur J For Res, 132:983-997.

See Also

E_DHx_HmDm_HT.f, E_DHx_HmDm_HT_CIdHt.f, E_HDx_HmDm_HT.f, E_VOL_AB_HmDm_HT.f

Examples

# load example data
data(DxHx.df)

# prepare the data (could be defined in the function directly)
Id = DxHx.df[,"Id"]
x = DxHx.df[,"Hx"]/DxHx.df[,"Ht"]#calculate relative heights
y = DxHx.df[,"Dx"]

# define the relative knot positions and order of splines
knt_x = c(0.0, 0.1, 0.75, 1.0);	ord_x = 4 # B-Spline knots: fix effects; order (cubic = 4)
knt_z = c(0.0, 0.1       ,1.0); ord_z = 4 # B-Spline knots: rnd effects

# fit the model
taper.model <- TapeR_FIT_LME.f(Id, x, y, knt_x, ord_x, knt_z, ord_z,
                               IdKOVb = "pdSymm")

## save model parameters for documentation or dissimination
## parameters can be load()-ed and used to predict the taper
## or volume using one or several measured dbh
#spruce.taper.pars <- taper.model$par.lme
#save(spruce.taper.pars, file="spruce.taper.pars.rdata")

TapeR documentation built on Aug. 16, 2023, 9:07 a.m.