Skip to contents

Propagation of the errors throughout the steps needed to compute AGB or AGC.

Usage

AGBmonteCarlo(
  D,
  WD = NULL,
  errWD = NULL,
  H = NULL,
  errH = NULL,
  HDmodel = NULL,
  coord = NULL,
  Dpropag = NULL,
  n = 1000,
  Carbon = FALSE,
  Dlim = NULL,
  plot = NULL
)

Arguments

D

Vector of tree diameters (in cm)

WD

Vector of wood density estimates (in g/cm3)

errWD

Vector of error associated to the wood density estimates (should be of the same size as WD)

H

(option 1) Vector of tree heights (in m). If set, errH must be set too.

errH

(if H) Residual standard error (RSE) of a model or vector of errors (sd values) associated to tree height values (in the latter case the vector should be of the same length as H).

HDmodel

(option 2) Model used to estimate tree height from tree diameter (output from modelHD(), see example).

coord

(option 3) Coordinates of the site(s), either a vector giving a single site (e.g. c(longitude, latitude)) or a matrix/dataframe with two columns (e.g. cbind(longitude, latitude)). The coordinates are used to predict height-diameter allometry with bioclimatic variables.

Dpropag

This variable can take three kind of values, indicating how to propagate the errors on diameter measurements: a single numerical value or a vector of the same size as D, both representing the standard deviation associated with the diameter measurements or "chave2004" (an important error on 5 percent of the measures, a smaller error on 95 percent of the trees).

n

Number of iterations. Cannot be smaller than 50 or larger than 1000. By default n = 1000

Carbon

(logical) Whether or not the propagation should be done up to the carbon value (FALSE by default).

Dlim

(optional) Minimum diameter (in cm) for which above-ground biomass should be calculated (all diameter below Dlim will have a 0 value in the output).

plot

(optional) Plot ID, must be either one value, or a vector of the same length as D. This argument is used to build stand-specific HD models.

Value

Returns a list with (if Carbon is FALSE):

  • meanAGB: Mean stand AGB value following the error propagation

  • medAGB: Median stand AGB value following the error propagation

  • sdAGB: Standard deviation of the stand AGB value following the error propagation

  • credibilityAGB: Credibility interval at 95\

  • AGB_simu: Matrix with the AGB of the trees (rows) times the n iterations (columns)

Details

See Rejou-Mechain et al. (2017) for all details on the error propagation procedure.

References

Chave, J. et al. (2004). Error propagation and scaling for tropical forest biomass estimates. Philosophical Transactions of the Royal Society B: Biological Sciences, 359(1443), 409-420.

Rejou-Mechain et al. (2017). BIOMASS: An R Package for estimating above-ground biomass and its uncertainty in tropical forests. Methods in Ecology and Evolution, 8 (9), 1163-1167.

Author

Maxime REJOU-MECHAIN, Bruno HERAULT, Camille PIPONIOT, Ariane TANGUY, Arthur PERE

Examples

# Load a database
data(NouraguesHD)
data(KarnatakaForest)

# Modelling height-diameter relationship
HDmodel <- modelHD(D = NouraguesHD$D, H = NouraguesHD$H, method = "log2")

# Retrieving wood density values
# \donttest{
KarnatakaWD <- getWoodDensity(KarnatakaForest$genus, KarnatakaForest$species,
  stand = KarnatakaForest$plotId
)
#> The reference dataset contains 16467 wood density values
#> Your taxonomic table contains 399 taxa
# }

# Propagating errors with a standard error in wood density in one plot
filt <- KarnatakaForest$plotId == "BSP20"
set.seed(10)
# \donttest{
resultMC <- AGBmonteCarlo(
  D = KarnatakaForest$D[filt], WD = KarnatakaWD$meanWD[filt],
  errWD = KarnatakaWD$sdWD[filt], HDmodel = HDmodel
)
str(resultMC)
#> List of 5
#>  $ meanAGB       : num 294
#>  $ medAGB        : num 293
#>  $ sdAGB         : num 11.8
#>  $ credibilityAGB: Named num [1:2] 272 318
#>   ..- attr(*, "names")= chr [1:2] "2.5%" "97.5%"
#>  $ AGB_simu      : num [1:326, 1:1000] 1.39822 0.00792 0.01167 0.02006 0.01725 ...
# }

# If only the coordinates are available
lat <- KarnatakaForest$lat[filt]
long <- KarnatakaForest$long[filt]
coord <- cbind(long, lat)
# \donttest{
resultMC <- AGBmonteCarlo(
  D = KarnatakaForest$D[filt], WD = KarnatakaWD$meanWD[filt],
  errWD = KarnatakaWD$sdWD[filt], coord = coord
)
str(resultMC)
#> List of 5
#>  $ meanAGB       : num 220
#>  $ medAGB        : num 220
#>  $ sdAGB         : num 10.6
#>  $ credibilityAGB: Named num [1:2] 201 242
#>   ..- attr(*, "names")= chr [1:2] "2.5%" "97.5%"
#>  $ AGB_simu      : num [1:326, 1:1000] 1.41281 0.0104 0.00538 0.01716 0.01517 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : NULL
#>   .. ..$ : chr [1:1000] "202.1" "23" "255" "523" ...
# }

# Propagating errors with a standard error in wood density in all plots at once
# \donttest{
KarnatakaForest$meanWD <- KarnatakaWD$meanWD
KarnatakaForest$sdWD <- KarnatakaWD$sdWD
resultMC <- by(
  KarnatakaForest, KarnatakaForest$plotId,
  function(x) AGBmonteCarlo(
      D = x$D, WD = x$meanWD, errWD = x$sdWD,
      HDmodel = HDmodel, Dpropag = "chave2004"
    )
)
meanAGBperplot <- unlist(sapply(resultMC, "[", 1))
credperplot <- sapply(resultMC, "[", 4)
# }