TapeR_FIT_LME.f {TapeR}R 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

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")

[Package TapeR version 0.5.3 Index]