R Package mixAK

Arnošt Komárek

This package contains a mixture of statistical methods including the MCMC methods to analyze normal mixtures.



This overview provides a sorted list of the functions of the package and links to few more involved examples. Methods implemented in the package could be classified into following areas.

Papers related to the package

Please, cite either of the following papers if you find the package useful.

Supplementary materials and vignettes

1. Density estimation via normal mixtures (and MCMC)

NMixMCMC MCMC estimation of (multivariate) normal mixtures with possibly censored data
   There exists a print method for objects of class NMixMCMC.
NMixEM EM algorithm for a homoscedastic normal mixture
   There exists a print method for objects of class NMixEM.
NMixChainsDerived Create MCMC chains derived from previously sampled values
NMixPredDA Discriminant analysis based on MCMC output from the mixture model
NMixPlugDA Discriminant analysis based on plug-in estimates from the mixture model
 

2. Multivariate generalized linear mixed models with a normal mixture in the distribution of random effects

GLMM_MCMC MCMC estimation of a (multivariate) generalized linear mixed model with a normal mixture in the distribution of random effects
   There exists a print and fitted method for objects of class GLMM_MCMC.
GLMM_longitDA Discriminant analysis for longitudinal profiles based on fitted GLMM's
 

3. Supporting functions to further process or visualize results from running NMixMCMC or GLMM_MCMC functions

The following functions are generic with default method and a method for objects of class NMixMCMC and GLMM_MCMC implemented.

NMixRelabel Re-labeling the MCMC output of the mixture model
NMixSummComp Summary for the mixture components
tracePlots Traceplots for selected parameters
NMixPredDensJoint2 Pairwise bivariate predictive density
   There is also a plot method for objects of class NMixPredDensJoint2.
NMixPlugDensJoint2 Pairwise bivariate densities: plug-in estimate
   There is also a plot method for objects of class NMixPlugDensJoint2.
NMixPredCondDensJoint2 Pairwise bivariate conditional predictive densities
   There is also a plot method for objects of class NMixPredCondDensJoint2.
NMixPlugCondDensJoint2 Pairwise bivariate conditional densities: plug-in estimate
   There is also a plot method for objects of class NMixPlugCondDensJoint2.
NMixPredDensMarg Marginal (univariate) predictive density
   There is also a plot method for objects of class NMixPredDensMarg.
NMixPlugDensMarg Marginal (univariate) densities: plug-in estimate
   There is also a plot method for objects of class NMixPlugDensMarg.
NMixPredCDFMarg Marginal (univariate) predictive cumulative distribution function
   There is also a plot method for objects of class NMixPredCDFMarg.
NMixPredCondDensMarg Univariate conditional predictive density
   There is also a plot method for objects of class NMixPredCondDensMarg.
NMixPlugCondDensMarg Univariate conditional densities: plug-in estimate
   There is also a plot method for objects of class NMixPlugCondDensMarg.
 

Additionally, the following functions are available.

Y2T Transform fitted distribution of Y=trans(T) into distribution of T
   This is a generic function with default method to transform a fitted distribution of Y = trans(T) into a distribution of T = itrans(Y).
   There are methods for objects of class NMixPredDensMarg, NMixPlugDensMarg, NMixPredCDFMarg, NMixPredDensJoint2, NMixPlugDensJoint2, NMixPredCondDensMarg, NMixPlugCondDensMarg, NMixPredCondDensJoint2, NMixPlugCondDensJoint2.
summaryDiff Posterior summary statistics for a difference of two quantities
 

4. Univariate distributions

rTNorm Random number generation from a truncated normal distribution
 

5. Multivariate distributions

dMVN, rMVN, rcMVN (Log-)density and random number genaration for a multivariate normal distribution
rTMVN Random number genaration from a truncated multivariate normal distribution
dMVNmixture, dMVNmixture2, rMVNmixture, rMVNmixture2 (Log-)density and random number genaration for a mixture of (multivariate) normal distributions
dWISHART, rWISHART (Log-)density and random number genaration for a Wishart distribution
rDirichlet Random number genaration from a Dirichlet distribution
 

6. Miscellaneous random number generation

rRotationMatrix Random rotation matrix
rSamplePair Sample a pair (with replacement)
 

7. Matrix linear algebra

MatMPpinv Moore-Penrose pseudoinverse of a squared matrix
MatSqrt Square root of a matrix
 

8. Basic statistics

BLA Best linear approximation with respect to the mean square error (theoretical linear regression)
 

9. Utilities

getProfiles Individual longitudinal profiles of a given variable
plotProfiles Plot individual longitudinal profiles
BsBasis B-spline basis
generatePermutations Generate all permutations of (1, ..., K)
SP2Rect Conversion of a symmetric matrix stored in a packed format (lower triangle only) into a matrix
autolayout Automatic layout for several plots in one figure
cbplot Plot a function together with its confidence/credible bands
 

10. Datasets

Acidity Acidity index of lakes in North-Central Wisconsin
   Acidity index measured in a sample of 155 lakes in North-Central Wisconsin.
Enzyme Enzymatic activity in the blood
   Enzymatic activity in the blood, for an enzyme involved in the metabolism of carcinogenic substances, among a group of 245 unrelated individuals.
Faithful Old Faithful Geyser Data
   Waiting time between eruptions and the duration of the eruption for the Old Faithful geyser in Yellowstone National Park, Wyoming, USA, version used in Härdle (1991).
Galaxy Velocities of distant galaxies
   Velocities of 82 distant galaxies, diverging from our own galaxy.
PBCseq Mayo Clinic Primary Biliary Cholangitis (Cirrhosis), sequential data
PBC910 Mayo Clinic Primary Biliary Cholangitis (Cirrhosis), sequential data (subset)
   Subset of PBC data used in Komárek, A. and Komárková, L. (2013) and in Komárek, A. and Komárková, L. (2014).
Tandmob Signal Tandmobiel data
   Dental (Signal Tandmobiel) data for 4430 6-12 year old children
TandmobEmer Signal Tandmobiel data - emergence times
   Data derived from Tandmob.