fithd | R Documentation |
nlme
.
Fits either linear or nonlinear Height-Diameter (H-D) model into a dataset of tree heights and diameters. Possible hierarchy of the data can be taken into account through random effects. Several commonly used nonlinear two-parameter H-D functions are available. Linear functions can be used as well.
fithd(d, h, plot=c(), modelName="naslund", nranp=2, random=NA, varf=0, na.omit=TRUE, start=NA, bh=1.3, control = list(), SubModels=NA, vfstart=0)
d |
A numerical vector of tree diameters, usually given in cm. |
h |
A numerical vector of tree heights, usually given in meters. Should be of the same length as |
plot |
A vctor of type |
modelName |
Either (i) a character vector specifying the name of the nonlinear function or (ii) the formula specifying
a linear model.
In case (i) the name should be one of the functions documented on the help page of |
nranp, random |
Parameters nranp and random specify two alternative ways to specify the random effects of the model. An easy but restricted way
is to use argument
In the case of linear model, the constant (if exists) it always counted as the first term. As an alternative to nranp, argument |
varf |
Numeric with values 0, 1 or 2. If 0 or FALSE, no variance function is used. If varf=1, 2 or TRUE, then the power- type variance function var(e)=sigma^2*w^(2*delta) is used. where weight w is the raw diameter (when varf=1 or TRUE), or w=max(1,dsd+3) (when varf=2), where dsd=(d-D)/SDD. Here d is tree diameter, D and SDD are the mean and standard deviation of diameters on the plot in question. |
na.omit |
Should missing heights be omitted. Defaults to |
start |
A vector of the starting values of the parameters of the nlme fit.
If NA, then the starting values are computed using
the function computing the starting values (e.g., startHDnaslund, see |
bh |
The applied breast height. Defaults to 1.3 (meters). |
control |
Parameters to control of the model fitting algorithm, see |
SubModels |
Implemented only for nonlinear models. A character vector of length 2 or 3,
according to the number of parameters in the model. It allows submodels for parameters a, b (and c), where
the parameter is explaiend by plot-specific mean diameter ("~dmean"), plot-specific standard deviation "~dsd",
or diameter standardized at plot level ("~dstd"), when the predictor is (d-D)/SDD (see teh documentation of argument varf).
Defaults to NA, which corresponds to no submodels, or |
vfstart |
Starting value of the power parameter delta of the variance function. Defaults to 0. |
Depending on the model (nonlinear or linear, mixed-effects model or marginal), the the model is
fitted using one of the following functions functions of the nlme
package:
nlme
, lme
, gls
or gnls
.
See available H-D functions at HDmodels
. The user can define her own new functions
as specified at HDmodels
.
An object of class hdmod
, inheriting from class nlme
.
Lauri Mehtatalo <lauri.mehtatalo@uef.fi>
Mehtatalo, L., Gregoire, T.G., and de Miguel, S. Modeling Height-diameter curves for height prediction. Canadian Journal of Forest Research, 45(7): 826-837, doi: 10.1139/cjfr-2015-0054
HDmodels
for the available functions, Functions nlme
,
lme
, gls
or gnls
for details on model fitting,
ImputeHeights
for imputing unobserved tree heights.
data(spati) fithd(spati$d,spati$h,spati$plot) fithd(spati$d,spati$h,spati$plot,SubModels=c("dmean","log(dmean)"),varf=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.