Learn R Programming

rebmix (version 2.6.1)

demix: Empirical Density Calculation

Description

demix returns (invisibly) the data frame containing observations $\bm{x}_{1}, \ldots, \bm{x}_{n}$ and empirical densities $f_{1}, \ldots, f_{n}$ for the Parzen window or k-nearest neighbour or bin means $\bar{\bm{x}}_{1}, \ldots, \bar{\bm{x}}_{v}$ and empirical densities $f_{1}, \ldots, f_{v}$ for the histogram preprocessing. Vectors $\bm{x}$ and $\bar{\bm{x}}$ are subvectors of $\bm{y} = (y_{1}, \ldots, y_{d})^{\top}$ and $\bar{\bm{y}} = (\bar{y}_{1}, \ldots, \bar{y}_{d})^{\top}$.

Usage

demix(x = NULL, Preprocessing = NULL, Variables = NULL,
      k = NULL, xmin = NULL, xmax = NULL, ...)

Arguments

x
a vector, a matrix or a data frame containing continuous or discrete vector observations $\bm{x}$.
Preprocessing
a preprocessing type. One of "histogram", "Parzen window" or "k-nearest neighbour".
Variables
a character vector of length $\leq d$ containing types of variables. One of "continuous" or "discrete".
k
a number of bins $v$ for the histogram and the Parzen window or number of nearest neighbours $k$ for the k-nearest neighbour.
xmin
a vector of length $\leq d$ containing minimum observations. The default value is NULL.
xmax
a vector of length $\leq d$ containing maximum observations. The default value is NULL.
...
currently not used.

References

M. Nagode and M. Fajdiga. The rebmix algorithm for the univariate finite mixture estimation. Communications in Statistics - Theory and Methods, 40(5):876-892, 2011a. http://dx.doi.org/10.1080/03610920903480890. M. Nagode and M. Fajdiga. The rebmix algorithm for the multivariate finite mixture estimation. Communications in Statistics - Theory and Methods, 40(11):2022-2034, 2011b. http://dx.doi.org/10.1080/03610921003725788.

Examples

Run this code
## Generate simulated dataset.

Theta <- rbind(pdf1 = rep("normal", 2),
  theta1.1 = c(10, 20),
  theta2.1 = c(3.0, 2.0),
  pdf1 = rep("normal", 2),
  theta1.1 = c(3, 2),
  theta2.1 = c(20, 10))

simulated <- RNGMIX(Dataset = "simulated",
  rseed = -1,
  n = c(15, 15),
  Theta = Theta)

## Preprocess simulated dataset.

y1y2f <- demix(x = simulated$Dataset[[1]],
  Preprocessing = "histogram",
  Variables = c("continuous", "continuous"),
  k = 6)
  
y1y2f

Run the code above in your browser using DataLab