mixregPvary {MixSemiRob}R Documentation

Mixture of Regression Models with Varying Mixing Proportions

Description

‘mixregPvary’ is used to estimate a mixture of regression models with varying proportions:

Y|_{\boldsymbol{x},Z=z} \sim \sum_{c=1}^C\pi_c(z)N(\boldsymbol{x}^{\top}\boldsymbol{\beta}_c,\sigma_c^2).

The varying proportions are estimated using a local constant regression method (kernel regression).

Usage

mixregPvary(x, y, C = 2, z = NULL, u = NULL, h = NULL,
             kernel = c("Gaussian", "Epanechnikov"), ini = NULL)

Arguments

x

an n by p matrix of explanatory variables. The intercept will be automatically added to x.

y

an n-dimensional vector of response variable.

C

number of mixture components. Default is 2.

z

a vector of a variable with varying-proportions. It can be any of the variables in x. Default is NULL, and the first variable in x will be used.

u

a vector of grid points for the local constant regression method to estimate the proportions. If NULL (default), 100 equally spaced grid points are automatically generated between the minimum and maximum values of z.

h

bandwidth for kernel density estimation. If NULL (default), the bandwidth is calculated based on the method of Botev et al. (2010).

kernel

character, determining the kernel function used in local constant method: Gaussian or Epanechnikov. Default is Gaussian.

ini

initial values for the parameters. Default is NULL, which obtains the initial values using the regmixEM function of the ‘mixtools’ package. If specified, it can be a list with the form of list(pi, beta, var), where pi is a vector of length C of mixing proportions, beta is a (p + 1) by C matrix for component regression coefficients, and var is a vector of length C of component variances.

Value

A list containing the following elements:

pi_u

length(u) by C matrix of estimated mixing proportions at grid points.

pi_z

n by C matrix of estimated mixing proportions at z.

beta

(p + 1) by C matrix of estimated component regression coefficients.

var

C-dimensional vector of estimated component variances.

loglik

final log-likelihood.

References

Huang, M. and Yao, W. (2012). Mixture of regression models with varying mixing proportions: a semiparametric approach. Journal of the American Statistical Association, 107(498), 711-724.

Botev, Z. I., Grotowski, J. F., and Kroese, D. P. (2010). Kernel density estimation via diffusion. The Annals of Statistics, 38(5), 2916-2957.

See Also

mixregPvaryGen

Examples

n = 100
C = 2
u = seq(from = 0, to = 1, length = 100)
true_beta = cbind(c(4, - 2), c(0, 3))
true_var = c(0.09, 0.16)
data = mixregPvaryGen(n, C)
x = data$x
y = data$y
est = mixregPvary(x, y, C, z = x, u, h = 0.08)

[Package MixSemiRob version 1.1.0 Index]