tdv {diffval} | R Documentation |
The Total Differential Value of a phytosociological table
Description
Given a phytosociological table and a partition of its columns, this function calculates the respective Total Differential Value (TDV).
Usage
tdv(m_bin, p, output_type = "normal")
Arguments
m_bin |
A matrix. A phytosociological table of 0s (absences) and 1s (presences), where rows correspond to taxa and columns correspond to relevés. |
p |
A vector of integer numbers with the partition of the relevés (i.e.,
a k-partition, consisting in a vector with values from 1 to k, with length
equal to the number of columns of |
output_type |
A character determining the amount of information returned by the function and also the amount of pre-validations. Possible values are "normal" (the default), "fast" and "full". |
Details
The function accepts a phytosociological table (m_bin
) and a
k-partition of its columns (p
), returning the corresponding TDV.
TDV was proposed by Monteiro-Henriques and Bellu (2014).
Monteiro-Henriques (2016) proposed TDV1, modifying TDV slightly with the
objective of ensuring a value from 0 to 1. Yet, TDV is always within that
range. In practice, both TDV and TDV1 have 0 as possible minimum value
and 1 as possible maximum value, but TDV1 reduces further the contribution
of differential taxa present in more than one group. TDV is then
implemented here, for parsimony.
TDV is calculated using the DiffVal
index for each (and all) of the
taxa present in a tabulated phytosociological table M
(also called
sorted table). DiffVal
index aims at characterizing how well a taxon
works as a differential taxon in a such tabulated phytosociological table
(for more information on differential taxa see Mueller-Dombois & Ellenberg,
1974).
An archetypal differential taxon of a certain group g
of the
partition p
(a partition on the columns of M
) is the one
present in all relevés of group g
, and absent from all the other
groups of that partition. Therefore, DiffVal
has two components, an
inner one (\frac{a}{b}
), which measures the presence of the
taxon inside each of the groups, and an outer one (\frac{c}{d}
),
which measures the relevant absences of the taxon outside of each of the
groups. Specifically, given a partition p
with k
groups,
DiffVal
is calculated for each taxon s
as:
DiffVal_{s,p} = \frac{1}{e}\sum_{g=1}^k{\frac{a}{b}\frac{c}{d}}
where:
-
a
, is the total number of presences of taxons
within groupg
. -
b
, is the total number of relevés of groupg
. -
c
, is the total number of differentiating absences of taxons
, i.e., absences coming from the groups other thang
from which the taxons
is completely absent. -
d
, is the total number of relevés of all groups butg
(i.e., the total number of relevés in the table -b
). -
e
, is the total number of groups in which the taxons
occurs at least once.
Therefore, for each taxon s
and for each group g
, the
DiffVal
index evaluates:
-
\frac{a}{b}
, i.e., the frequency of the presences of taxons
, relative to the size of groupg
; commonly called 'relative frequency.'\frac{a}{b}
is only 1 if and only if taxons
occurs in all the relevés of groupg
. -
\frac{c}{d}
, i.e., the frequency of the differentiating absences of taxons
outside groupg
, relative to the sum of sizes of all groups butg
. Nota bene: absences inc
are counted outside the groupg
but only in the groups from which taxons
is completely absent (these are the relevant absences, which produce differentiation among groups); in practicec
corresponds to the sum of the sizes of all groups other thang
that are empty.\frac{c}{d}
is 1 if and only if the taxons
is absent from all groups butg
.
Finally, \frac{1}{e}
ensures that DiffVal
is a value
from 0 to 1.
The Total Differential Value (TDV or TotDiffVal
) of a
phytosociological table M
tabulated/sorted by the partition p
is:
TDV_{M,p} = \frac{1}{n}\sum_{i=1}^n{Diffval_{i,p}}
where:
-
n
, is the number of taxa in tableM
.
The division by the number of taxa present in M
ensures that TDV
remains in the [0,1] interval (as DiffVal
is also in the same
interval).
Value
If output_type = "normal"
(the default) pre-validations are done
and a list is returned, with the following components:
- ifp
A matrix with the
\frac{a}{b}
values for each taxon in each group, for short called the 'inner frequency of presences'.- ofda
A matrix with the
\frac{c}{d}
values for each taxon in each group, for short called the 'outer frequency of differentiating absences'.- e
A vector with the
e
values for each taxon, i.e., the number of groups containing that taxon.- diffval
A matrix with the
DiffVal
for each taxon.- tdv
A numeric with the TDV of matrix
m_bin,
given the partitionp
.
If output_type = "full"
, some extra components are added to the output:
afg
, empty.size
, gct
(= e
) and i.mul
. These are intermediate
matrices used in the computation of TDV.
If output_type = "fast"
, only TDV is returned and no pre-validations are
done.
Author(s)
Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.
References
Monteiro-Henriques T. & Bellu A. 2014. An optimization approach to the production of differentiated tables based on new differentiability measures. 23rd EVS European Vegetation Survey. Presented orally. Ljubljana, Slovenia.
Monteiro-Henriques T. 2016. A bunch of R functions to assist phytosociological tabulation. 25th Meeting of European Vegetation Survey. Presented in poster. Rome. Italy.
Mueller-Dombois D. & Ellenberg H. 1974. Aims and Methods of Vegetation Ecology. New York: John Wiley & Sons.
Examples
# Getting the Taxus baccata forests data set
data(taxus_bin)
# Creating a group partition, as the one presented in the original article of
# the data set
groups <- rep(c(1, 2, 3), c(3, 11, 19))
# Removing taxa occurring in only one relevé, in order to reproduce exactly
# the example in the original article of the data set
taxus_bin_wmt <- taxus_bin[rowSums(taxus_bin) > 1, ]
# Calculating TDV
result <- tdv(taxus_bin_wmt, groups)
# This is the TDV
result$tdv
# This is TDV1, reproducing exactly the value from the original article
sum(result$diffval / result$e) / nrow(taxus_bin_wmt)