Last data update: 2014.03.03

R: Function for end-member modelling analysis.
EMMAR Documentation

Function for end-member modelling analysis.

Description

A multivariate data set (m samples composed of n variables) is decomposed by eigenspace analysis and modelled with a given number of end-members (q). Several steps of scaling, transformation, normalisation, eigen space decomposition, factor rotation, data modelling and evaluation are performed.

Usage

EMMA(X, q, l, c, Vqn, EM.ID, classunits, ID, rotation = "Varimax",
  plot = FALSE, ..., pm = FALSE)

Arguments

X

Numeric matrix with m samples (rows) and n variables (columns).

q

Numeric scalar with number of end-members to be modelled.

l

Numeric scalar with the weight tranformation limit, i.e. quantiles, cf. Klovan & Imbrie (1971); default is 0.

c

Numeric scalar specifying the constant sum scaling parameter, e.g. 1, 100, 1000; default is 100.

Vqn

Numeric matrix specifying optional unscaled user-defined end-member loadings. If provided, these are used instead of model-derived ones.

EM.ID

Character vector with end-member names. If present, these will be set as row-names of the output data set and used in the legend text.

classunits

Numeric vector, optional class units (e.g. micrometers or phi-units) of the same length as columns of X.

ID

Numeric or character vector, optional sample IDs of the same length as rows of X.

rotation

Character scalar, rotation type, default is "Varimax" (cf. Dietze et al., 2012). One out of the rotations provided in GPArotation is possible (cf. rotations).

plot

Logical scalar, optional graphical output of the results, default is FALSE. If set to TRUE, end-member loadings and end-member scores are plotted.

pm

Logical scalar to enable pm.

...

Additional arguments passed to the plot function. Since the function returns two plots some additional graphical parameters must be specified as vector with the first element for the first plot and the second element for the second plot.

Details

The function values $loadings and $scores are redundant. They are essentially the same as $Vqsn and $Mqs. However, they are included for user convenience.

We kindly thank Christoph Burow for his quick contribution to remove unnecessary loops.

Value

A list with numeric matrix objects.

loadings

Normalised rescaled end-member loadings.

scores

Rescaled end-member scores.

Vqn

Normalised end-member loadings.

Vqsn

Normalised rescaled end-member loadings.

Mqs

Rescaled end-member scores.

Xm

Modelled data.

modes

Mode class of end-member loadings.

Mqs.var

Explained variance of end-members

Em

Absolute row-wise model error.

En

Absolute column-wise model error.

Rm

Row-wise (sample-wise) explained variance.

Rn

Column-wise (variable-wise) explained variance.

ol

Number of overlapping end-members.

Author(s)

Michael Dietze, Elisabeth Dietze

References

Dietze E, Hartmann K, Diekmann B, IJmker J, Lehmkuhl F, Opitz S, Stauch G, Wuennemann B, Borchers A. 2012. An end-member algorithm for deciphering modern detrital processes from lake sediments of Lake Donggi Cona, NE Tibetan Plateau, China. Sedimentary Geology 243-244: 169-180.
Klovan JE, Imbrie J. 1971. An Algorithm and FORTRAN-IV Program for Large-Scale Q-Mode Factor Analysis and Calculation of Factor Scores. Mathematical Geology 3: 61-77. Miesch AT. 1976. Q-Mode factor analysis of geochemical and petrologic data matrices with constant row sums. U.S. Geological Survey Professsional Papers 574.

See Also

test.parameters, rotations, eigen, nnls

Examples

## load example data and set phi-vector
data(X, envir = environment())
phi <- seq(from = 1, to = 10, length.out = ncol(X))

## perform EMMA with 5 end-members
EM <- EMMA(X = X, q = 5, l = 0.05, c = 100, plot = TRUE)

## perform EMMA with 4 end-members and more graphical settings
EM <- EMMA(X = X, q = 4, l = 0.05, c = 100,
           plot = TRUE,
           EM.ID = c("EM 1", "EM 2", "EM 3", "EM 4"),
           classunits = phi,
           xlab = c(expression(paste("Class [", phi, "]")), "Sample ID"),
           cex = 0.7,
           col = colors()[c(441, 496, 499, 506)])

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(EMMAgeo)
Loading required package: GPArotation
Loading required package: limSolve
Loading required package: shape
Loading required package: shiny
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EMMAgeo/EMMA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EMMA
> ### Title: Function for end-member modelling analysis.
> ### Aliases: EMMA
> ### Keywords: EMMA
> 
> ### ** Examples
> 
> ## load example data and set phi-vector
> data(X, envir = environment())
> phi <- seq(from = 1, to = 10, length.out = ncol(X))
> 
> ## perform EMMA with 5 end-members
> EM <- EMMA(X = X, q = 5, l = 0.05, c = 100, plot = TRUE)
> 
> ## perform EMMA with 4 end-members and more graphical settings
> EM <- EMMA(X = X, q = 4, l = 0.05, c = 100,
+            plot = TRUE,
+            EM.ID = c("EM 1", "EM 2", "EM 3", "EM 4"),
+            classunits = phi,
+            xlab = c(expression(paste("Class [", phi, "]")), "Sample ID"),
+            cex = 0.7,
+            col = colors()[c(441, 496, 499, 506)])
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>