kullback.leibler: Kullback Leibler Statistic

Description Usage Arguments Details Value Note References Examples

Description

A proximity measure between two probability distributions applied to speech.

Usage

1

Arguments

x

A numeric vector, matrix or data frame.

y

A second numeric vector if x is also a vector. Default is NULL.

Details

Uses Kullback & Leibler's (1951) formula:

D_{KL}(P||Q)=∑_i{ln≤ft ( \frac{P_{i}}{Q_{i}} \right )}P_{i}

Value

Returns a matrix of the Kullback Leibler measure between each vector of probabilities.

Note

The kullback.leibler function generally receives the output of either wfm or wfdf functions.

References

Kullback, S., & Leibler, R.A. (1951). On Information and sufficiency. Annals of Mathematical Statistics 22 (1): 79-86. doi:10.1214/aoms/1177729694

Examples

1
2
3
4
5
6
7
8
9
p.df <- wfdf(DATA$state, DATA$person)
p.mat <- wfm(text.var = DATA$state, grouping.var = DATA$person)
kullback.leibler(p.mat)
(x <- kullback.leibler(p.df))
print(x, digits = 5)
kullback.leibler(p.df$greg, p.df$sam)

## p.df2 <- wfdf(raj$dialogue, raj$person)
## x <- kullback.leibler(p.df2)

trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.