optimizer_batch: Fitting clusterwise linear mixed effects model on a given...

Description Usage Arguments Value

View source: R/optimizer_batch.R

Description

run clusterwise linear mixed effects model with K clusters on the given data. This function uses a batch approach where the cost are calculated along all rows and the affectation is made to minimize this cost, after that the k models are adjusted.

Usage

1
2
3
4
5
6
7
8
optimizer_batch(
  data,
  target,
  K,
  formula,
  nb_iterations = 100,
  initialization = NULL
)

Arguments

data

data frame containing the variables named in formula.

target

vector containing the target variable.

K

number of clusters.

formula

a two sided linear formula object corresponding to formula parameter in lmer from lme4 package.

nb_iterations

maximum number of iterations.

initialization

if vector of the same length of data, use this vector as clustering initialization. Otherwise, do a random initialization.

Value

list containing the models as a class of clmm, the final clustering and the final cost.


Redha-ALLICHE/clusterwiselmm documentation built on Aug. 3, 2020, 1:10 a.m.