init1.1.jk.j: 1st step of Initialization 1 for the beta_{jk} (m=1) or...

View source: R/init1.1.jk.j.R

init1.1.jk.jR Documentation

1st step of Initialization 1 for the \beta_{jk} (m=1) or \beta_{j} (m=2) parameterization.

Description

This function is the first step of the two-step small initialization procedure (Initialization 1), used for the parameterizations m=1 (\beta_{jk}) or m=2 (\beta_{j}). For each condition j=1,\ldots,J, a small EM is run in order to find some good starting values for the K-component mixtures: \sum_{k=1}^{K}p_j\prod_{\ell=1}^{L_j}f(y_{ij\ell}), independently for each j=1,\ldots,J. These values are used in order to initialize the second step (init1.2.jk.j) of the small EM algorithm for fitting the overall mixture \sum_{k=1}^{K}\pi_j\prod_{j=1}^{J}\prod_{\ell=1}^{L_j}f(y_{ij\ell}).

Usage

init1.1.jk.j(reference, response, L, K, t1, model, m1,mnr)

Arguments

reference

a numeric array of dimension n\times V containing the V covariates for each of the n observations.

response

a numeric array of count data with dimension n\times d containing the d response variables for each of the n observations.

L

numeric vector of positive integers containing the partition of the d response variables into J\leq d blocks, with \sum_{j=1}^{J}L_j=d.

K

positive integer denoting the number of mixture components.

t1

positive integer denoting the number of different runs.

model

binary variable denoting the parameterization of the model: 1 for \beta_{jk} and 2 for \beta_{j} parameterization.

m1

positive integer denoting the number of iterations for each run.

mnr

positive integer denoting the maximum number of Newton-Raphson iterations.

Value

alpha

numeric array of dimension J \times K containing the selected values \alpha_{jk}^{(0)}, j=1,\ldots,J, k=1,\ldots,K that will be used to initialize the second step of the small EM.

beta

numeric array of dimension J \times K \times T (if model = 1) or J \times T (if model = 2) containing the selected values of \beta_{jk\tau}^{(t)} (or \beta_{j\tau}^{(t)}), j=1,\ldots,J, k=1,\ldots,K, \tau=1,\ldots,T, that will be used to initialize the second step of the small EM.

psim

numeric vector of length K.

ll

numeric, the value of the loglikelihood, computed according to the mylogLikePoisMix function.

Author(s)

Panagiotis Papastamoulis

See Also

init1.2.jk.j, bjkmodel, bjmodel

Examples

############################################################
#1.            Example with beta_jk (m=1) model            #
############################################################
## load a simulated dataset according to the b_jk model
## number of observations: 500
## design: L=(3,2,1)
data("simulated_data_15_components_bjk")
x <- sim.data[,1]
x <- array(x,dim=c(length(x),1))
y <- sim.data[,-1]
## initialize the component specific parameters 
##                   for a 2 component mixture
start1 <- init1.1.jk.j(reference=x, response=y, L=c(3,2,1), 
                       K=2, t1=3, model=1, m1=5,mnr = 5)
summary(start1)

############################################################
#2.            Example with beta_j (m=2) model             #
############################################################

start1 <- init1.1.jk.j(reference=x, response=y, L=c(3,2,1), 
                       K=2, t1=3, model=2, m1=5,mnr = 5)
summary(start1)


poisson.glm.mix documentation built on Aug. 19, 2023, 9:06 a.m.