Mixture of Regression Models with Varying Mixing Proportions
Mixture of Regression Models with Varying Mixing Proportions
`mixregPvary' is used to estimate a mixture of regression models with varying proportions: [REMOVE_ME]Y∣x,Z=z∼∑c=1Cπc(z)N(x⊤βc,σc2).[REMOVEME2]
The varying proportions are estimated using a local constant regression method (kernel regression).
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 piis a vector of length C of mixing proportions,betais a (p + 1) by C matrix for component regression coefficients, andvar` is a vector of length C of component variances.
Returns
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.
Description
`mixregPvary' is used to estimate a mixture of regression models with varying proportions:
Y∣x,Z=z∼c=1∑Cπc(z)N(x⊤βc,σc2).
The varying proportions are estimated using a local constant regression method (kernel regression).
Examples
n =100C =2u = 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)
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.