| symba | R Documentation | 
This function analyses one or two sequences of symbols from numeric (time) series.
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, ...)
| x | a first R object. | 
| y | a second R object | 
| symb | the number of symbols used for the discretisation, can be set to 3 or 5 only. | 
| collapse | logical, if  | 
| entropy | either "abs" for an absolute value or "rel" for a relative value, i. e. between 0 and 1. | 
| plot | logical, if  | 
| type | if  | 
| lty1 | line type of the object  | 
| lty2 | line type of the object  | 
| col1 | colour of the object  | 
| col2 | colour of the object  | 
| cex1 | character size of  | 
| cex2 | character size of  | 
| xlab | title of the x axis. | 
| ylab | title of the y axis. | 
| legend | logical, if  | 
| ... | other  | 
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 Hxy$ the joint entropy
of x and y symbol series.
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):
| s1 | the sequence of symbols of  | 
| freq1 | the relative frequency of each  | 
| h1 | the entropy of  | 
| s2 | the sequence of symbols of  | 
| freq2 | the relative frequency of each  | 
| h2 | the entropy of  | 
| I | the mutual information between  | 
It might be useful to round the values of the input series (see examples).
The mutual information (I) should increase with the similarity
between the series to compare (x and y).
Jerome Sueur sueur@mnhn.fr
Cazelles, B. 2004 Symbolic dynamics for identifying similarity between rhythms of ecological time series. Ecology Letters, 7: 755-763.
discrets, SAX
# 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 close 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.