volvff {lmfor} | R Documentation |
The Variable Form-Factor Volume Model
Description
An R-function for the variable form-factor volume model and a function for computing bias-corrected volumes augmented with parameter uncertainty from a model fitted using nlme.
Usage
volvff(dbh,h,theta=NA,logita=NA,lambda=NA)
predvff(data,mod,p=0.05,varMethod="taylor",biasCorr="none",nrep=500)
Arguments
dbh |
vector of individual tree diameters, cm |
h |
vector of individual tree heights (m), of same length as |
theta , logita , lambda |
The parameters |
data |
A data set including variables |
mod |
A variable form-factor model fitted using |
p |
The probability used in constructiong the confidence intervals for
tree-level volumes and total volume.
Symmetric |
varMethod |
Either |
biasCorr |
Either |
nrep |
The number of replicates in the Monte Carlo simulation when
|
Details
The variance-form-factor function is of form
where is the logit-transformed form factor and
is the stem radius at stump height, which is approximated using
where the weight is taken from the right tail of the logit transformation
Parameter uncertainty is reported because the same realized errors are used always when a model based on certain model fitting data is used; therefore those errors behave in practice like bias. Variance for total volume is computed as sum of all elements of the variance-covariance matrix of prediction errors of the mean.
Value
Function volvff
returns a vector of tree volumes (in liters) that is of same length as
vector dbh
. In addition, attribute grad
returns the Jacobian, which is used
in nlme fitting for computing the derivatives of the model with respect to parameters,
and in approximating the parameter uncertainty when varMethod="taylor"
.
Function predvff
returns a list with following objects
totvol |
Total volume of the trees of |
totvolvar |
The estimated variance of |
totvolci |
The estimated |
And attributes
trees |
A data frame of including tree-level volumes, their variance and 95% confidence intervals. |
varmu |
The variance-covariance matrix of prediction errors, taking into account theparameter uncertainty. |
Author(s)
Lauri Mehtatalo <lauri.mehtatalo@luke.fi>
References
Kangas A., Pitkanen T., Mehtatalo L., Heikkinen J. (xxxx) Mixed linear and non-linear tree volume models with regionally varying parameters
Examples
## Not run:
library(lmfor)
data(treevol)
treevol$formfactor<-treevol$v/volvff(treevol$dbh,treevol$h,logita=100,lambda=log(0.2))
treevol$logitff<-log((treevol$formfactor)/(1-(treevol$formfactor)))
ptrees<-treevol[treevol$species=="pine",]
mod.init<-lm(logitff~I(1/h)+h+dbh+I(h*dbh)+I(1/(h*dbh))+
dataset+dataset:dbh+dataset:h,data=ptrees)
mod<-nlme(v~volvff(dbh,h,logita=logita,lambda=lambda),
fixed=list(logita~I(1/h)+h+dbh+I(h*dbh)+I(1/(h*dbh))+dataset+
dataset:dbh+dataset:h+soil+temp_sum,
lambda~1),
random=logita~1|stand/plot,
start=c(coef(mod.init),rep(0,2),log(0.2)),
data=ptrees,
weights=varComb(varIdent(form=~1 |dataset),varPower()),
method="ML",
# control=list(msVerbose=TRUE),
# verbose=TRUE
)
pred1<-predvff(ptrees,mod,varMethod="simul",biasCorr="integrate")
pred1$totvol
pred1$totvolvar
pred1$totvolci
head(attributes(pred1)$trees)
pred2<-predvff(ptrees,mod,varMethod="taylor",biasCorr="twopoint")
pred2$totvol
pred2$totvolvar
pred2$totvolci
head(attributes(pred2)$trees)
## End(Not run)