A major strength of DI models is the ability to predict the response
for any combination of the species proportions, including those not
present in the experimental design. This allows for the prediction and
visualisation of the response surface across the entire simplex space.
However, visualising the response surface for systems with more than
four species is challenging as higher dimensional (over four dimensions)
simplexes cannot be visualised directly. To address these,
DImodelsVis
offers two strategies for visualising the
response surface in such cases using ternary plots: (1) Conditional
ternary diagrams, where selected species are conditioned at fixed
proportions and the response surface is visualised as 2d slices of the
higher dimensional simplex and (2) Grouped ternary diagrams, where
species are grouped (or aggregated) into functional groups to reduce
dimensionality, enabling the response surface to be visualised in a
simplified, lower-dimensional space.
Conditional ternary diagrams
Conditional ternary diagrams are 2d slices of higher dimensional
simplexes. To create conditional ternary diagrams for a system with
\(s\) species, \(s-3\) species are conditioned to have fixed
values while the remaining three species are allowed to have any value
whilst respecting the sum-to-one constraint on the species proportions.
This allows the response surface to be visualised within a ternary plot
for those three species. By viewing multiple such slices each showing a
different set of species shown in the ternary and with different fixed
values for the remaining species we can gain an approximate
understanding of how the predicted response behaves across the full,
higher-dimensional compositional space.
The conditional_ternary()
function in
DImodelsVis
accepts a model object fitted using the
DImodels
(or DImodelsMulti
) package and
generates conditional ternary diagrams with the response surface
depicted as a contour map. Users must specify names of the three species
to be visualised in the tern_vars
parameter. The names and
values for the species to be held constant should be specified in the
conditional
parameter as a data-frame and a separate
ternary would be created for each row within this data.frame. In this
example, species p1, p3, p5 are allowed to vary while p7, p8, and p9 are
held constant at different values. Any species not specified within the
tern_vars
or conditional
arguments would be
assumed to be 0. Furthermore, values for any additional variables in the
model (treatment in this case) can be specified within the
add_var
parameter and separate sets of ternaries would be
created for each value specified here. Finally, any additional
parameters shown below are optional arguments specified to enhance
aesthetics of the final plot.
# Conditional ternary
conditional_ternary(FGModel, tern_vars = c("p1", "p3", "p5"),
conditional = data.frame("p7" = c(0, 0.1, 0.1),
"p8" = c(0, 0.1, 0.1),
"p9" = c(0, 0.0, 0.3)),
add_var = list("treatment" = c("A", "B")),
lower_lim = 6, upper_lim = 16, nlevels = 10,
nrow = 2)

The predicted response is higher for all mixtures receiving treatment
A. Within a specific treatment level, for the three species shown within
the ternaries, the predicted response is maximised by increasing the
proportion of p5 and decreases as p3 increases (notice that the
proportion of species in the ternaries only go as high as 1 - (p7 + p8 +
p9)). Amongst the conditioned species combinations, the ternary with p7
= 0.1, p8 = 0.1 and p9 = 0.3 (middle ternaries) appears to be the slice
with highest predicted response at a specific treatment level. The
response surface is also relatively flat across the entire ternary. This
indicates that the optimal composition of species maximising the
predicted response is near this region. However, to confirm this, we
would have to look at more slices including the three species (p2, p4,
and p6) fixed at non-zero values.
Grouped ternary diagrams
Grouped ternary diagrams are created by aggregating multiple species
into functional groups (FG) and visualising the response surface as a
contour map in a ternary diagram where some, or all the axes represent
the total functional group proportion, instead of the individual species
proportion. The total functional group proportion at each point across
the ternary can be split between the species contained within the group,
either equally or in a specific ratio (for example, if an FG contains
two species, the proportion along each point in the ternary could either
be split 1:1 between the two or 4:1 in favour of the first species).
Graphically, this process generates 2d slices of the higher dimensional
simplex. By adjusting the ratios in which the total FG proportion is
divided among the component species, slices across different regions of
the simplex can be generated.
The grouped_ternary()
function in
DImodelsVis
accepts a model object fitted using the
DImodels
(or DImodelsMulti
) package and
generates grouped ternary diagrams with the response surface depicted as
a contour map. Users must specify the functional group each species
belongs to as a character vector via the FG
parameter. By
default, the total FG proportion would be split equally between the
component species within each FG, however, these can be set manually by
using the values
parameter. Furthermore, values for any
additional variables in the model (treatment in this case) can be
specified within the add_var
parameter and separate sets of
ternaries would be created for each value specified here. Finally, any
additional parameters shown below are optional arguments specified to
enhance aesthetics of the final plot.
# Grouped ternary
group1 <- grouped_ternary(FGModel,
FG = c("FG1","FG1","FG1","FG1","FG1","FG2","FG2","FG3","FG3"),
add_var = list("treatment" = c("A", "B")),
lower_lim = 6, upper_lim = 16, nlevels = 10)
ggpubr::ggarrange(group1[[1]],
group1[[2]],
common.legend = TRUE,
legend = "bottom")

The predicted response is higher for mixtures receiving treatment A.
Within a specific treatment level, the predicted response is maximised
by combining species from FG1 and FG3 with the approximate optimal
composition being 55% of FG1 and 45% of FG3. Increasing the proportion
of FG2 causes the predicted response to decline sharply.
While the previous figure is great for selecting an optimal
combination of the functional groups, one still needs to select the
relative proportions of each species within each functional group. By
default, the total FG proportion is distributed equally between the
component species. For example, the total proportion of FG1 is split
into 20% each of p1, p2, p3, p4, and p5. Similarly, FG2 and FG3 are each
split evenly between their two component species, 50% each for p6 and p7
(FG2), and p8 and p9 (FG3). These default proportions can be modified to
explore the effects of different species combinations within an FG on
the predicted response. In the example below, FG1 is composed of 30% p1
and 70% p5, with p2, p3, and p4 excluded (0%). FG2 remains evenly split
between p6 and p7 (i.e., 50% each), while FG3 is composed of 20% p8 and
80% p9.
group2 <- grouped_ternary(FGModel,
FG = c("FG1","FG1","FG1","FG1","FG1","FG2","FG2","FG3","FG3"),
values = c("p1" = 0.3, "p2" = 0, "p3" = 0, "p4" = 0, "p5" = 0.7,
"p6" = 0.5, "p7" = 0.5, # Species within an FG should sum to 1
"p8" = 0.2, "p9" = 0.8),
add_var = list("treatment" = c("A", "B")),
lower_lim = 6, upper_lim = 16, nlevels = 10)
ggpubr::ggarrange(group2[[1]],
group2[[2]],
common.legend = TRUE,
legend = "bottom")

The response surface contours are similar to the ternary where the FG
proportion is split equally between the component species, in that the
optimal composition is one where FG1 and FG3 are combined in a 55%-45%
mix. However, the predicted response for the best mix is higher than the
case when FG1 and FG3 were split equally between their component
species. This suggests that, beyond functional group effects, species
identities also play a role in shaping the response, and that favouring
specific species (p1, p5 and p9 for this example) can enhance
performance.