varshannon | R Documentation |
This function estimates the variance of Shannon's entropy of a variable X
.
varshannon(data)
data |
A data matrix or vector, can be numeric, factor, character, ...
Alternatively, a marked |
varshannon estimates the variance of the maximum likelihood estimator of Shannon's entropy given by shannon. The variance is
V(H(X))=H(X)_2- H(X)^2
, where H(X)_2
is
a version of Shannon's entropy (see shannon) where
the information function \log(1/p(x_i))
is squared:
H(X)_2=\sum p(x_i) \log(1/p(x_i))^2
. The function is able to work with lattice data with missing data, as long as they are specified as NAs: missing data are ignored in the computations.
the estimated variance of Shannon's entropy.
#NON SPATIAL DATA
varshannon(sample(1:5, 50, replace=TRUE))
#POINT DATA
data.pp=runifpoint(100, win=square(10))
marks(data.pp)=sample(c("a","b","c"), 100, replace=TRUE)
varshannon(marks(data.pp))
#LATTICE DATA
data.lat=matrix(sample(c("a","b","c"), 100, replace=TRUE), nrow=10)
varshannon(data.lat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.