In this section we walk through the EMMA algorithm and perform concurrently the calculations in R. Therefore we use the df.soil.samples data set provided here. This synthetic toy example set was created by randomly mixing four natural end-members \((q=4)\), corresponding to a particular transport regime (alluvial sediments, dune sediments, loess deposits and overbank sediments).

The data set consts of 45 rows, corresponding to the soil samples, and 99 columns. The columns correspond to a particular grain size class given on the Krumbein phi \((\phi)\) scale.

\[\phi = -\log_2 D/D_0\text{,} \] where \(D\) is the diameter of the particle or grain in millimeters, and \(D_0\) is a reference diameter, equal to \(1\) mm.

# load the data
load(url("https://userpage.fu-berlin.de/soga/300/30100_data_sets/data_emma.RData"))
str(df.soil.samples)
## 'data.frame':    45 obs. of  99 variables:
##  $ 0   : num  3.04e-04 2.27e-04 7.75e-05 3.80e-04 3.79e-04 ...
##  $ 0.1 : num  3.36e-04 2.48e-04 9.03e-05 4.17e-04 4.16e-04 ...
##  $ 0.2 : num  0.000375 0.000271 0.000111 0.000462 0.000458 ...
##  $ 0.31: num  0.000525 0.000297 0.000151 0.00052 0.000564 ...
##  $ 0.41: num  0.00071 0.000326 0.000234 0.000879 0.000687 ...
##  $ 0.51: num  0.001038 0.000361 0.000406 0.001238 0.000887 ...
##  $ 0.61: num  0.001605 0.000407 0.000745 0.001821 0.001218 ...
##  $ 0.71: num  0.002546 0.000473 0.00138 0.002727 0.001753 ...
##  $ 0.82: num  0.004021 0.000574 0.002499 0.004064 0.002584 ...
##  $ 0.92: num  0.006204 0.000734 0.00434 0.00593 0.003813 ...
##  $ 1.02: num  0.009236 0.000993 0.007166 0.008382 0.005532 ...
##  $ 1.12: num  0.01318 0.00141 0.0112 0.01142 0.0078 ...
##  $ 1.22: num  0.01797 0.00205 0.01655 0.01495 0.01063 ...
##  $ 1.33: num  0.0234 0.00301 0.0231 0.01881 0.01393 ...
##  $ 1.43: num  0.02908 0.00439 0.03048 0.02276 0.01757 ...
##  $ 1.53: num  0.03453 0.00629 0.03807 0.02652 0.02132 ...
##  $ 1.63: num  0.03922 0.00878 0.04511 0.02983 0.02493 ...
##  $ 1.73: num  0.0427 0.0119 0.0508 0.0324 0.0282 ...
##  $ 1.84: num  0.0446 0.0155 0.0547 0.0342 0.0308 ...
##  $ 1.94: num  0.0449 0.0195 0.0565 0.0349 0.0327 ...
##  $ 2.04: num  0.0436 0.0235 0.0563 0.0347 0.0338 ...
##  $ 2.14: num  0.041 0.0274 0.0545 0.0336 0.0341 ...
##  $ 2.24: num  0.0376 0.0306 0.0515 0.0318 0.0336 ...
##  $ 2.35: num  0.0336 0.0329 0.0479 0.0294 0.0326 ...
##  $ 2.45: num  0.0295 0.0339 0.0439 0.0268 0.031 ...
##  $ 2.55: num  0.0256 0.0337 0.0396 0.0239 0.0289 ...
##  $ 2.65: num  0.022 0.0322 0.0352 0.0212 0.0265 ...
##  $ 2.76: num  0.0187 0.0296 0.0307 0.0185 0.0238 ...
##  $ 2.86: num  0.0158 0.0263 0.0261 0.016 0.021 ...
##  $ 2.96: num  0.0133 0.0226 0.0217 0.0138 0.0182 ...
##  $ 3.06: num  0.0111 0.0189 0.0175 0.0118 0.0154 ...
##  $ 3.16: num  0.0092 0.0155 0.0138 0.01 0.0129 ...
##  $ 3.27: num  0.00761 0.01276 0.01066 0.00854 0.01067 ...
##  $ 3.37: num  0.00632 0.01073 0.00817 0.0073 0.0088 ...
##  $ 3.47: num  0.00532 0.00957 0.00638 0.00632 0.00731 ...
##  $ 3.57: num  0.00459 0.00942 0.00529 0.00559 0.0062 ...
##  $ 3.67: num  0.0041 0.01038 0.00486 0.00509 0.00544 ...
##  $ 3.78: num  0.00382 0.01243 0.00501 0.00481 0.00497 ...
##  $ 3.88: num  0.00371 0.01534 0.0056 0.00471 0.00476 ...
##  $ 3.98: num  0.00375 0.01859 0.00641 0.00478 0.00476 ...
##  $ 4.08: num  0.0039 0.02144 0.00716 0.005 0.00492 ...
##  $ 4.18: num  0.00417 0.0232 0.00764 0.00534 0.00524 ...
##  $ 4.29: num  0.00454 0.0235 0.00772 0.00581 0.00568 ...
##  $ 4.39: num  0.00499 0.02248 0.00742 0.00638 0.00625 ...
##  $ 4.49: num  0.00554 0.02069 0.0069 0.00705 0.00692 ...
##  $ 4.59: num  0.00616 0.01882 0.00632 0.00781 0.0077 ...
##  $ 4.69: num  0.00684 0.01735 0.00585 0.00864 0.00855 ...
##  $ 4.8 : num  0.00757 0.0165 0.00556 0.00951 0.00947 ...
##  $ 4.9 : num  0.00832 0.01619 0.00544 0.0104 0.0104 ...
##  $ 5   : num  0.00906 0.01623 0.00543 0.01126 0.01133 ...
##  $ 5.1 : num  0.00976 0.01641 0.00547 0.01207 0.0122 ...
##  $ 5.2 : num  0.0104 0.0166 0.0055 0.0128 0.013 ...
##  $ 5.31: num  0.0109 0.0166 0.0055 0.0133 0.0136 ...
##  $ 5.41: num  0.01122 0.0164 0.00544 0.01376 0.01403 ...
##  $ 5.51: num  0.01141 0.01603 0.00532 0.01399 0.01427 ...
##  $ 5.61: num  0.01144 0.01546 0.00513 0.01403 0.0143 ...
##  $ 5.71: num  0.01131 0.01472 0.00489 0.0139 0.01414 ...
##  $ 5.82: num  0.01104 0.01385 0.00461 0.0136 0.0138 ...
##  $ 5.92: num  0.01065 0.01288 0.00429 0.01317 0.01331 ...
##  $ 6.02: num  0.01017 0.01186 0.00395 0.01264 0.01271 ...
##  $ 6.12: num  0.00965 0.01084 0.00362 0.01204 0.01206 ...
##  $ 6.22: num  0.0091 0.00985 0.00329 0.01141 0.01138 ...
##  $ 6.33: num  0.00857 0.00893 0.00299 0.01078 0.01071 ...
##  $ 6.43: num  0.00807 0.0081 0.00271 0.01018 0.01009 ...
##  $ 6.53: num  0.00761 0.00736 0.00247 0.00962 0.00952 ...
##  $ 6.63: num  0.00721 0.00673 0.00225 0.00912 0.00902 ...
##  $ 6.73: num  0.00687 0.0062 0.00208 0.00868 0.00859 ...
##  $ 6.84: num  0.00658 0.00575 0.00193 0.0083 0.00822 ...
##  $ 6.94: num  0.00633 0.00539 0.0018 0.00797 0.00791 ...
##  $ 7.04: num  0.00611 0.00508 0.0017 0.00769 0.00764 ...
##  $ 7.14: num  0.00592 0.00482 0.00161 0.00743 0.0074 ...
##  $ 7.24: num  0.00575 0.0046 0.00154 0.0072 0.00719 ...
##  $ 7.35: num  0.00558 0.00441 0.00147 0.00699 0.00698 ...
##  $ 7.45: num  0.00542 0.00423 0.00141 0.00678 0.00678 ...
##  $ 7.55: num  0.00526 0.00407 0.00136 0.00657 0.00657 ...
##  $ 7.65: num  0.00509 0.00391 0.0013 0.00636 0.00636 ...
##  $ 7.76: num  0.00492 0.00376 0.00125 0.00614 0.00615 ...
##  $ 7.86: num  0.00474 0.0036 0.0012 0.00591 0.00592 ...
##  $ 7.96: num  0.00455 0.00345 0.00115 0.00568 0.00569 ...
##  $ 8.06: num  0.00435 0.00329 0.0011 0.00544 0.00544 ...
##  $ 8.16: num  0.00416 0.00313 0.00104 0.00519 0.00519 ...
##  $ 8.27: num  0.003953 0.002976 0.000992 0.004939 0.004941 ...
##  $ 8.37: num  0.003747 0.002816 0.000939 0.004684 0.004684 ...
##  $ 8.47: num  0.00354 0.002657 0.000886 0.004428 0.004425 ...
##  $ 8.57: num  0.003333 0.002499 0.000833 0.004171 0.004166 ...
##  $ 8.67: num  0.003127 0.002342 0.000781 0.003916 0.003909 ...
##  $ 8.78: num  0.002924 0.002187 0.000729 0.003664 0.003656 ...
##  $ 8.88: num  0.002725 0.002036 0.000679 0.003417 0.003407 ...
##  $ 8.98: num  0.00253 0.00189 0.00063 0.00318 0.00316 ...
##  $ 9.08: num  0.002343 0.001746 0.000583 0.002942 0.002929 ...
##  $ 9.18: num  0.002161 0.001609 0.000537 0.002716 0.002702 ...
##  $ 9.29: num  0.001987 0.001478 0.000493 0.002499 0.002484 ...
##  $ 9.39: num  0.001821 0.001352 0.000451 0.002291 0.002276 ...
##  $ 9.49: num  0.001663 0.001233 0.000412 0.002094 0.002079 ...
##  $ 9.59: num  0.001513 0.001121 0.000374 0.001908 0.001892 ...
##  $ 9.69: num  0.001373 0.001016 0.000339 0.001694 0.001716 ...
##  $ 9.8 : num  0.001223 0.000917 0.000306 0.00153 0.001529 ...
##  $ 9.9 : num  0.001101 0.000826 0.000276 0.001377 0.001376 ...
##  $ 10  : num  0.000988 0.000741 0.000247 0.001236 0.001235 ...

Let us plot the first sample out of 45 samples:

phi <- colnames(df.soil.samples)
plot(phi, df.soil.samples[1,], type="l", ylab='')

We see a multimodal grain size distribution ranging from \(\phi = 0\) to \(\phi = 9.9\), which corresponds to grain sizes ranging from \(0.977\) (coarse sand) to \(1000 \; \mu \text{m}\) (clay). If we plot our 45 samples against the 4 natural end-members, we see that each particular soil sample is a mixture of the 4 natural end-members. The goal of EMMA is to unmix the natural end-members and thus, the underlying transport regimes.