Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/r-utility-plogp.R
This function calculates the product of a probability value and its a base-2 logarithm, returning 0 for 0 probabilities. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.
1 | plogp(p)
|
p |
a non-negative value or vector of values |
This avoids the NaN
result produced by 0*log2(0)
by forcing the result to be 0 for zero probabilities.
If p>0
then p*log2(p)
and 0
otherwise.
Pawel Cichosz <p.cichosz@elka.pw.edu.pl>
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.