Learn R Programming

poisson.glm.mix (version 1.4)

init1.k: Initialization 1 for the \(\beta_{k}\) parameterization (\(m=3\)).

Description

This function is the small initialization procedure (Initialization 1) for parameterization \(m=3\). The selected values are the ones that initialize the EM algorithm bkmodel.

Usage

init1.k(reference, response, L, K, t2, m2,mnr)

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 main EM.

beta

numeric array of dimension \(K \times T\) containing the selected values of \(\beta_{k\tau}^{(0)}\), \(k=1,\ldots,K\), \(\tau=1,\ldots,T\), that will be used to initialize the main EM.

psim

numeric vector of length \(K\) containing the weights that will initialize the main EM.

ll

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

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.

t2

positive integer denoting the number of different runs.

m2

positive integer denoting the number of iterations for each run.

mnr

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

Author

Panagiotis Papastamoulis

See Also

bkmodel, init2.k

Examples

Run this code
## 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 parameters for a 2 component mixture
## the number of the small runs are t2 = 3
## each one consisting of m2 = 5 iterations of the EM.
start1 <- init1.k(reference=x, response=y, L=c(3,2,1), 
                       K=2, m2=5, t2=3,mnr = 5)
summary(start1)


Run the code above in your browser using DataLab