plotDiff: Plot differences across mixture models

Description Usage Arguments Value Examples

View source: R/plotDiff.R

Description

Plot differences across mixture models

Usage

1
2
3
plotDiff(object, type = "weight", dim = c(1, 2),
  group = 1:length(unique(object$data$C)), xlim = range(object$data$Y[,
  dim[1]]), ylim = range(object$data$Y[, dim[2]]), ...)

Arguments

object

Object of class inheriting from "mpk".

type

String indicating whether the data-points are colored according to difference in mixture weights type = "weight", or difference in the mean parameters type = "shift".

dim

Vector indicating along which dimension the data are projected. Default is dim = c(1,2).

group

Vector indicating which groups are plotted. By default all groups are plotted.

xlim

the x limits (x1, x2) of the plot.

xlim

the y limits of the plot.

Value

A plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = c(250, 250)
p = 4

Y1 = rbind( matrix( rnorm( n[1]*p), ncol = p), matrix( rnorm(n[2]*p) + 3, ncol = p))
Y2 = rbind( matrix( rnorm( n[1]*p), ncol = p), matrix( rnorm(n[2]*p) + 4, ncol = p))
Y = rbind(Y1, Y2)
C = c( rep(1,sum(n)), rep(2,sum(n)))

ans = mpk(Y, C)
plotDiff(ans, type = "weight")
plotDiff(ans, type = "shift")

jacsor/MPK documentation built on May 18, 2019, 9:05 a.m.