fmrHP: Finite Mixture Effects Model with Heterogeneity Pursuit

Description Usage Arguments Details Value Examples

View source: R/fmrHP.R

Description

Produce solution for specified lambda of regularized finite mixture effects model with lasso or adaptive lasso; compute the degrees of freeom, likelihood and information criteria (AIC, BIC and GIC) of the estimators. Model fitting is conducted by EM algorithm and Bregman coordinate descent.

Usage

1
2
3
4
fmrHP(y, X, m, intercept = FALSE, lambda, equal.var = FALSE,
      ic.type = c("ALL", "BIC", "AIC", "GIC"),
      B = NULL, prob = NULL, rho = NULL, w = NULL,
      control = list(), report = FALSE)

Arguments

y

a vector of response (n \times 1)

X

a matrix of covariate (n \times p)

m

number of components

intercept

indicating whether intercept should be included

lambda

value of tuning parameter

equal.var

indicating whether variances of different components are equal

ic.type

the information criterion to be used; currently supporting "AIC", "BIC", and "GIC".

B

initial values for the rescaled coefficients with first column being the common effect, and the rest m columns being the heterogeneity for corresponding components

prob

initial values for prior probabilitis for different components

rho

initial values for rho vector (1 / σ), the reciprocal of standard deviation

w

weight matrix for penalty function. Default option is NULL

control

a list of parameters for controlling the fitting process

report

indicating whether printing the value of objective function during EM algorithm for validation checking of initial value.

Details

The available elements for argument control include

Value

A list consisting of

y

vector of response

X

matrix of covariates

m

number of components

B.hat

estimated rescaled coefficient (p \times m + 1 \times nlambda)

pi.hat

estimated prior probabilities (m \times nlambda)

rho.hat

estimated rho values (m \times nlambda)

lambda

lambda used in model fitting

plik

value of penalized log-likelihood

loglik

value of log-likelihood

conv

indicator of convergence of EM algorithm

IC

values of information criteria

df

degree of freedom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(fmerPack)
## problem settings
n <- 100; m <- 3; p <- 5;
sigma2 <- c(0.1, 0.1, 0.4); rho <- 1 / sqrt(sigma2)
phi <- rbind(c(1, 1, 1), c(1, 1, 1), c(0, -3, 3), c(-3, 3, 0), c(3, 0, -3))
beta <- t(t(phi) / rho)
## generate response and covariates
z <- rmultinom(n, 1, prob= rep(1 / m, m))
X <- matrix(rnorm(n * p), nrow = n, ncol = p)
y <- MASS::mvrnorm(1, mu = rowSums(t(z) * X[, 1:(nrow(beta))] %*% beta), 
                   Sigma = diag(colSums(z * sigma2)))
fmrHP(y, X, m = m, lambda = 0.01, control = list(n.ini = 10))

fmerPack documentation built on Feb. 1, 2021, 9:06 a.m.

Related to fmrHP in fmerPack...