Package: em 1.0.0

Dongjie Wu

em: Generic EM Algorithm

A generic function for running the Expectation-Maximization (EM) algorithm within a maximum likelihood framework, based on Dempster, Laird, and Rubin (1977) <doi:10.1111/j.2517-6161.1977.tb01600.x> is implemented. It can be applied after a model fitting using R's existing functions and packages. The research leading to the software described here has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement no. 851293).

Authors:Dongjie Wu [aut, cre, cph]

em_1.0.0.tar.gz
em_1.0.0.zip(r-4.5)em_1.0.0.zip(r-4.4)em_1.0.0.zip(r-4.3)
em_1.0.0.tgz(r-4.4-x86_64)em_1.0.0.tgz(r-4.4-arm64)em_1.0.0.tgz(r-4.3-x86_64)em_1.0.0.tgz(r-4.3-arm64)
em_1.0.0.tar.gz(r-4.5-noble)em_1.0.0.tar.gz(r-4.4-noble)
em_1.0.0.tgz(r-4.4-emscripten)em_1.0.0.tgz(r-4.3-emscripten)
em.pdf |em.html
em/json (API)

# Install 'em' in R:
install.packages('em', repos = c('https://wudongjie.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/wudongjie/em/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • simbinom - Simulated Data from a logistic regression
  • simclogit - Simulated Data from a conditional logistic regression
  • simreg - Simulated Regression Data

On CRAN:

4.98 score 8 stars 24 scripts 168 downloads 8 exports 38 dependencies

Last updated 1 years agofrom:fe9747b490. Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 02 2024
R-4.5-win-x86_64NOTENov 02 2024
R-4.5-linux-x86_64NOTENov 02 2024
R-4.4-win-x86_64NOTENov 02 2024
R-4.4-mac-x86_64NOTENov 02 2024
R-4.4-mac-aarch64NOTENov 02 2024
R-4.3-win-x86_64NOTENov 02 2024
R-4.3-mac-x86_64NOTENov 02 2024
R-4.3-mac-aarch64NOTENov 02 2024

Exports:emestepfit.denflatteninit.emmstepmulti.emvdummy

Dependencies:bdsmatrixclicollapsedigestdplyrfansiFormulagenericsgluelatticelifecyclelmtestmagrittrMASSMatrixmaxLikmclustmiscToolsnlmennetnumDerivpillarpkgconfigplmR6rbibutilsRcppRcppArmadilloRdpackrlangsandwichsurvivaltibbletidyselectutf8vctrswithrzoo

em: A Generic Function of the EM Algorithm for Finite Mixture Models in R

Rendered fromem_intro.Rnwusingutils::Sweaveon Nov 02 2024.

Last update: 2023-08-14
Started: 2022-09-08

Readme and manuals

Help Manual

Help pageTopics
C-Step of EM algorithmcstep
A Generic EM Algorithmem
The em function for `survival::clogit`.em.clogit
The default em functionem.default
The default em functionem.fitdist
The em function for glmerModem.glmerMod
The em function for `panelmodel` such as `plm`.em.panelmodel
This function performs an E-Step of EM Algorithm.estep
Fit the density function for a fitted model.fit.den
Fit the density for the survival::clogitfit.den.coxph
Fitting the density function using in `fitdistrplus::fitdist()`fit.den.fitdist
Fit the density function for a generalized linear regression model.fit.den.glm
Fit the density function for a generalized linear mixed effect model.fit.den.glmerMod
Fit the density function for a generalized non-linear regression model.fit.den.gnm
Fit the density function for a linear regression model.fit.den.lm
Fit the density function for a multinomial regression model.fit.den.multinom
Fit the density function for a `nnet` model.fit.den.nnet
Fit the density function for a panel regression model.fit.den.plm
Flatten a data.frame or matrix by column or row with its name. The name will be transformed into the number of row/column plus the name of column/row separated by `.`.flatten
Initialization of EM algorithminit.em
model-based agglomerative hierarchical clusteringinit.em.hc
K-mean initializationinit.em.kmeans
Random initializationinit.em.random
Random initialization with weightsinit.em.random.weights
Initialization using sampling 5 times.init.em.sample5
This function computes logLik of EM Algorithm.logLik.em
M-Step of EM algorithmmstep
The mstep for the concomitant model.mstep.concomitant
The refit of for the concomitant model. This section was inspired by Flexmix.mstep.concomitant.refit
Multiple run of EM algorithmmulti.em
Default generic for multi.emmulti.em.default
Plot the fitted results of EM algorithmplot.em
Predict the fitted finite mixture modelspredict.em
Print the `em` objectprint.em
Print the `summary.em` objectprint.summary.em
Simulated Data from a logistic regressionsimbinom
Simulated Data from a conditional logistic regressionsimclogit
Simulated Regression Datasimreg
S-step of EM algorithmsstep
Summaries of fitted finite mixture models using EM algorithmsummary.em
Transform a factor variable to a matrix of dummy variablesvdummy