Learn R Programming

seewave (version 1.6.3)

symba: Symbol analysis of a numeric (time) series

Description

This function analyses one or two sequences of symbols from numeric (time) series.

Usage

symba(x, y = NULL, symb = 5, collapse = TRUE, entropy = "abs",
plot = FALSE, type = "l", lty1 = 1, lty2 = 2, col1 = 2, col2 = 4,
cex1 = 0.75, cex2= 0.75, xlab = "index", ylab = "Amplitude", legend=TRUE, ...)

Arguments

Value

  • If y is NULL a list of three items is returned (s1, freq1, h1). If y is not NULL, a list of 6 items is returned (s1, freq1, h1, s2, freq2, h2, I):
  • s1the sequence of symbols of x,
  • freq1the absolute frequency of each x symbol,
  • h1the entropy of x symbol sequence,
  • s2the sequence of symbols of y,
  • freq2the absolute frequency of each y symbol,
  • h2the entropy of y symbol sequence,
  • Ithe mutual information between x and y.

Details

The analysis consists in transforming the series into a sequence of symbols (see the function discrets) and in computing the absolute frequency of each symbol within the sequence. The entropy (H) is then calculated using the symbol frequencies. Using the argument entropy, the entropy can be expressed along an absolute scale or as a relative value varying between 0 and 1. If two numeric (time) series are provided (x and y) the absolute symbol frequencies and entropy of each series is returned. Besides the mutual information (I) is estimated according to: $$I = H_{x} + H_{y} - H{xy}$$ with Hx the entropy of x symbol series, Hy the entropy of y symbol series, and `emph{Hxy}$ the joint entropy of x and y symbol series.

References

Cazelles, B. 2004 Symbolic dynamics for identifying similarity between rhythms of ecological time series. Ecology Letters, 7: 755-763.

See Also

discrets

Examples

Run this code
# analysis of a frequency spectrum
data(tico)
spec1<-spec(tico,f=22050,at=0.2,plot=FALSE)
symba(spec1[,2],plot=TRUE)
# it might be better to round the values
symba(round(spec1[,2],2),plot=TRUE)
# in that case the symbol entropy is almost similar to the spectral entropy
symba(round(spec1[,2],2),entrop="rel")$h1
sh(spec1)
# to compare two frequency spectra
spec2<-spec(tico,f=22050,wl=512,at=1.1,plot=FALSE)
symba(round(spec1[,2],2),round(spec2[,2],2),plot=TRUE)

Run the code above in your browser using DataLab