mixScale {MixSemiRob}R Documentation

Continuous Scale Mixture Approach for Normal Scale Mixture Model

Description

‘mixScale’ is used to estimate a two-component continuous normal scale mixture model, based on a backfitting method (Xiang et al., 2016):

p(x;\boldsymbol{\theta},f) = \pi f_1(x-\mu_1) + (1-\pi) f_2(x-\mu_2),

where \boldsymbol{\theta}=(\pi,\mu_1,\mu_2). Here, f is assumed to be a member of \mathcal{F} = \left\{ f(x) \big| \int\frac{1}{\sigma}\phi(x/\sigma)dQ(\sigma) \right\}, where \phi(x) is the standard normal density and Q is an unspecified probability measure on positive real numbers.

Usage

mixScale(x, ini = NULL, maxiter = 100)

Arguments

x

a vector of observations.

ini

initial values for the parameters. Default is NULL, which obtains the initial values using the mixnorm function. If specified, it can be a list with the form of list(pi, mu, sigma), where pi is a vector of 2 mixing proportions, mu is a vector of 2 component means, and sigma is a vector of 2 component (common) standard deviations.

maxiter

maximum number of iterations for the EM algorithm. Default is 100.

Value

A list containing the following elements:

mu

estimated component means.

pi

estimated mixing proportions.

suppQ

support of Q.

weightQ

weight of Q corresponding to initial standard deviations.

loglik

final log-likelihood.

run

number of iterations after convergence.

References

Xiang, S., Yao, W., and Seo, B. (2016). Semiparametric mixture: Continuous scale mixture approach. Computational Statistics & Data Analysis, 103, 413-425.

See Also

mixnorm for initial value calculation.

Examples

require(quadprog)

#-----------------------------------------------------------------------------------------#
# Example 1: simulation
#-----------------------------------------------------------------------------------------#
n = 10
mu = c(-2.5, 0)
sd = c(0.8, 0.6)
pi = c(0.3, 0.7)
set.seed(2023)
n1 = rbinom(n, 1, pi[1])
x = c(rnorm(sum(n1), mu[1], sd[1]), rnorm(n - sum(n1), mu[2], sd[2]))
ini = list(pi = pi, mu = mu, sigma = sd)
out = mixScale(x, ini)

#-----------------------------------------------------------------------------------------#
# Example 2: elbow data
#-----------------------------------------------------------------------------------------#
ini = mixnorm(elbow)
res = mixScale(elbow, ini)

[Package MixSemiRob version 1.1.0 Index]