Learn R Programming

rebmix (version 2.8.0)

dfmix: Predictive Density Calculation

Description

dfmix returns (invisibly) the vector containing predictive densities $f(\bm{x} | c, \bm{w}, \bm{\Theta})$. Vector $\bm{x}$ ia a subvector of $\bm{y} = (y_{1}, \ldots, y_{d})^{\top}$.

Usage

dfmix(x = NULL, w = NULL, Theta = NULL, ...)

Arguments

x
a vector, a matrix or a data frame containing continuous or discrete vector observations $\bm{x}$.
w
a vector containing $c$ component weights $w_{l}$ summing to 1.
Theta
a list containing $c$ parametric family types pdfi. One of "normal", "lognormal", "Weibull", "gamma", "binomial", "Poisson" or "Dirac". Component para
...
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. M. Nagode. Finite mixture modeling via REBMIX. Journal of Algorithms and Optimization, 3(2):14-28, 2015. http://www.academicpub.org/jao/paperInfo.aspx?PaperID=16625.

Examples

Run this code
# Generate simulated dataset.

Theta <- list(pdf1 = c("normal", "Weibull"),
  theta1.1 = c(10, 3),
  theta2.1 = c(3, 2),
  pdf2 = c("normal", "Weibull"),
  theta1.2 = c(20, 2),
  theta2.2 = c(2, 10))

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

# Estimate number of components, component weights and component parameters.

simulatedest <- REBMIX(Dataset = simulated@Dataset,
  Preprocessing = "Parzen window",
  cmax = 4,
  Criterion = "BIC",
  pdf = c("normal", "Weibull"),
  K = 8)

# Predictive density calculation.

i <- 1

x <- simulatedest@Dataset[[1]][, i]

f <- dfmix(x = x,
  w = simulatedest@w[[1]],
  Theta = lapply(simulatedest@Theta[[1]], "[", i))
  
plot(x, f)

i <- 2

x <- simulatedest@Dataset[[1]][, i]

f <- dfmix(x = x,
  w = simulatedest@w[[1]],
  Theta = lapply(simulatedest@Theta[[1]], "[", i))
  
plot(x, f)

Run the code above in your browser using DataLab