Skip to contents

This function creates a data.table containing the matrix of posterior alpha and taxonomic info, using a prior expert knowledge (optional) and observation for trees with a confirmed identification or a temporary identification (BotaCertainty 4 and 3 in Guyafor)

Usage

CreateAlpha(DataAsso, prior, wp)

Arguments

DataAsso

data.table of inventory data, formatted as as shown in the vignette

prior

data.table with prior expert knowledge. This dataset must have been prepared using the function PrepPrior.

wp

numeric value giving the weighting of the prior information

Value

This function returns a data.table with a row per full botanical names (GenSp). The first columns are GenSp, Family, Genus and Species and the following columns are each of the vernacular name. These columns are the vectors of alphav.

Details

This function performs the following steps:

  • create matrix of lambdav: get lambdav, equal to 1/number of possible association to the vernacular name v if the association is possible according to the prior and 0 if not

  • create matrix of fv using DataObs

  • keep only trees with a confirmed identification or a temporary identification (BotaCertainty 4 and 3 in Guyafor)

  • keep one line per individual (to avoid giving more weight in individuals present in multiple censuses)

  • get fv, the observed frequencies of association between the vernacular name v and each botanical name fv

  • sum the two matrix with a weigh of wp for the prior and (1-wp) for the observation