Learn R Programming

MoEClust (version 1.6.0)

MoE_plotGate: Plot MoEClust Gating Network

Description

Plots the gating network for fitted MoEClust models, i.e. the observation index against the mixing proportions for that observation, coloured by cluster.

Usage

MoE_plotGate(res,
             x.axis = NULL,
             type = "b",
             pch = 1,
             xlab = "Observation",
             ylab = expression(widehat(tau)[g]),
             ylim = c(0, 1),
             col = NULL,
             ...)

Value

A plot of the gating network of the fitted MoEClust model. The parameters of the gating network can also be returned invisibly.

Arguments

res

An object of class "MoEClust" generated by MoE_clust, or an object of class "MoECompare" generated by MoE_compare. Models with a noise component are facilitated here too.

x.axis

Optional argument for the x-axis against which the mixing proportions are plotted. Defaults to 1:res$n if missing. Supplying x.axis changes the defaults for the type and xlab arguments. Users are advised to only use quantities related to the gating network of the fitted model here. Furthermore, use of the x.axis argument is not recommended for models with more than one gating network covariate.

type, pch, xlab, ylab, ylim, col

These graphical parameters retain their definitions from matplot. col defaults to the settings in mclust.options. Note that the default value of type changes depending on whether x.axis is supplied and whether the gating network contains multiple covariates &/or categorical covariates.

...

Catches unused arguments, or additional arguments to be passed to matplot.

Author

Keefe Murphy - <keefe.murphy@mu.ie>

See Also

MoE_clust, plot.MoEClust, matplot

Examples

Run this code
data(ais)
res   <- MoE_clust(ais[,3:7], gating= ~ BMI, G=3, modelNames="EEE",
                   network.data=ais, noise.gate=FALSE, tau0=0.1)

# Plot against the observation index and examine the gating network coefficients
(gate <- MoE_plotGate(res))

# Plot against BMI
MoE_plotGate(res, x.axis=ais$BMI, xlab="BMI")

# Plot against a categorical covariate
res2  <- MoE_clust(ais[,3:7], gating= ~ sex, G=3, modelNames="EVE", network.data=ais)
MoE_plotGate(res2, x.axis=ais$sex, xlab="sex")

Run the code above in your browser using DataLab