Learn R Programming

EMMAgeo (version 0.9.0)

EMMA: Function for end-member modelling analysis.

Description

Multivariate data (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, lw, c, Vqn, EM.ID, classunits, ID, rotation = "Varimax", 
    plot = FALSE, legend, ..., 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.
lw
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-derieved 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 if a legend is enabled.
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.
legend
Character scalar, legend position (cf. legend). If omitted, no legend will be plotted, default is no legend.
...
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. Legend conten
pm
Logical scalar to enable pm.

Value

  • A list with numeric matrix objects.
  • VqnNormalised end-member loadings.
  • VqsnNormalised rescaled end-member loadings.
  • MqsRescaled end-member scores.
  • XmModelled data.
  • modesMode class of end-member loadings.
  • Mqs.varExplained variance of end-members
  • EmAbsolute row-wise model error.
  • EnAbsolute column-wise model error.
  • RmRow-wise (sample-wise) explained variance.
  • RnColumn-wise (variable-wise) explained variance.
  • olNumber of overlapping end-members.

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

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

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

## perform EMMA with 4 end-members and more graphical sttings
EM <- EMMA(X = X.artificial, q = 4, lw = 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"),
           legend = "topleft", 
           cex = 0.7,
           colour = colors()[c(441, 496, 499, 506)])

Run the code above in your browser using DataLab