View source: R/discretization.plugin.R
discretize2d.uniform_frequency | R Documentation |
discretize2d.uniform_frequency assigns the observations of two continuous random variables to bins according to the "uniform frequency" method, and returns a corresponding 2-dimensional count table.
discretize2d.uniform_frequency(x, y)
x |
a numeric vector of the first random variable. |
y |
a numeric vector of the second random variable. |
Uniform frequency-based method ("uniform_frequency") divides the continuous data into N bins with (approximate) equal count number. The number of bins N is initialized into a round-off value according to the square root of the data size.
discretize2d.uniform_frequency returns a 2-dimensional count table.
# two numeric vectors corresponding to two continuous random variables
x <- c(0.0, 0.2, 0.2, 0.7, 0.9, 0.9, 0.9, 0.9, 1.0)
y <- c(1.0, 2.0, 12, 8.0, 1.0, 9.0, 0.0, 3.0, 9.0)
# corresponding joint count table estimated by "uniform frequency" algorithm
discretize2d.uniform_frequency(x,y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.