mix.EM {EMMAgeo}  R Documentation 
This functions allows to mix grainsize distributions with specified proportions and defined noise levels, for example to test the goodness of the EMMA algorithm.
mix.EM(EM, proportion, noise, autocorrelation)
EM 
Each definition is in a separate row with variable contributions in columns. 
proportion 

noise 

autocorrelation 

The function multiplies each endmember with the respective proportion value, sums the resulting variables, adds uniform noise and normalises the resulting mixed sample to 100 %.
Numeric
vector, a sample composed of known proportions of
endmembers.
Michael Dietze, Elisabeth Dietze
## define endmember loadings and phi vector
EMa.1 < create.EM(p1 = c(2, 8), p2 = c(1, 0.8), s = c(0.7, 0.3),
boundaries = c(0, 11), n = 80)
EMa.2 < create.EM(p1 = c(4, 7), p2 = c(1.1, 1.4), s = c(0.5, 0.5),
boundaries = c(0, 11), n = 80)
EMa < rbind(EMa.1, EMa.2)
phi < seq(0, 11, length.out = 80)
## mix endmember loadings
sample1 < mix.EM(EMa, proportion = c(0.3, 0.7))
sample2 < mix.EM(EMa, proportion = c(0.5, 0.5), noise = 0.1,
autocorrelation = 3)
## plot endmember loadings (grey) and resulting samples (black)
plot(phi, EMa.1, type="l", col = "grey")
lines(phi, EMa.2, col = "grey")
lines(phi, sample1)
lines(phi, sample2)