| init1.2.jk.j | R Documentation | 
\beta_{jk} (m=1) or \beta_{j} (m=2) parameterization.
This function is the second step of the two-step small initialization procedure (Initialization 1), used for parameterizations m=1 or m=2. At first, init1.1.jk.j is called for each condition j=1,\ldots,J. The values obtained from the first step are used for initializing the second step 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}). The selected values from the second step are the ones that initialize the EM algorithm (bjkmodel or bjmodel), when K=K_{min}.
init1.2.jk.j(reference, response, L, K, m1, m2, t1, t2, model,mnr)
reference | 
 a numeric array of dimension   | 
response | 
 a numeric array of count data with dimension   | 
L | 
 numeric vector of positive integers containing the partition of the   | 
K | 
 positive integer denoting the number of mixture components.  | 
m1 | 
 positive integer denoting the number of iterations for each run of   | 
m2 | 
 positive integer denoting the number of iterations for each run of   | 
t1 | 
 positive integer denoting the number of different runs of   | 
t2 | 
 positive integer denoting the number of different runs of   | 
model | 
 binary variable denoting the parameterization of the model: 1 for   | 
mnr | 
 positive integer denoting the maximum number of Newton-Raphson iterations.  | 
alpha  | 
 numeric array of dimension   | 
beta  | 
 numeric array of dimension   | 
psim  | 
 numeric vector of length   | 
ll  | 
 numeric, the value of the loglikelihood, computed according to the   | 
Panagiotis Papastamoulis
init1.1.jk.j, bjkmodel, bjmodel
############################################################
#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 parameters for a 2 component mixture
## the number of the overall small runs are t2 = 2
## each one consisting of m2 = 2 iterations of the EM.
## the number of the small runs for the first step small EM
## is t1 = 2, each one consisting of m1 = 2 iterations.
start2 <- init1.2.jk.j(reference=x, response=y, L=c(3,2,1), 
                       K=2, m1=2, m2=2, t1=2, t2=2, model=1,mnr = 3)
summary(start2)
############################################################
#2.            Example with beta_j (m=2) model             #
############################################################
## initialize the parameters for a 2 component mixture
## the number of the overall small runs are t2 = 3
## each one consisting of m2 = 2 iterations of the EM.
## the number of the small runs for the first step small EM
## is t1 = 2, each one consisting of m1 = 2 iterations.
start2 <- init1.2.jk.j(reference=x, response=y, L=c(3,2,1), 
                       K=2, m1=2, m2=2, t1=2, t2=3, model=2,mnr = 5)
summary(start2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.